1
mirror of https://github.com/mpv-player/mpv synced 2024-08-28 05:46:13 +02:00
Commit Graph

317 Commits

Author SHA1 Message Date
diego
f2899d96ee Add central init_avcodec() to avoid duplicated libavcodec init code
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
2010-11-02 04:15:51 +02:00
reimar
039574d8d4 vd_ffmpeg: Set avctx->coded_width/coded_height instead of width/height
That's how it is supposed to be done.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32037 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:49 +02:00
diego
740c927976 ad_ffmpeg, vd_ffmpeg: remove pointless casts
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
2010-11-02 04:15:49 +02:00
diego
e2dea75e4a vd_ffmpeg: add av_unused attribute to swap_palette()
Only used on bigendian machines.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31586 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:11:43 +02:00
reimar
368d11d4cc vf_ffmpeg: make VP8 decoder work by disabling dr
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
2010-11-02 04:11:43 +02:00
reimar
f604df4f76 vd_ffmpeg: Minor code simplification.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31336 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-10-27 20:27:39 +03:00
Uoti Urpala
96312757c5 vd_ffmpeg: fix aspect ratio problems with recent FFmpeg
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.
2010-10-16 05:14:25 +03:00
Uoti Urpala
266e0341ba vd_ffmpeg: fix calloc/av_free mixup
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.
2010-10-16 04:38:20 +03:00
Uoti Urpala
1888e57af7 cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"
Change 'struct vf_instance' pointer arguments to more standard style
as in the subject. Also some other minor formatting fixes.

Patch by Diego Biurrun.
2010-05-29 17:20:44 +03:00
Uoti Urpala
5266b5de98 vd_ffmpeg: remove #ifdef for old FFmpeg-mt versions
The #ifdef is obsolete since trying to compile against the relevant
old versions will fail for other reasons.
2010-05-07 22:15:19 +03:00
Uoti Urpala
bc767c2a98 vd_ffmpeg: use skip_frame instead of deprecated hurry_up field 2010-05-04 04:50:57 +03:00
Uoti Urpala
00323c06e2 Delete things related to old translation system
Remove the help/ subdirectory, configure code to create toplevel
help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
2010-03-10 03:47:14 +02:00
Uoti Urpala
c37f09693d Merge svn changes up to r30643 2010-03-10 00:00:06 +02:00
Uoti Urpala
b0986b3760 Merge svn changes up to r30463
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.
2010-03-09 18:59:15 +02:00
reimar
84da7d44ef Handle negative height in draw_slice from FFmpeg in vd_ffmpeg.c, since at
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
2010-02-17 23:46:57 +00:00
diego
a6207aaa68 libmpcodecs: Mark functions not used outside of their files as static.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30597 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-16 16:16:42 +00:00
diego
92e3238508 Mark all ad_info_t/vd_info_t structure declarations as const.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30546 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-12 16:29:34 +00:00
diego
23db422c3d Add missing license headers to all files in the libmpcodecs directory.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30463 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 16:57:40 +00:00
Uoti Urpala
ffc3db2239 vd_ffmpeg: fix compilation with neither VDPAU nor XvMC enabled
The get_format() function was defined under
 #if CONFIG_XVMC || CONFIG_VDPAU
but recent commit ca217f4557 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.
2010-01-21 01:09:28 +02:00
Uoti Urpala
1ef8d887d4 vd_ffmpeg: FFmpeg-mt changed has_b_frames API, update 2010-01-20 20:32:00 +02:00
Uoti Urpala
d4159a7d88 vd_ffmpeg: move redundant info messages to MSGL_V level
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.
2010-01-20 17:21:39 +02:00
Uoti Urpala
ca217f4557 vd_ffmpeg: disable callbacks for threaded decoding
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.
2010-01-20 16:31:13 +02:00
Uoti Urpala
819b8f08a2 Merge svn changes up to r30236 2010-01-08 02:44:37 +02:00
Uoti Urpala
231b33a02f Merge svn changes up to r30165 2010-01-08 01:05:30 +02:00
zuxy
554231067d Avoid the error message "Unsupported PixelFormat -1" for ffh264 decoding
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30233 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-07 04:59:50 +00:00
reimar
c07dec1a4a Also pass the 4th plane for planar formats on to libavcodec.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30156 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-31 23:39:21 +00:00
Uoti Urpala
d46b86bc7c Merge svn changes up to r30136
Ignore another broken correct-pts change in 30134.
2009-12-30 00:56:10 +02:00
reimar
afc5a627d8 Support mp_image with allocated palette.
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
2009-12-26 11:51:19 +00:00
Uoti Urpala
5995bc175a Merge svn changes up to r29962 2009-11-23 01:56:21 +02:00
reimar
2959f9e032 Add const to draw_slice argument to match what FFmpeg expects for draw_horiz_band.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29956 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-22 13:18:12 +00:00
Uoti Urpala
74b7dcc5f4 core: Add support for decoder reordering of pts values
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.
2009-11-21 20:53:10 +02:00
reimar
a98091b77b Use avcodec_align_dimensions to appropriately align width and height in
get_buffer instead of reimplementing it badly.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29921 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-17 13:56:34 +00:00
diego
a63e8dce21 Map AV_LOG_VERBOSE to MSGL_V in order to avoid spurious log output.
based on a patch by On2


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29884 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 18:10:16 +00:00
Uoti Urpala
8bbb79c03a av_log callback handling overhaul
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.
2009-10-31 23:59:16 +02:00
Uoti Urpala
7fd3eb0f74 Merge svn changes up to r29752
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.
2009-10-06 04:48:00 +03:00
reimar
4834e21162 Make sure avctx->codec_type and codec_id are set, since libavcodec
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
2009-09-23 19:21:38 +00:00
Uoti Urpala
4a36b51ea6 Merge svn changes up to r29455 2009-07-29 01:32:03 +03:00
diego
e5751ced4f Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-07-26 19:53:00 +00:00
Uoti Urpala
d6c410b54c Replace libavutil internal header #includes with MPlayer copies
Change #include lines for libavutil/intreadwrite.h, libavutil/bswap.h
and libavutil/x86_cpu.h to use the MPlayer file under ffmpeg_files/
instead.
2009-07-26 06:16:43 +03:00
Uoti Urpala
a2037a2eff Merge svn changes up to r29412 2009-07-07 02:56:01 +03:00
Amar Takhar
e306174952 Translation system changes part 2: replace macros by strings
Replace all MSGTR_ macros in the source by the corresponding English
string.
2009-07-07 01:38:20 +03:00
Amar Takhar
b5972d6f14 Translation system changes part 1: wrap translated strings
Replace mp_msg() calls which have a translated string as the format
argument with mp_tmsg and add _() around all other translated strings.
2009-07-07 01:28:07 +03:00
reimar
d90d9d3d22 Switch to avcodec_decode_video2 to allow a hack that makes PNG decode correctly
again instead of in CorePNG delta mode.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29340 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-06-01 22:25:10 +00:00
Uoti Urpala
ce35ed0209 vd_ffmpeg.c: Use FFmpeg-mt compatible code for codec delay
This code to calculate codec delay should work with both with regular
FFmpeg and FFmeg-mt. This MPlayer version is not completely compatible
with current FFmpeg-mt though, since it has a build system change
which matches upstream FFmpeg but hasn't been integrated in FFmpeg-mt
yet (RUNTIME_CPUDETECT -> CONFIG_RUNTIME_CPUDETECT rename).
2009-04-30 03:54:34 +03:00
Uoti Urpala
cf9edda1d3 Merge svn changes up to r29117 2009-04-01 02:43:47 +03:00
reimar
22b2f80efb Use MP_MAX_PLANES as size of arrays passed to mpcodecs_draw_slice.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29098 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-29 14:15:09 +00:00
cehoyos
115bfb9762 Allow to use vdpau temporal deinterlacers with hardware accelerated decoding.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28991 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-18 17:02:29 +00:00
Uoti Urpala
e0172b96e3 Merge svn changes up to r28862 2009-03-07 01:04:41 +02:00
reimar
0f43db1769 Add another hack to work-around the currently completely inconsistent way in
which libavcodec sets AVCodecContext::pix_fmt.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28801 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-03 13:38:33 +00:00
reimar
aacd081579 10l, replace a tab that slipped in.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28767 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-01 09:09:49 +00:00