summaryrefslogtreecommitdiffstats
path: root/libvo
Commit message (Collapse)AuthorAgeFilesLines
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-1242-21808/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.
* vo_opengl: fix compatibility with OpenGL 2.1wm42012-11-122-0/+11
| | | | | | | | | | | | | | | | | The srgb_compand() function passes bvec to mix(), which is apparently not available on GL 2.1 / GLSL 1.20: 0:0(0): error: no matching function for call to `mix(vec3, vec3, bvec3)' 0:0(0): error: candidates are: float mix(float, float, float) 0:0(0): error: vec2 mix(vec2, vec2, vec2) 0:0(0): error: vec3 mix(vec3, vec3, vec3) 0:0(0): error: vec4 mix(vec4, vec4, vec4) 0:0(0): error: vec2 mix(vec2, vec2, float) 0:0(0): error: vec3 mix(vec3, vec3, float) 0:0(0): error: vec4 mix(vec4, vec4, float) Also add back disabling color management on older GL, as the srgb_compand() function is needed for that.
* vo_opengl: fix srgb for subtitlesnand2012-11-112-8/+21
| | | | | | | | | | | | | | Based on a patch by nand. This is needed, because sRGB mode changes the video over-all gamma. This has to be done for subtitles as well. The final srgb_compand() call in the OSD shader compensates for the fact that in ed8fad729d04 framebuffer use was replaced with doing sRGB conversion manually by srgb_compand(). This only affects subtitles rendered with libass. Nothing is changed for RGB subs. Also change the USE_ flags for OSD shaders to USE_OSD_ to make the difference between video and OSD rendering more apparent.
* vo_xv: don't call vo_xv_get_eq() on every framewm42012-11-111-7/+17
| | | | | | | This was done to query the colorspace for sub/OSD rendering. A single vo_xv_get_eq() call probably requires a dozens of round-trips (depending what xlib actually does). This likely wasn't a real problem, but it might be better to be paranoid about this.
* vo_opengl: disable extended downscaling by defaultwm42012-11-111-1/+0
| | | | | | | | To simplify implementation, the same filter kernel was used for both directions, even when the scaling factors were different. It turns out that people actually did this, and that the resulting rendering errors were rather visible. Disable this feature by default, as fixing it would require structural changes, and it's a useless anyway.
* Replace fast_memcpy() useswm42012-11-111-3/+0
| | | | | | | fast_memcpy, defined in fastmemcpy.h, used to be mplayer's "optimized" memcpy. It has been removed from this fork, and fast_memcpy has been reduced to an alias for memcpy. Replace all remaining uses of the fast_memcpy macro alias.
* vo_opengl: add manual sRGB companding to not artifact when ditheringnand2012-11-112-14/+11
| | | | | | Patch by nand. Modified not to use macros in the GLSL, and also remove the checks for framebuffer presence. (Disabling ICC if no sRGB framebuffer is available was probably a bug.)
* cocoa_common: honor the `--geometry` optionStefano Pigozzi2012-11-101-1/+7
|
* 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
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |