summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
Commit message (Collapse)AuthorAgeFilesLines
* vd_ffmpeg: disable codec direct rendering and slices by defaultwm42012-11-071-1/+1
| | | | | | | | | | | | | | | This caused failures when doing single threaded decoding in some cases. It's unknown what exactly the reasons are for these failures, but direct rendering is probably worthless anyway. Disable slices by default as well, just to be sure not to invoke broken code paths. Multithreading disables these too. The old behavior can be restored by passing the -dr1 -slices command line options. (-dr1 is left undocumented intentionally.) Multithreaded decoding worked fine, because vd_ffmpeg.c automatically disables direct rendering in this case.
* libav_compat: fix mmx2 define, provide fallback for avcodec_free_frameStefano Pigozzi2012-11-032-2/+2
|
* audio: untypedef af_streamStefano Pigozzi2012-11-021-1/+1
|
* audio: untypedef af_cfgStefano Pigozzi2012-11-021-2/+2
|
* audio: untypedef af_data and rename it to mp_audioStefano Pigozzi2012-11-021-2/+2
| | | | this is to have something specular to mp_image
* Merge branch 'osd_changes' into masterwm42012-11-0113-348/+364
|\ | | | | | | | | Conflicts: DOCS/man/en/options.rst
| * screenshot: remove hack for passing anamorphic image sizewm42012-11-012-1/+4
| | | | | | | | | | | | | | | | | | | | 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-011-0/+1
| | | | | | | | | | | | | | | | | | 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-24/+54
| | | | | | | | | | 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-284-0/+45
| | | | | | | | | | | | 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.
| * mp_image: use uint8_t instead of unsigned char for plane pointerswm42012-10-281-1/+2
| | | | | | | | Purely cosmetic.
| * Merge branch 'master' into osd_changeswm42012-10-249-121/+21
| |\ | | | | | | | | | | | | Conflicts: libvo/vo_xv.c
| * | core: disable vf_sub auto-insertionwm42012-10-241-14/+0
| | | | | | | | | | | | | | | | | | | | | Since most VOs support rendering subs directly, this doesn't change much. Changes include: vo_null is faster, vo_image doesn't add subtitles by default (while vo_lavc does), vo_caca doesn't render subs (but you couldn't read them anyway).
| * | VF: rename vf_ass to vf_subwm42012-10-243-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reflects the fact that this filter now renders all types of subtitles, not just ASS subtitles. Always compile this filter, not just on CONFIG_ASS. Note that --no-ass still disables auto-inserting this filter. It's the only way to disable auto-insertion, so keep it even though it's not really ASS specific anymore. --no-ass also disables using libass for rendering text subs directly.
| * | draw_bmp: fix for yuy2 formatwm42012-10-241-0/+3
| | | | | | | | | | | | | | | | | | | | | mp_get_chroma_shift() modifies its argument even if it fails, so we have to restore that. mp_image didn't set chroma shifts for yuy2.
| * | core: do not try to redraw OSD if VO doesn't support OSDwm42012-10-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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, sub: refactorwm42012-10-244-20/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | draw_bmp: don't try to call swscale if image format not supportedwm42012-10-242-2/+15
| | | | | | | | | | | | If that happens, we silently fail.
| * | sub, vf_ass: allow rendering RGBA subs, replace old vf_ass renderingwm42012-10-241-156/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-241-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | mp_image: hack to fix alignment for certain image formatswm42012-10-241-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This is to get rid of swscale alignment warnings with the new OSD code. Only image formats used by it are fixed. Solving this generally would require some more effort. (Possibly by using libav's allocation functions plus lots of testing.)
| * | sub: add helper to draw sub-bitmaps into an imageRudolf Polzer2012-10-242-0/+27
| | | | | | | | | | | | | | | Merged by wm4 from commits 93978f17b76d..13211ef5fc20. Changed copyright header in draw_bmp.c to "mpv", and removed the one in draw_bmp.h.
| * | mp_image: fix copy_mpi() with 16 bit formats, add helper macrosRudolf Polzer2012-10-242-5/+17
| | | | | | | | | | | | | | | | | | | | | Merged by wm4. copy_mpi() assumed that planar YUV formats always used 1 byte per component, which is not true for 9/10/16 bit YUV formats.
| * | libmpcodecs: move vf_scale.c swscale helper functions to sws_utils.cRudolf Polzer2012-10-245-111/+163
| | | | | | | | | | | | | | | 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-1652-16297/+37
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: cosmetics: move things aroundwm42012-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: always go through sub.c for OSD renderingwm42012-10-163-34/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, vf_vo.c and vf_ass.c were manually calling the subtitle decoder to retrieve images to render. In particular, this circumvented the sub-bitmap conversion & caching layer in sub.c. Change this so that subtitle decoding isn't special anymore, and draws all subtitles with the normal OSD drawing API. This is also a step towards removing the need for vf_ass auto-insertion. In fact, if auto-insertion would be disabled now, VOs with "old" OSD rendering could still render ASS subtitles in monochrome, because there is still ASS -> old-OSD bitmap conversion in the sub.c mechanism. The code is written with the assumption that the subtitle rendering filter (vf_ass) can render all subtitle formats. Since vf_ass knows the ASS format only, rendering image subs (i.e. RGBA subs) with it simply fails. This means that with vo_xv (vf_ass auto-inserted), image subs wouldn't be rendered. Use a dumb hack to disable rendering subs with a filter, if we detect that the subs are not in ASS format. (Trying to render the subs first would probably result in purging the conversion cache on every frame.)
| * | | sub: remove logic for disabling hinting on scaled EOSDwm42012-10-162-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was an extremely obscure setting, as it was used only with vo_gl if its scaled-osd suboption was used. If you really want this, you can set the desired ass-hinting value directly, and there will be literally no loss in functionality. Note that this didn't actually test whether the EOSD was scaled. Basically, it only checked whether vo_gl had the scaled-osd suboption set.
| * | | sub: create sub_bitmap array even when using libasswm42012-10-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One sub_bitmaps struct could contain either a libass ASS_Image list, or a mplayer native list of sub-bitmaps. This caused code duplication in vo_vdpau.c and bitmap_packer.c. Avoid this by creating such a sub_bitmap array even with libass. This basically copies the list and recreates it in mplayer's native format. It gets rid of the code duplication, and will make implementing extended subtitle and OSD rendering in other VOs easier. Also do some cosmetic changes and other preparations for the following commits.
* | | | ad_spdif: don't print uninitialized value in debug messagewm42012-11-011-2/+2
| | | |
* | | | vf: fix NULL pointer issuewm42012-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | "mpi" was accessed right after the if block, that checked that mpi is not NULL. Either the check is uneeded, or the access to "mpi" always crashes. Just move the access inside the checked block.
* | | | vd: minor simplificationwm42012-11-011-2/+1
| | | |
* | | | cleanup: remove some things related to old video decoderswm42012-10-304-55/+18
| | | |
* | | | demux_lavf: add a hack to work around other hackswm42012-10-302-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer (and all forks) use a single FourCC field to map codecs. This is what sh_video->format and sh_audio->format is used for. Basically it's a key into the codecs.conf table to find out what decoder to use. (There's only one video codec and one major audio codec left - both libavcodec. But we still have to deal with mapping coming from non-libavformat demuxers.) It seems this causes some video codecs to fail, such as WV1F in AVI [1]. demux_lavf generally throws away the codec_tag from libavformat if the codec is MPEG-in-AVI. There are probably other cases like this. Add a hack to enforce passing the correct codec tag when only ffmpeg demuxers and decoders involved. Note: the sample [1] needs to be flipped. With --demuxer=avi, this is done correctly, because unlike demux_lavf, the demuxer uses the FourCC directly for the sh_video->format tag, and finds the correct codecs.conf entry (which contains the flip flag). We could just add a "whitelist" of codec tags which can be passed through to sh_video->format, but I don't want to do that just for such an obscure format as the sample at hand. Note 2: when demux_lavf is used, the AVCodecContext could be passed directly to vd_ffmpeg/ad_ffmpeg. The code to convert to/from the internal mplayer stream headers is probably still needed, as there are non-ffmpeg demuxers and audio decoders. [1] http://samples.mplayerhq.hu/V-codecs/WV1F/AVI/title2.avi
* | | | libmpcodecs: fix coverity issuesreimar2012-10-305-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |