summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
Commit message (Collapse)AuthorAgeFilesLines
* libmpcodecs: rename IMGFMT_GBR24P to IMGFMT_GBRPwm42012-03-254-8/+8
| | | | This is more in line with the ffmpeg/libav names.
* vf_scale: prefer converting GBR24P to other 8 bit per component RGB formatsreimar2012-03-251-0/+4
| | | | | | | | Compared to converting to Y444 this should be faster and lossless. Based on patch by Hans-Kristian Arntzen [maister archlinux us] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34317 b3059339-0415-0410-9bf9-f77b7e298cf2
* libmpcodecs: support planar GBR24 decodingcehoyos2012-03-254-1/+10
| | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34245 b3059339-0415-0410-9bf9-f77b7e298cf2 Note: ffmpeg first introduced PIX_FMT_GBR24P, which was used in this commit. Later, it was renamed to PIX_FMT_GBRP in ffmpeg and libav. This was updated in revision 34492 in mplayer, but the mplayer specific names (such as IMGFMT_GBR24) were left unchanged.
* Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-165-7/+8
|\ | | | | | | | | | | | | | | Conflicts: command.c mp_core.h mplayer.c screenshot.c
| * windows support: unicode filenameswm42012-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows uses a legacy codepage for char* / runtime functions accepting char *. Using UTF-8 as the codepage with setlocale() is explicitly forbidden. Work this around by overriding the MSVCRT functions with wrapper macros, that assume UTF-8 and use "proper" API calls like _wopen etc. to deal with unicode filenames. All code that uses standard functions that take or return filenames must now include osdep/io.h. stat() can't be overridden, because MinGW-w64 itself defines "stat" as a macro. Change code to use use mp_stat() instead. This is not perfectly clean, but still somewhat sane, and much better than littering the rest of the mplayer code with MinGW specific hacks. It's also a bit fragile, but that's actually little different from the previous situation. Also, MinGW is unlikely to ever include a nice way of dealing with this.
| * cleanup: Silence compilation warnings on MinGW-w64wm42012-03-014-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-0513-58/+53
|\| | | | | | | | | | | Conflicts: mplayer.c screenshot.c
| * configure, build: support compiling without libpostprocUoti Urpala2012-02-271-0/+2
| | | | | | | | | | | | libpostproc has been removed from Libav and the library now exists as a separate project. Because it's not essential, separate it from the Libav library check and allow compiling without it.
| * vd_ffmpeg: fix flushing of buffered framesUoti Urpala2012-02-031-3/+0
| | | | | | | | | | | | | | | | | | The vd_ffmpeg decode() function returned without doing anything if the input packet had size 0. This meant that flushing buffered frames at EOF did not work. Remove this test. Have the core code skip such packets coming from the file being played instead (Libav treats 0-sized packets as flush signals anyway, so better assume such packets do not represent real frames with any codec).
| * vd_ffmpeg: adjust buffered frame count based on threads againUoti Urpala2012-02-031-0/+2
| | | | | | | | | | | | | | | | | | Libav has changed back to not modifying avctx->has_b_frames based on the extra buffering caused by thread use. Add back the code to do the adjustment on the player side once again. The timing mode using the buffering info is no longer the default, so in most cases having this right or not won't matter for playback.
| * build: switch to libavutil bswap.h and intreadwrite.hUoti Urpala2012-02-019-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | Remove the private bswap and intreadwrite.h implementations and use libavutil headers instead. Originally these headers weren't publicly installed by libavutil at all. That already changed in 2010, but the pure C bswap version in installed headers was very inefficient. That was recently (2011-12) improved and now using the public bswap version probably shouldn't cause noticeable performance problems, at least if using a new enough compiler.
| * Update Libav API usesUoti Urpala2012-02-014-44/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change various code to use the latest Libav API. The libavcodec error_recognition setting has been removed and replaced with different semantics. I removed the "--lavdopts=er=<value>" option accordingly, as I don't think it's widely enough used to be worth attempting to emulate the old option semantics using the new API. A new option with the new semantics can be added later if needed. Libav dropped APIs that were necessary with all Libav versions until quite recently (like setting avctx->age), and it would thus not be possible to keep compatibility with previous Libav versions without adding workarounds. The new APIs also had some bugs/limitations in the recent Libav release 0.8, and it would not work fully (at least some avcodec options would not be set correctly). Because of those issues, this commit makes no attempt to maintain compatibility with anything but the latest Libav git head. Hopefully the required fixes and improvements will be included in a following Libav point release.
* | screenshot: allow forcing taking screenshots with the video filterwm42012-02-292-1/+13
| | | | | | | | | | | | | | | | | | | | If the screenshot_force video filter is inserted, taking screenshots will always use the video filter, and skip the VO specific screenshot code. This can be useful if the VO code causes problems, or if it's intended to take screenshots from a specific location in the filter chain. The 'screenshot' filter is intended as fallback, it's not used if possible.
* | mpcodecs: remove mp_image_t.x/ywm42012-02-243-7/+3
| | | | | | | | These were never used.
* | i lost my brainwm42012-01-261-1/+1
| | | | | | | | should be squashed with "screenshot: improve quality by using additional swscale flags"
* | Merge branch 'gradfun' into my_masterwm42012-01-181-9/+47
|\ \
| * | vf_gradfun: change default parameterswm42012-01-101-2/+2
| | |
| * | vf_gradfun: add size parameter, which sets radius according to movie diagonalwm42012-01-101-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a "size" parameter, which scales the filter radius according to movie diagonal, the unit being percent of diagonal. This makes the effect far more predictable across movies of different resolutions. Usage example (with possibly useless values): -vf gradfun=strength=1.2:size=2.3 Based on a patch by Radosław Szkodziński <astralstorm@gmail.com>
| * | vf_gradfun: use option parserwm42012-01-101-9/+26
| | |
* | | Merge remote-tracking branch 'origin/master' into my_masterwm42012-01-184-50/+37
|\ \ \ | | |/ | |/|
| * | vd_ffmpeg: explicitly set thread count even if 1Uoti Urpala2012-01-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libav started automatically enabling threaded decoding a while ago. This is not safe, as it means callbacks can suddenly get called from other threads and outside calls to libavcodec. We need to know when threading will be used and disable thread-unsafe callbacks in those cases. Explicitly set thread count to 1 instead of leaving it at 0 (which triggers the autodetection) when we are not requesting more threads; this should make sure that autodetection on libavcodec side will not be used.
| * | ad_ffmpeg: pass packet side data from libavformatUoti Urpala2012-01-081-13/+26
| | | | | | | | | | | | | | | Pass avpacket->side_data when using a libavcodec audio decoder together with libavformat demuxer (this was already done for video).
| * | vf_fspp: make compile without Libav internalsUoti Urpala2012-01-022-9/+7
| | | | | | | | | | | | | | | Make vf_fspp compile without using internal Libav/FFmpeg files and compile it by default.
| * | Libav API updates (remove most deprecated-in-0.7 uses)Uoti Urpala2011-12-222-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | Update various code using Libav libraries to remove use of API features that were deprecated at Libav release 0.7. I think this removes them all with the exception of URLContext functions still used in stream_ffmpeg.c (at least other uses that generated deprecation warnings with libraries from 0.7 are removed).
| * | configure, build: require at least Libav 0.7Uoti Urpala2011-12-222-8/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Require versions of the Libav libraries corresponding to Libav release 0.7. These are: libavutil 51.7.0 libavcodec 53.5.0 libavformat 53.2.0 libswscale 2.0.0 libpostproc 52.0.0 Also disable the fallback to simple header check if these libraries could not be found with pkg-config; now compiling without pkg-config support for these always requires explicitly setting --enable-libav and any needed compiler/linker flags. The simple check would have let compilation proceed even if a version mismatch was detected.
* | screenshot: improve quality by using additional swscale flagswm42012-01-182-1/+13
| | | | | | | | | | | | | | | | | | Adding these flags improves the quality of the YUV->RGB conversion when screenshots are taken. It trades precision for performance. This doesn't affect any other swscale uses, such as vf_scale or vo_x11. Based on a patch by cantabile. Fixes #140.
* | subtitles: create only one instance of ASS_Render instead of twowm42012-01-182-57/+30
|/ | | | | | This simplifies the code. It also can make loading of mkv files faster, as initializing two ASS_Render instances required scanning mkv font attachments twice.
* vf_expand: always clear the added borderswm42011-12-191-93/+20
| | | | | | | | | | | | | | | | | | | | | | | | Using the "expand" filter makes the image area larger by adding borders to the video frame. These borders are supposed to be always black. The filter relied on the borders in its output buffer staying black without redrawing them for each frame. However, when using direct rendering, a video filter inserted after vf_expand can draw into these borders, for example the "unsharp" and "ass" filters. These changes incorrectly stayed visible in the the following video frames. Fix this by always clearing the borders in vf_expand. In some cases, this might be more work than necessary, but vf_expand has no way of detecting whether a subsequent filter draws into the borders or not, and this avoids fragile assumptions about the existing contents of the output buffer(s). This also deals with frame size changes when config() is called again. Before this commit, remains of the old video were visible if the new video frame size was smaller than before. Since we now always clear the borders, there's no more need for the complicated code that cleared only the regions that were covered by the OSD. Delete that.
* vf_dsize, vf_scale: fix behavior on multiple config() callswm42011-12-192-19/+26
| | | | | | When config() is called multiple times (e.g. aspect ratio changes while the same file is playing), the user settings are not honoured, because config() overwrites them. Don't do that.
* vf_dsize: cleanup identation (tabs to 4 spaces)wm42011-12-191-71/+71
|
* vo: reset EOSD change detection when VO is re-configuredwm42011-12-121-0/+3
| | | | | | | | | | | | | | | This fixes a crash with vo_gl when the switch_ratio slave command is used while a displaying an animated subtitle. switch_ratio will cause a config() call to vo_gl, which will reset all state, including the EOSD state. Next time the EOSD is rendered, its change detection will indicate that only subtitle positions have changed. The render code will attempt to access the EOSD data structures which have been deleted with config(). Fix this by forcing the change detection to indicate a full change if config() has been called. This only happens when doing switch_ratio with vo_gl, and the current subtitle is only changing positions, i.e. mp_eosd_images_t.changed == 1.
* configure, build: remove --disable-libav supportUoti Urpala2011-12-113-6/+2
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* Merge remote-tracking branch 'wm4/window_title'Uoti Urpala2011-12-072-4/+3
|\
| * libvo: remove title argument from struct vo_driver.configwm42011-12-062-4/+3
| | | | | | | | | | | | | | | | | | | | This affects only the "new" VO API. The config() title argument was barely used, and it's hardcoded to "MPlayer" in vf_vo.c. The X11 and the Cocoa GUI backends, which are the only ones properly supporting window titles, ignored this argument. Remove the title argument. Add the vo_get_window_title function. All GUI VOs are supposed to use it for the window title.
* | ad_ffmpeg: avoid avcodec_close() if avcodec_open() failedUoti Urpala2011-12-061-1/+1
| | | | | | | | | | | | Avoid calling avcodec_close() in uninit() if avcodec_open() failed. Calling avcodec_close() on a non-open codec context causes a crash with recent Libav versions.
* | core, vo: modify OSD redraw architecture, support EOSDUoti Urpala2011-12-067-20/+7
|/ | | | | | | | | | | | | | | | Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over the current frame. Change this to VFCTRL_REDRAW_FRAME followed by normal EOSD and OSD drawing calls, then vo_flip_page(). The new version supports changing EOSD contents for libass-rendered subtitles and simplifies the redraw support code needed per VO. vo_xv doesn't support EOSD changes because it relies on vf_ass to render EOSD contents earlier in the filter chain. vo_xv logic is additionally simplified because the previous commit removed the need to track the status of current and next images separately (now each frame is guaranteed to become "visible" soon after we receive it as "next", with no VO code running in the interval between).
* Merge branch 'screenshot' (early part)Uoti Urpala2011-11-253-148/+75
|\
| * video: use talloc for mp_image, abort if out of memorywm42011-11-251-14/+20
| | | | | | | | | | Make new_mp_image() allocate the struct with talloc and abort() if the av_malloc for image plane data fails.
| * core: add infrastructure to get screenshots from VOswm42011-11-252-134/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a VO command (VOCTRL_SCREENSHOT) which requests a screenshot directly from the VO. If VO support is available, screenshots will be taken instantly (no more 1 or 2 frames delay). Taking screenshots when hardware decoding is in use will also work (vdpau). Additionally, the screenshots will now use the same colorspace as the video display. Change the central MPContext to be allocated with talloc so that it can be used as a talloc parent context. This commit does not yet implement the functionality for any VO (added in subsequent commits). The old screenshot video filter is not needed anymore if VO support is present, and in that case will not be used even if it is present in the filter chain. If VO support is not available then the filter is used like before. Note that the filter still has some of the old problems, such as delaying the screenshot by at least 1 frame.
* | commands, vd_ffmpeg: fix switch_ratio slave commandUoti Urpala2011-11-144-34/+47
| | | | | | | | | | | | | | | | | | The implementation of the switch_ratio command was hacky and called mpcodecs_config_vo() to reconfigure the filter/VO chain from under an existing decoder. This call no longer worked properly with vd_ffmpeg after that started using mpcodec_config_vo2(). Add new video decoder control command VDCTRL_RESET_ASPECT and use this to tell vd_ffmpeg to reinitialize the output chain properly.
* | vd_ffmpeg: disable slice use that fails with size changesUoti Urpala2011-11-141-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When not using direct rendering, vd_ffmpeg created an mp_image struct before calling libavcodec decoder, so that possible slice support could be checked from the mpi_image and output would be ready for slice-drawing calls. However, this behavior is unsound with decoders that can change output size, as the parameters can change after the mp_image was created. Disable the code creating the mp_image at that point, which also disables use of slices in this case. Slices are disabled with threading anyway, so I think trying to add workarounds to support them is not a high priority. I think this code has always been buggy, but before common thread use it was rarely executed because the direct-rendering case was used instead.
* | cleanup: vf_scale.c, vf.c: replace numbers by flag macro namesUoti Urpala2011-11-142-13/+16
| |
* | cosmetics: vf.[ch]: reformatUoti Urpala2011-11-145-489/+586
|/ | | | Also a couple of smaller changes to other files.
* vd_ffmpeg.c: remove useless realvideo avctx->sub_id settingUoti Urpala2011-10-251-1/+0
| | | | Libavcodec has ignored the caller-set sub_id value since 2006.
* cosmetics: vd_ffmpeg.c: reformatUoti Urpala2011-10-221-348/+301
|
* audio/video: delete buggy "dynamic plugin" codeUoti Urpala2011-10-202-88/+0
| | | | | | | | | | | | Codec selection for audio and video decoding had a "dynamic plugin" feature that tried to load a shared library for any codec that had not been enabled at compilation (disabled by default, but could be enabled with --enable-dynamic-plugins configure switch; for unknown reasons some distro packages have enabled it). The implementation was buggy and could cause normal codec selection fallback to fail if the feature was enabled. I'm not aware of any real uses of such dynamic plugins and the feature seems questionable anyway (there are no ABI guarantees that would make it safe to use). Remove the buggy feature.
* video, options: implement better YUV->RGB conversion controlwm42011-10-166-2/+136
| | | | | | | | |