summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
Commit message (Collapse)AuthorAgeFilesLines
* fix compilation with old FFmpeg versionsUoti Urpala2011-02-081-1/+8
| | | | | | | | | | | | af_lavcac3enc: use old SampleFormat names without AV_ prefix, the latter were only added in 2010-11 vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use demux_real: use ffmpeg_files/intreadwrite.h stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for old libavutil versions lacking it
* codecs.conf, vd_ffmpeg: Enable fflagarith video decodercehoyos2011-01-311-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32773 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: set thread count to number of cores on machine by defaultUoti Urpala2010-12-201-1/+14
| | | | | | | | | | | Make "-lavdopts threads=0" mean an autodetected number of threads, and make that the default value of the option. Also increase the upper limit of the option from 8 to 16. Add new file osdep/numcores.c which tries to determine the number of cores available on the machine. numcores.c is based (heavily modified) on public domain numcpus.c by Philip Willoughby <pgw99@doc.ic.ac.uk>, downloaded from http://csgsoft.doc.ic.ac.uk/numcpus/
* vd_ffmpeg: fix MP_IMGTYPE selection for non-ref non-B framesreimar2010-12-161-1/+1
| | | | | | | | | | | | | | | Change direct rendering buffer allocation code to treat non-ref frames like B-frames even if has_b_frames is not set and they are indeed not B-frames (no reordering). Treating it as an I/P frame would violate the assumptions of MPlayer's buffering system, which thinks only the latest previous I/P frame is needed (in addition to one possibly being decoded). In this case the previous I/P frame will still be needed in the future, not the non-ref frame being decoded now. This happens with flv files, as in bug #1079, and this change fixes that corruption. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32700 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: Reset ctx->vo_initialized to 0 on a resolution changereimar2010-12-161-0/+1
| | | | | | | | Otherwise we might think the filter chain/vo is ready when it actually is not, leading to a crash. Fixes crash part of bug 1156. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32690 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: compare IMGFMT instead of PIX_FMTreimar2010-11-081-3/+3
| | | | | | | Use IMGFMT to compare instead of PIX_FMT to avoid issues with the "JPEG" formats like PIX_FMT_YUVJ422P. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32594 b3059339-0415-0410-9bf9-f77b7e298cf2
* video: simplify some tests with a new IMGFMT_IS_HWACCEL macroreimar2010-11-081-4/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32575 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: improve aspect ratio handlingreimar2010-11-021-5/+7
| | | | | | | | | Respect container aspect first if available, but change to ratio based on video codec level information if there's a resolution or pixel aspect change from the original codec values in the middle of the video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32525 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: malloc+memset->calloc, sizeof(TYPE)->sizeof(*ptr)reimar2010-11-021-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32181 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32182 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32183 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace some sizeof(type) by sizeof(*pointer) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32184 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32186 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32187 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32188 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizoef(type) by sizeof(*ptrvar). Besides being consistent with FFmpeg style, this reduces the size of a patch to rename these types to not conflict with the windows.h definitions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32189 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32191 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32192 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(type) by sizeof(*ptrvar) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32193 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove a useless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32194 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(type) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32195 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove a useless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32196 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace several sizeof(WAVEFORMATEX) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32197 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace one more instance of sizeof(WAVEFORMATEX); fix compilation. patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32199 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid some pointless uses of sizeof() and one related cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32200 b3059339-0415-0410-9bf9-f77b7e298cf2 Merge one malloc() + memset() invocation into calloc(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32202 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32203 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(WAVEFORMATEX) occurrences. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32205 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32206 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(BITMAPINFOHEADER) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add central init_avcodec() to avoid duplicated libavcodec init codediego2010-11-021-5/+11
| | | | | | | | | | | | | | | | Patch by Vlad Seryakov, vseryakov gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32043 b3059339-0415-0410-9bf9-f77b7e298cf2 Refactor more instances of avcodec_initialized handling into init_avcodec(). This is a leftover from the previous commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32044 b3059339-0415-0410-9bf9-f77b7e298cf2 Add missing #include for vd_ffmpeg.h; fixes the warning: libmpcodecs/vf_zrmjpeg.c:472: warning: implicit declaration of function 'init_avcodec' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32176 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: Set avctx->coded_width/coded_height instead of width/heightreimar2010-11-021-2/+2
| | | | | | That's how it is supposed to be done. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32037 b3059339-0415-0410-9bf9-f77b7e298cf2
* ad_ffmpeg, vd_ffmpeg: remove pointless castsdiego2010-11-021-1/+1
| | | | | | | | Remove pointless casts of avcodec_find_decoder_by_name() return value. avcodec_find_decoder_by_name() already returns AVCodec*, so there is no need to cast the return value to this type. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32007 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: add av_unused attribute to swap_palette()diego2010-11-021-1/+1
| | | | | | Only used on bigendian machines. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31586 b3059339-0415-0410-9bf9-f77b7e298cf2
* vf_ffmpeg: make VP8 decoder work by disabling drreimar2010-11-021-1/+1
| | | | | | | Allow the FFmpeg VP8 decoder to work by disabling dr for it (thus we do not need edge emulation). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31560 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: Minor code simplification.reimar2010-10-271-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31336 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: fix aspect ratio problems with recent FFmpegUoti Urpala2010-10-161-0/+2
| | | | | | | | | | The code left ctx->last_sample_aspect_ratio at 0/0 when allocating a context. In older FFmpeg versions av_cmp_q() against 0/0 always said the numbers are equal; but this changed recently, triggering incorrect overwrite of container aspect ratio. The logic looks like it'd need further fixes, but for now just initialize last_sample_aspect_ratio to 0/1; this should restore the previous behavior from before FFmpeg changes, which worked well enough for the most common cases.
* vd_ffmpeg: fix calloc/av_free mixupUoti Urpala2010-10-161-7/+4
| | | | | | avctx->palctrl was allocated with calloc() but freed with av_freep(). Free it with free() instead. Also change the main decoder context allocation to use talloc.
* cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"Uoti Urpala2010-05-291-1/+2
| | | | | | | Change 'struct vf_instance' pointer arguments to more standard style as in the subject. Also some other minor formatting fixes. Patch by Diego Biurrun.
* vd_ffmpeg: remove #ifdef for old FFmpeg-mt versionsUoti Urpala2010-05-071-6/+0
| | | | | The #ifdef is obsolete since trying to compile against the relevant old versions will fail for other reasons.
* vd_ffmpeg: use skip_frame instead of deprecated hurry_up fieldUoti Urpala2010-05-041-1/+6
|
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30643Uoti Urpala2010-03-101-1/+13
|\
| * Handle negative height in draw_slice from FFmpeg in vd_ffmpeg.c, since atreimar2010-02-171-1/+13
| | | | | | | | | | | | | | | | | | | | least vo_xv and vo_sdl can not handle it and the scale filter seems to work fine either way. The FFmpeg vp3/Theora decoder produces such slices. Fixes bug #1646. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30630 b3059339-0415-0410-9bf9-f77b7e298cf2
| * libmpcodecs: Mark functions not used outside of their files as static.diego2010-02-161-2/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30597 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Mark all ad_info_t/vd_info_t structure declarations as const.diego2010-02-121-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30546 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30463Uoti Urpala2010-03-091-0/+18
|\| | | | | | | | | | | Note that r30455 is wrong, that commit does not in fact change the default behavior as claimed in the commit message. It only breaks "-af-adv force=0", which was already pretty much useless though.
| * Add missing license headers to all files in the libmpcodecs directory.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30463 b3059339-0415-0410-9bf9-f77b7e298cf2
* | vd_ffmpeg: fix compilation with neither VDPAU nor XvMC enabledUoti Urpala2010-01-211-2/+0
| | | | | | | | | | | | | | | | | | The get_format() function was defined under #if CONFIG_XVMC || CONFIG_VDPAU but recent commit ca217f4557c3cff4f2bf33e605ce13e662e84a92 added an unconditional reference to it, causing linking to fail with an undefined reference if neither feature was enabled. Fix by removing the #if, there's no reason reason why it would be needed.
* | vd_ffmpeg: FFmpeg-mt changed has_b_frames API, updateUoti Urpala2010-01-201-1/+2
| |
* | vd_ffmpeg: move redundant info messages to MSGL_V levelUoti Urpala2010-01-201-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Move two messages printed when using VDPAU/XvMC to MSGL_V level: "[VD_FFMPEG] XVMC-accelerated MPEG-2.\n" "[VD_FFMPEG] Trying pixfmt=%d.\n" The first is redundant because this info is normally visible from the decoder name, and it was also incorrectly printed in the VDPAU case too. Add a different MSGL_V message for VDPAU. Also make all these messages not translatable.
* | vd_ffmpeg: disable callbacks for threaded decodingUoti Urpala2010-01-201-38/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MPlayer's slice and direct rendering related callbacks are not safe to call from other threads, so disable those features if more than one decoding thread is specified. This should fix some issues when using threaded decoding with formats other than h264 (in the h264 case the callbacks were already disabled for other reasons). This commit moves most of the code that sets special avctx parameters for VDPAU and XvMC. Before that was done after avcodec_open() based on the selected output image format; now it's done before avcodec_open() based on the capabilities of the selected decoder. At least the code selecting the thread count must be before avcodec_open(), and I think there is no reason to try to keep the previous structure otherwise either. The image format-based approach was implemented by Reimar with the intended goal of eventually selecting between software and VDPAU decoders under one FFmpeg decoder type. I consider that goal to be questionable, and the approach certainly made the existing code significantly messier for no functionality benefit.
* | Merge svn changes up to r30236Uoti Urpala2010-01-081-0/+2
|\|
| * Avoid the error message "Unsupported PixelFormat -1" for ffh264 decodingzuxy2010-01-071-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30233 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30165Uoti Urpala2010-01-081-0/+4
|\|
| * Also pass the 4th plane for planar formats on to libavcodec.reimar2009-12-311-0/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30156 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30136Uoti Urpala2009-12-301-4/+6
|\| | | | | | | Ignore another broken correct-pts change in 30134.
| * Support mp_image with allocated palette.reimar2009-12-261-4/+6
| | | | | | | | | | | | | | | | Fixes playback and a memory leak for FFmpeg codecs which use reget_buffer with paletted data, e.g. cdgraphics. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30116 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29962Uoti Urpala2009-11-231-5/+2
|\|
| * Add const to draw_slice argument to match what FFmpeg expects for ↵reimar2009-11-221-2/+2
| | | | | | | | | | | | draw_horiz_band. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29956 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use avcodec_align_dimensions to appropriately align width and height inreimar2009-11-171-5/+2
| | | | | | | | | | | | | | get_buffer instead of reimplementing it badly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29921 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Map AV_LOG_VERBOSE to MSGL_V in order to avoid spurious log output.diego2009-11-101-0/+1
| | | | | | | | | | | | | | based on a patch by On2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29884 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core: Add support for decoder reordering of pts valuesUoti Urpala2009-11-211-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mode where libavcodec's reordered_opaque feature is used to associate container packet timestamps with decoded frames. This should improve behavior at least for MPEG files with interlaced h264; the previous code does not cope well with the libavformat demuxer producing two field packets with separate timestamps but the libavcodec h264 decoder only producing a single output frame for those two packets (so half the timestamps have no associated output frame). The current libavformat mpeg demuxer seems to finally work with interlaced h264 files and produce valid timestamps which are useful with a mode like this. By default MPlayer now selects between this new mode and the old one automatically based on the number of timestamp problems they cause; by default the new mode is used if both seem to work. The new option -pts-association-mode can be used to force a particular mode. If correct-pts mode is disabled this has no effect on timing. Also remove the "EXPERIMENTAL" marker from the manpage description of -correct-pts.
* | av_log callback handling overhaulUoti Urpala2009-10-311-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move av_log callback handling from vd_ffmpeg.c to a new file av_log.c and install the callback immediately when starting the program. Main functionality improvements of the new code: - The old version only installed the callback when opening an FFmpeg video decoder. If nothing had triggered that then av_log() messages from other sources (libavformat, audio decoding, swscale usage) bypassed MPlayer's output system completely. Now the callback is always installed. - Current av_log message severity levels are handled correctly. The old code used MSGL_ERR for some messages that should be MSGL_V. - Message type is now set for libavformat contexts (MSGT_DEMUXER / MSGT_MUXER). - The old code did "mp_msg_test(type, mp_level)" before actually determining the type, so that it always used MSGT_FIXME. This led to some messages being incorrectly dropped in case the user had specified module-specific verbosity levels. The old check in question was originally motivated by performance problems when there were a lot of callbacks; however it's not clear whether the part about it skipping the type determination was intentional (most of the performance problems must have come from the way the original code used snprintf) and in my tests current FFmpeg libraries have not generated unreasonable amounts of callbacks anyway.
* | Merge svn changes up to r29752Uoti Urpala2009-10-061-0/+2
|\| | | | | | | | | | | | | | | | | As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
| * Make sure avctx->codec_type and codec_id are set, since libavcodecreimar2009-09-231-0/+2
| | | | | | | | | | | | | | | | | | currently requires that. That probably is an unintended API change and should be fixed/reverted in lavc but it hurts little to workaround here. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29709 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29455Uoti Urpala2009-07-291-1/+1
|\|
| * Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.diego2009-07-261-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Replace libavutil internal header #includes with MPlayer copiesUoti Urpala2009-07-261-1/+1
| | | | | | | | | | | | Change #include lines for libavutil/intreadwrite.h, libavutil/bswap.h and libavutil/x86_cpu.h to use the MPlayer file under ffmpeg_files/ instead.
* | Merge svn changes up to r29412Uoti Urpala