diff options
author | wm4 <wm4@nowhere> | 2013-02-09 15:15:37 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-02-10 17:25:57 +0100 |
commit | 01869d1391fc5cc843e132f9d05d6896ba5b4d6b (patch) | |
tree | 52220117ec9cb63328ab2a7cbbbcbec0ade61a85 /core/av_common.h | |
parent | dd61fac9438a0ba83513c9346debf73e7f9d2b4d (diff) | |
download | mpv-01869d1391fc5cc843e132f9d05d6896ba5b4d6b.tar.bz2 mpv-01869d1391fc5cc843e132f9d05d6896ba5b4d6b.tar.xz |
demux_lavf, ad_lavc, vd_lavc: pass codec header data directly
Instead of putting codec header data into WAVEFORMATEX and
BITMAPINFOHEADER, pass it directly via AVCodecContext. To do this, we
add mp_copy_lav_codec_headers(), which copies the codec header data
from one AVCodecContext to another (originally, the plan was to use
avcodec_copy_context() for this, but it looks like this would turn
decoder initialization into an even worse mess).
Get rid of the silly CodecID <-> codec_tag mapping. This was originally
needed for codecs.conf: codec tags were used to identify codecs, but
libavformat didn't always return useful codec tags (different file
formats can have different, overlapping tag numbers). Since we don't
go through WAVEFORMATEX etc. and pass all header data directly via
AVCodecContext, we can be absolutely sure that the codec tag mapping is
not needed anymore.
Note that this also destroys the "standard" MPlayer method of exporting
codec header data. WAVEFORMATEX and BITMAPINFOHEADER made sure that
other non-libavcodec decoders could be initialized. However, all these
decoders have been removed, so this is just cruft full of old hacks that
are not needed anymore. There's still ad_spdif and ad_mpg123, bu neither
of these need codec header data. Should we ever add non-libavcodec
decoders, better data structures without the past hacks could be added
to export the headers.
Diffstat (limited to 'core/av_common.h')
-rw-r--r-- | core/av_common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/av_common.h b/core/av_common.h index 4fbe592f11..25593ed3d0 100644 --- a/core/av_common.h +++ b/core/av_common.h @@ -23,6 +23,7 @@ struct mp_decoder_list; +void mp_copy_lav_codec_headers(AVCodecContext *avctx, AVCodecContext *st); void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type); int mp_codec_to_av_codec_id(const char *codec); const char *mp_codec_from_av_codec_id(int codec_id); |