summaryrefslogtreecommitdiffstats
path: root/libvo
Commit message (Collapse)AuthorAgeFilesLines
* cocoa_common: save vo struct earlier in the startup processStefano Pigozzi2012-11-051-1/+1
| | | | This prevents a crash with -fs option.
* libav_compat: fix mmx2 define, provide fallback for avcodec_free_frameStefano Pigozzi2012-11-031-1/+1
|
* Merge branch 'osd_changes' into masterwm42012-11-0129-2810/+1412
|\ | | | | | | | | Conflicts: DOCS/man/en/options.rst
| * VO: remove code duplication for setting up mp_osd_reswm42012-11-016-188/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_opengl, vo_vdpau, vo_direct3d had the code for setting up mp_osd_res duplicated. Make things simpler by making calc_src_dst_rects() setup the full mp_osd_res structure, instead of just "borders". Also, rename that function to vo_get_src_dst_rects(), and make it use mp_rect. Remove vo_rect, which was annoying because it contains redundant members (width/height additional to right/bottom). Add code to print the video rect etc. in verbose mode. There should be no actual change how the video rects are calculated. The only exception are the bottom/right subtitle margins, which are now computed slightly differently, but that shouldn't matter.
| * vo_vdpau: remove unneeded assignment to vo_fswm42012-11-011-3/+0
| | | | | | | | | | This is already done by x11_common.c. Other X11 VOs don't touch the vo_fs variable directly.
| * vo_opengl, vo_opengl_old: remove -wid/viewport special casewm42012-11-012-13/+1
| | | | | | | | | | | | | | | | | | For reasons unknown to me, vo_gl had a special case for when the -wid option (slave mode embedding) and -geometry was used. This adjusted the viewport in a way different from normal operation. It's unknown what this was needed for (if it's sane at all), but since no other VOs use this special case, and since we broke slave mode compatibility anyway, remove it.
| * screenshot: remove hack for passing anamorphic image sizewm42012-11-016-23/+16
| | | | | | | | | | | | | | | | | | | | With anamorphic video (display with non-1:1 PAR, e.g. DVD), the display size was passed using the mp_image fields w/h, which was blatantly incorrect. w/h are the normal image dimensions, while width/height are the "uncropped" storage size (used internally by vf.c). Add a display_w/h, and use that for the display size. Make all VOs that can do screenshots use it.
| * screenshot: let VOs pass colorspace information via mp_imagewm42012-11-016-1/+12
| | | | | | | | | | | | | | | | | | This removes the hack that screenshot_save() got the colorspace information from the decoder. Instead, require the VOs to set the colorspace information on the mp_images used to pass around the screenshot data. This is more correct, as the image may have been converted/modified in the video filter chain, although there's nothing yet in the video filter chain which does this correctly.
| * screenshot, draw_bmp: use colorspace passed with mp_imagewm42012-11-013-9/+9
| | | | | | | | | | Remove the explicit struct mp_csp_details parameters from all related functions, and use mp_image.colorspace/levels instead.
| * mp_image: add fields to pass colorspace down the filter chainwm42012-10-282-1/+6
| | | | | | | | | | | | Note that this also adds a RGB colorspace for general symmetry. The frontend (colormatrix property and options) and mp_get_yuv2rgb_coeffs() don't support this.
| * csputils: better support for integer color valueswm42012-10-282-7/+21
| |
| * draw_bmp, csputils: use function instead of macrowm42012-10-282-13/+5
| |
| * Merge branch 'master' into osd_changeswm42012-10-2412-293/+422
| |\ | | | | | | | | | | | | Conflicts: libvo/vo_xv.c
| * | vo_lavc: never draw OSDwm42012-10-241-1/+1
| | | | | | | | | | | | | | | | | | This guarantees that only subtitles are drawn. (Before this change, we relied on the fact that OSD is only visible on user interaction, or if explicitly request with --osd-level.)
| * | vo_corevideo: add screenshot capabilityStefano Pigozzi2012-10-245-40/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added screenshot capability to the corevideo VO by sending back the raw data from the CVPixelBuffer. Also added "screenshot window" functionality from the other OpenGL based VOs, which uses glReadPixels to read image data back. This was moved to gl_common to avoid duplication.
| * | core: do not try to redraw OSD if VO doesn't support OSDwm42012-10-242-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes awkward framestepping when seeking with -vo null while paused (caused because seeking by default draws an OSD bar, and mplayer trying to redraw the OSD in that case; this logic is actually needed with vo_xv). It would have been simpler to just check vo->driver->draw_osd (and leave that callback to NULL for VOs which don't support OSD), but for now try to retain the capability to let VOs decide based on the image format whether to support OSD or not.
| * | vo_corevideo: fix EOSD artifactsStefano Pigozzi2012-10-241-13/+16
| | | | | | | | | | | | | | | | | | The new EOSD code suffered from artifacts due to missing setup of a projection matrix. This commit fixes the problem and uniforms the resize code to the one driving vo_opengl_old.
| * | screenshot: allow taking screenshots with subtitleswm42012-10-242-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new screenshot mode "subtitles", which basically takes the video frame as decoded, and renders subtitles into it. This may fail for some pixel formats, because libswscale sucks. If this becomes ever a real problem, the code could be changed to convert the image to RGBA first (or whatever the image writer wants), and then render the subtitles into it. This would avoid the additional image copy needed with vo_xv too. But for now, it seems better to go with the current method in the common case: vo_opengl creates an image copy anyway, and drawing bitmaps to yv12 is better, as no color space conversion is involved in draw_bmp.c's up/downsampling conversion.
| * | vo_corevideo: uninitialize CoreVideo objects before OpenGLwm42012-10-241-1/+1
| | |
| * | VO, sub: refactorwm42012-10-2411-209/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD, VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT. Remove draw_osd_with_eosd(), which rendered the OSD by calling VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes a callback as argument. (This basically works like the old OSD API, except multiple OSD bitmap formats are supported and caching is possible.) Remove all mentions of "eosd". It's simply "osd" now. Make OSD size per-OSD-object, as they can be different when using vf_sub. Include display_par/video_par in resolution change detection. Fix the issue with margin borders in vo_corevideo.
| * | sub, vf_ass: allow rendering RGBA subs, replace old vf_ass renderingwm42012-10-243-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do this by replacing all the old vf_ass drawing code by draw_bmp.c. Change sub.c to always use osd_draw() for the other OSD drawing routines, and simplify the code a bit. spudec.c subtitles (i.e. DVD subs) are now considered subtitles, and are rendered by vf_ass, if that filter is inserted.
| * | sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactorwm42012-10-247-53/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes that vo_xv didn't display text subtitles correctly when using anamorphic video. It didn't pass the aspect information to the subtitle renderer. Also, try to render OSD correctly with respect to aspect ratio settings: on vo_xv, the OSD is rendered into the video, and needs to be "stretched" too when playing anamorphic video. When the -monitorpixelaspect option is used, even with VOs such as vo_opengl the OSD has to be rendered with that aspect ratio. As preparation for future commits, replace the weird vsfilter_scale value with a somewhat more sensible video_par member. Also, struct mp_eosd_res is a better place for the aspect ratio parameters, as OSD needs this too. Use osd_draw_on_image() directly in vo_lavc, which fixes aspect ratio issues as well.
| * | spudec: use csputils for color conversionwm42012-10-242-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just to get rid of that conversion copy&pasted from the internet. R and G are swapped for unknown reasons. Testing various subtitles seem to yield the same results as VLC. The sub-bitmap renderers output the correct colors. The colorspace conversion is used without problems for vo_gl, vo_gl3 and vo_vdpau. The problem is most likely that apparently, the DVD palette read from the subtitle track extradata is converted to YUV using vobsub_palette_to_yuv(), and swapped in the process. Or in other words, the YUV colors spu->global_palette are encoded with R and G swapped. Add some utility definition to csputils.c/h to make converting single color values easier.
| * | Remove things related to old OSDwm42012-10-249-647/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To ease changing all the VOs to the new OSD rendering, fallbacks, conversions, support code etc. was left all over the code. Now that all VOs have been changed, all that code is inactive. Remove it. Strip down spudec.c. We don't need the old grayscale and scaling stuff anymore. (Not removing spudec itself yet - I'm not confident that the libavcodec DVD sub decoder is sufficient, and it would also require some hacks to get DVD palette and resolution information from libdvdread to libavcodec.) The option --spuaa, --spualign, --spugauss were used with the old sub scaling code, and don't do anything anymore.
| * | vo_x11: use new OSD APIwm42012-10-241-60/+26
| | |
| * | vo_xv: simplify screenshot codewm42012-10-241-35/+5
| | | | | | | | | | | | | | | | | | We now have a simple function to get a XvImage buffer as mp_image. Return that as screenshot. We don't even need to copy the image (we allocate a mp_image struct only, no image data).
| * | vo_xv: use new OSD APIwm42012-10-241-101/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aspect ratio stuff needs to be fixed later. "Fixing" the position of OSD elements outside of the screen due to panscan needs to be added back as well (what the removed fixup_osd_position() function did). The amount of data needed to "backup" an image when OSD is rendered increases. This is because we support color OSD/subtitles now. The old code rendered into the Y plane only, while the new code touches all 3 planes. For YV12, which is probably the only format supported not considering chroma-swapped and packed formats, 0.5 times more memory is copied when the OSD is used in pause mode.
| * | vo_lavc: use new OSD APIRudolf Polzer2012-10-241-83/+50
| | | | | | | | | | | | Merged by wm4 from commits c93978f17b76 and following.
| * | csputils: cosmetic changeswm42012-10-241-15/+5
| | |
| * | sub: add helper to draw sub-bitmaps into an imageRudolf Polzer2012-10-242-0/+64
| | | | | | | | | | | | | | | Merged by wm4 from commits 93978f17b76d..13211ef5fc20. Changed copyright header in draw_bmp.c to "mpv", and removed the one in draw_bmp.h.
| * | libmpcodecs: move vf_scale.c swscale helper functions to sws_utils.cRudolf Polzer2012-10-241-2/+1
| | | | | | | | | | | | | | | Extracted/rebased by wm4 from commits 93978f17b76d..13211ef5fc20. Actual mp_image_swscale is added in a later commit.
| * | Merge branch 'master' into osd_changeswm42012-10-1614-844/+1146
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile command.c libvo/gl_common.c libvo/vo_corevideo.m libvo/vo_opengl.c libvo/vo_opengl_old.c libvo/vo_opengl_shaders.glsl sub/ass_mp.c sub/osd_libass.c sub/sd_ass.c
| * | | sub: switch to premultiplied alphawm42012-10-163-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes problems with ugly borders. Note that at least in the DVD sub case, we could have just set all transparent pixels to black to solve this. vo_direct3d.c change untested, because mingw is a miserable pile of crap.
| * | | sub: never decode subs to old OSD formatwm42012-10-163-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, sd_lavc.c and spudec.c (the two image sub decoders) always output indexed/paletted images. For this purpose, add SUBBITMAP_INDEXED, and convert the subs to RGBA in img_convert.c instead. If a VO is used that supports the old OSD format only, the indexed bitmaps are converted to the old OSD format by abusing spudec.c in a similar way sd_lavc.c used to do. The main reason why spudec.c is used is because the images must not only be converted to the old format, but also properly scaled, cropped, and aligned (the asm code in libvo/osd.c requires this alignment). Remove support for the old format (packed variant) from the OpenGL VOs. (The packed formats were how the actual OSD format was handled in some GPU-driven VOs for a while.) Remove all conversions from old to new formats. Now all subtitle decoders and OSD renderers produce the new formats only. Add an evil hack to convert the new format (scaled+indexed bitmaps) to the old format. It creates a new spudec instance to convert images to grayscale and to scale them. This is temporary for VOs which don't support new OSD formats yet (vo_xv, vo_x11, vo_lavc).
| * | | sub: cosmetics: move things aroundwm42012-10-165-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move sub-bitmap definitions from dec_sub.h to sub.h. While it's a bit odd that OSD data structures are in a file named sub.h, it's definitely way too strange to have them in a file about subtitle decoding. (Maybe sub.h/.c and the sub/ directory should be split out and renamed "osd" at a later point.) Remove including ass_mp.h (and the libass headers) where possible. Remove typedefs for mp_eosd_res and sub_bitmaps structs. Store a mp_eosd_res struct in osd_state instead of just w/h. Note that sbtitles might be rendered using different sizes/margins when filters are involved (the subtitle renderer is not supposed to use the OSD res directly, and the "dim" member removed in the previous commit is something different).
| * | | sub, VO: remove vo_osd_resized() functionwm42012-10-165-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VOs which could render the OSD in window size (as opposed to video size, like vo_xv) and which could cache the OSD called this when the window size changed. This was needed, because VOs used another OSD function to check whether the OSD changed before passing the new window size to the OSD code. This was really just an artifact of OSD change detection, and now that the affected VOs use the new OSD rendering API, it's done automatically.
| * | | libvo: remove eosd_packer.cwm42012-10-162-329/+0
| | | | | | | | | | |