annotate libmpdemux/mp_taglists.c @ 35419:d86249ebbcca

Don't unconditionally reset Track, Chapter and Angle after playback. Only do so if they had been used (i.e. the current StreamType makes use of them).
author ib
date Thu, 29 Nov 2012 14:23:26 +0000
parents 130cdc6e5a00
children bb29a2a95d31
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
1 /*
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
2 * This file is part of MPlayer.
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
3 *
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
7 * (at your option) any later version.
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
8 *
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
12 * GNU General Public License for more details.
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
13 *
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
17 */
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
18
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
19 #include "config.h"
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
20
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
21 #include <stdint.h>
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
22 #include "mp_msg.h"
29859
1a2c12c0de26 Fix declarations in mp_taglists.h and include it in mp_taglists.c to
reimar
parents: 29778
diff changeset
23 #include "mp_taglists.h"
34196
c910df5dc9ae Map 8svx fourcc to 8raw instead of relying on non-existing CODEC_ID.
diego
parents: 34156
diff changeset
24 #include "libavutil/common.h"
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
25 #include "libavformat/avformat.h"
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
26 // for AVCodecTag
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
27 #include "libavformat/internal.h"
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
28
34156
758264af214d Consistently use "struct AVCodecTag" and not sometimes just "AVCodecTag".
reimar
parents: 34155
diff changeset
29 static const struct AVCodecTag mp_wav_tags[] = {
30834
e7eb5f0565b6 Fix alpabetical order.
cehoyos
parents: 30833
diff changeset
30 { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')},
30833
0336ed6ed3c6 Support SEGA CRI adx codec with demuxer lavf.
cehoyos
parents: 30637
diff changeset
31 { CODEC_ID_ADPCM_ADX, MKTAG('S', 'a', 'd', 'x')},
34941
5511c752c74c Support FFmpeg APC ADPCM IMA audio decoder
cehoyos
parents: 34920
diff changeset
32 { CODEC_ID_ADPCM_IMA_APC, MKTAG('A', 'P', 'C', 'A')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
33 { CODEC_ID_ADPCM_EA, MKTAG('A', 'D', 'E', 'A')},
34734
5ca635fce95b Support FFmpeg EA ADPCM R1, R2, R3 audio decoders.
cehoyos
parents: 34721
diff changeset
34 { CODEC_ID_ADPCM_EA_R1, MKTAG('E', 'A', 'R', '1')},
5ca635fce95b Support FFmpeg EA ADPCM R1, R2, R3 audio decoders.
cehoyos
parents: 34721
diff changeset
35 { CODEC_ID_ADPCM_EA_R2, MKTAG('E', 'A', 'R', '2')},
5ca635fce95b Support FFmpeg EA ADPCM R1, R2, R3 audio decoders.
cehoyos
parents: 34721
diff changeset
36 { CODEC_ID_ADPCM_EA_R3, MKTAG('E', 'A', 'R', '3')},
26760
424b12ccbc7b add ffmpeg ea maxis xa adpcm audio decoder
compn
parents: 26735
diff changeset
37 { CODEC_ID_ADPCM_EA_MAXIS_XA, MKTAG('A', 'D', 'X', 'A')},
34287
e52c4a58e428 Support FFmpeg ADPCM IMA Electronic Arts EACS decoding.
cehoyos
parents: 34286
diff changeset
38 { CODEC_ID_ADPCM_IMA_EA_EACS, MKTAG('E', 'A', 'C', 'S')},
34285
58dc65acc1f4 Support FFmpeg Funcom IMA ISS ADPCM decoding.
cehoyos
parents: 34245
diff changeset
39 { CODEC_ID_ADPCM_IMA_ISS, MKTAG('A', 'I', 'S', 'S')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
40 { CODEC_ID_ADPCM_IMA_WS, MKTAG('A', 'I', 'W', 'S')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
41 { CODEC_ID_ADPCM_THP, MKTAG('T', 'H', 'P', 'A')},
27101
2b2ee1d4a62a add ffmdec and ffadpcmxa
compn
parents: 26846
diff changeset
42 { CODEC_ID_ADPCM_XA, MKTAG('P', 'S', 'X', 'A')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
43 { CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)},
34721
9944765ea06b add ffatrac1 codec, works on A-codecs/ATRAC1/
compn
parents: 34644
diff changeset
44 { CODEC_ID_ATRAC1, MKTAG('A', 'T', 'R', '1')},
30637
0947ead7e81b FFmpeg supports Bink, let MPlayer play it as well
kostya
parents: 30633
diff changeset
45 { CODEC_ID_BINKAUDIO_DCT, MKTAG('B', 'A', 'U', '1')},
0947ead7e81b FFmpeg supports Bink, let MPlayer play it as well
kostya
parents: 30633
diff changeset
46 { CODEC_ID_BINKAUDIO_RDFT, MKTAG('B', 'A', 'U', '2')},
34245
3498659ef543 Support BMV decoding (bug 2009).
cehoyos
parents: 34244
diff changeset
47 { CODEC_ID_BMV_AUDIO, MKTAG('B', 'M', 'V', 'A')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
48 { CODEC_ID_COOK, MKTAG('c', 'o', 'o', 'k')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
49 { CODEC_ID_DSICINAUDIO, MKTAG('D', 'C', 'I', 'A')},
27482
88c54359eb69 support E-AC-3 decoding using ffmpeg
aurel
parents: 27429
diff changeset
50 { CODEC_ID_EAC3, MKTAG('E', 'A', 'C', '3')},
34413
8eebe2a33894 libmpdemux/mp_taglists.c: Replace #ifdef with #if directives
siretart
parents: 34411
diff changeset
51 #if LIBAVUTIL_VERSION_MICRO >= 100
34359
2cc52bc15984 Support SBG decoding using ffwavesynth.
cigaes
parents: 34357
diff changeset
52 { CODEC_ID_FFWAVESYNTH, MKTAG('F', 'F', 'W', 'S')},
34404
95f802285711 Allow compilation with Libav
siretart
parents: 34363
diff changeset
53 #endif
34079
eb8263a3b131 Support G.723.1 decoding via FFmpeg.
cehoyos
parents: 34062
diff changeset
54 { CODEC_ID_G723_1, MKTAG('7', '2', '3', '1')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
55 { CODEC_ID_INTERPLAY_DPCM, MKTAG('I', 'N', 'P', 'A')},
27200
4c4c3d7845fc Add support for MLP audio through FFmpeg.
diego
parents: 27101
diff changeset
56 { CODEC_ID_MLP, MKTAG('M', 'L', 'P', ' ')},
30208
4570bb6d0284 Fix MP1 with demuxer lavf in MPEG (PS) files.
cehoyos
parents: 30062
diff changeset
57 { CODEC_ID_MP1, 0x50},
30562
44c7925b0dee Support FFmpeg's ALS decoder.
reimar
parents: 30208
diff changeset
58 { CODEC_ID_MP4ALS, MKTAG('A', 'L', 'S', ' ')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
59 { CODEC_ID_MUSEPACK7, MKTAG('M', 'P', 'C', ' ')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
60 { CODEC_ID_MUSEPACK8, MKTAG('M', 'P', 'C', '8')},
33940
5eae72fa20ff Do not map to internal MPlayer FourCC if possible.
cehoyos
parents: 33201
diff changeset
61 { CODEC_ID_NELLYMOSER, MKTAG('n', 'm', 'o', 's')},
34952
2a982b69303b Initial libopus decoding support.
cehoyos
parents: 34941
diff changeset
62 { CODEC_ID_OPUS, MKTAG('o', 'p', 'u', 's')},
32903
8cb530d39a6d Support audio in Leitch/Harris' VR native stream format (LXF).
cehoyos
parents: 32681
diff changeset
63 { CODEC_ID_PCM_LXF, MKTAG('P', 'L', 'X', 'F')},
34305
2fef3034c98f Support FFmpeg's PCM 16-bit little-endian planar decoder.
cehoyos
parents: 34304
diff changeset
64 { CODEC_ID_PCM_S16LE_PLANAR, MKTAG('1', '6', 'P', 'L')},
26846
d8fd07838415 add qclp fourcc
compn
parents: 26760
diff changeset
65 { CODEC_ID_QCELP, MKTAG('Q', 'c', 'l', 'p')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
66 { CODEC_ID_QDM2, MKTAG('Q', 'D', 'M', '2')},
29553
1f67a98bbc95 cosmetics: alphabetically order lists
diego
parents: 29551
diff changeset
67 { CODEC_ID_RA_144, MKTAG('1', '4', '_', '4')},
1f67a98bbc95 cosmetics: alphabetically order lists
diego
parents: 29551
diff changeset
68 { CODEC_ID_RA_288, MKTAG('2', '8', '_', '8')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
69 { CODEC_ID_ROQ_DPCM, MKTAG('R', 'o', 'Q', 'A')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
70 { CODEC_ID_SHORTEN, MKTAG('s', 'h', 'r', 'n')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
71 { CODEC_ID_SPEEX, MKTAG('s', 'p', 'x', ' ')},
35141
ef73eb8a2c43 Support FFmpeg's TAK decoder.
cehoyos
parents: 34952
diff changeset
72 { AV_CODEC_ID_TAK, MKTAG('T', 'A', 'K', ' ')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
73 { CODEC_ID_TTA, MKTAG('T', 'T', 'A', '1')},
29613
7386b883fba6 Add support for lavf vqf demuxer and lavc TwinVQ decoder.
vitor
parents: 29558
diff changeset
74 { CODEC_ID_TWINVQ, MKTAG('T', 'W', 'I', '2')},
34910
3629ef4a19ce Support LucasArts SMUSH and VIMA decoding.
cehoyos
parents: 34742
diff changeset
75 #if LIBAVUTIL_VERSION_MICRO >= 100
3629ef4a19ce Support LucasArts SMUSH and VIMA decoding.
cehoyos
parents: 34742
diff changeset
76 { CODEC_ID_VIMA, MKTAG('V', 'I', 'M', 'A')},
3629ef4a19ce Support LucasArts SMUSH and VIMA decoding.
cehoyos
parents: 34742
diff changeset
77 #endif
34303
99a27279dcd0 Support FFmpeg vdmaudio decoder.
cehoyos
parents: 34302
diff changeset
78 { CODEC_ID_VMDAUDIO, MKTAG('V', 'M', 'D', 'A')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
79 { CODEC_ID_WAVPACK, MKTAG('W', 'V', 'P', 'K')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
80 { CODEC_ID_WESTWOOD_SND1, MKTAG('S', 'N', 'D', '1')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
81 { CODEC_ID_XAN_DPCM, MKTAG('A', 'x', 'a', 'n')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
82 { 0, 0 },
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
83 };
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
84
34156
758264af214d Consistently use "struct AVCodecTag" and not sometimes just "AVCodecTag".
reimar
parents: 34155
diff changeset
85 static const struct AVCodecTag mp_codecid_override_tags[] = {
34096
36085e0bfe0e Support decoding 8SVX in IFF.
cehoyos
parents: 34079
diff changeset
86 { CODEC_ID_8SVX_EXP, MKTAG('8', 'e', 'x', 'p')},
36085e0bfe0e Support decoding 8SVX in IFF.
cehoyos
parents: 34079
diff changeset
87 { CODEC_ID_8SVX_FIB, MKTAG('8', 'f', 'i', 'b')},
34196
c910df5dc9ae Map 8svx fourcc to 8raw instead of relying on non-existing CODEC_ID.
diego
parents: 34156
diff changeset
88 { MKBETAG('8','S','V','X'), MKTAG('8', 'r', 'a', 'w')},
29554
2d5e5e34c0f0 Fix AAC in MPEG transport stream for -demuxer lavf.
cehoyos
parents: 29553
diff changeset
89 { CODEC_ID_AAC, MKTAG('M', 'P', '4', 'A')},
32497
7b03b3c941c8 Use only one fourcc for LATM.
reimar
parents: 32484
diff changeset
90 { CODEC_ID_AAC_LATM, MKTAG('M', 'P', '4', 'L')},
29553
1f67a98bbc95 cosmetics: alphabetically order lists
diego
parents: 29551
diff changeset
91 { CODEC_ID_AC3, 0x2000},
34316
446aeefc216b Support decoding newer rpl files with FFmpeg's Escape 130 decoder.
cehoyos
parents: 34305
diff changeset
92 { CODEC_ID_ADPCM_IMA_EA_SEAD, MKTAG('S', 'E', 'A', 'D')},
29622
d5662ea3a5d0 Add CODEC_ID_ADPCM_IMA_AMV to lavf codec_tag override list instead of
reimar
parents: 29621
diff changeset
93 { CODEC_ID_ADPCM_IMA_AMV, MKTAG('A', 'M', 'V', 'A')},
29555
169757b719a4 Fix DTS in MPEG transport streams with -demuxer lavf.
cehoyos
parents: 29554
diff changeset
94 { CODEC_ID_DTS, 0x2001},
32904
e67931f380a3 Support dvvideo in Leitch/Harris' VR native stream format (LXF).
cehoyos
parents: 32903
diff changeset
95 { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'd')},
29557
f1f13389cd49 Fix EAC3 in MPEG transport streams with -demuxer lavf.
cehoyos
parents: 29555
diff changeset
96 { CODEC_ID_EAC3, MKTAG('E', 'A', 'C', '3')},
34302
945ef73454c4 Map FFmpeg's Escape 124 decoder to new MPlayer internal FourCC.
cehoyos
parents: 34290
diff changeset
97 { CODEC_ID_ESCAPE124, MKTAG('E', '1', '2', '4')},
34413
8eebe2a33894 libmpdemux/mp_taglists.c: Replace #ifdef with #if directives
siretart
parents: 34411
diff changeset
98 #if LIBAVUTIL_VERSION_MICRO >= 100
34316
446aeefc216b Support decoding newer rpl files with FFmpeg's Escape 130 decoder.
cehoyos
parents: 34305
diff changeset
99 { CODEC_ID_ESCAPE130, MKTAG('E', '1', '3', '0')},
34404
95f802285711 Allow compilation with Libav
siretart
parents: 34363
diff changeset
100 #endif
34043
94106ed224b3 Support Sorenson Spark in f4v files.
cehoyos
parents: 34042
diff changeset
101 { CODEC_ID_FLV1, MKTAG('F', 'L', 'V', '1')},
34042
89ad6c0928cf Support act files with -demuxer lavf.
cehoyos
parents: 33940
diff changeset
102 { CODEC_ID_G729, MKTAG('G', '7', '2', '9')},
29553
1f67a98bbc95 cosmetics: alphabetically order lists
diego
parents: 29551
diff changeset
103 { CODEC_ID_H264, MKTAG('H', '2', '6', '4')},
34097
4a1cb0a053cb Support MP3 in TS with -demuxer lavf.
cehoyos
parents: 34096
diff changeset
104 { CODEC_ID_MP3, 0x55},
29558
e71981bd196c Fix MPEG-4 ASP in MPEG transport streams with -demuxer lavf.
cehoyos
parents: 29557
diff changeset
105 { CODEC_ID_MPEG4, MKTAG('M', 'P', '4', 'V')},
34920
1431b26d1427 Support FFmpeg Packed Animation File decoder.
cehoyos
parents: 34910
diff changeset
106 #if LIBAVUTIL_VERSION_MICRO >= 100
1431b26d1427 Support FFmpeg Packed Animation File decoder.
cehoyos
parents: 34910
diff changeset
107 { CODEC_ID_PAF_AUDIO, MKTAG('P', 'A', 'F', 'A')},
1431b26d1427 Support FFmpeg Packed Animation File decoder.
cehoyos
parents: 34910
diff changeset
108 { CODEC_ID_PAF_VIDEO, MKTAG('P', 'A', 'F', 'V')},
1431b26d1427 Support FFmpeg Packed Animation File decoder.
cehoyos
parents: 34910
diff changeset
109 #endif
29553
1f67a98bbc95 cosmetics: alphabetically order lists
diego
parents: 29551
diff changeset
110 { CODEC_ID_PCM_BLURAY, MKTAG('B', 'P', 'C', 'M')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
111 { CODEC_ID_PCM_S8, MKTAG('t', 'w', 'o', 's')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
112 { CODEC_ID_PCM_U8, 1},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
113 { CODEC_ID_PCM_S16BE, MKTAG('t', 'w', 'o', 's')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
114 { CODEC_ID_PCM_S16LE, 1},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
115 { CODEC_ID_PCM_S24BE, MKTAG('i', 'n', '2', '4')},
29071
02d3778bf947 override lavf tag for pcm s24le, mov uses the same for s24be
bcoudurier
parents: 27482
diff changeset
116 { CODEC_ID_PCM_S24LE, 1},
29085
07d177c306ce override codec tag for pcm s32le and s32be, used in mov
bcoudurier
parents: 29071
diff changeset
117 { CODEC_ID_PCM_S32BE, MKTAG('i', 'n', '3', '2')},
07d177c306ce override codec tag for pcm s32le and s32be, used in mov
bcoudurier
parents: 29071
diff changeset
118 { CODEC_ID_PCM_S32LE, 1},
29547
e86e60afd8b8 Fix MP2 and AC3 with demuxer lavf in MPEG transport streams.
cehoyos
parents: 29546
diff changeset
119 { CODEC_ID_MP2, 0x50},
29549
a97c9fd97336 Fix MPEG2 and H264 in MPEG transport stream with demuxer lavf.
cehoyos
parents: 29547
diff changeset
120 { CODEC_ID_MPEG2VIDEO, MKTAG('M', 'P', 'G', '2')},
29709
750ebb6ee49a Play TrueHD in BluRay with demuxer lavf.
cehoyos
parents: 29658
diff changeset
121 { CODEC_ID_TRUEHD, MKTAG('T', 'R', 'H', 'D')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
122 { 0, 0 },
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
123 };
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
124
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
125 static const struct AVCodecTag * const mp_codecid_override_taglists[] =
29551
19fa7aedb519 Rename mp_wav_override_tag* as mp_codecid_override_tag* to reflect that
cehoyos
parents: 29549
diff changeset
126 {mp_codecid_override_tags, 0};
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
127
34156
758264af214d Consistently use "struct AVCodecTag" and not sometimes just "AVCodecTag".
reimar
parents: 34155
diff changeset
128 static const struct AVCodecTag mp_bmp_tags[] = {
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
129 { CODEC_ID_AMV, MKTAG('A', 'M', 'V', 'V')},
33201
70a2195b4904 Add mapping between codec ID and tag for ANM and AVS.
reimar
parents: 33038
diff changeset
130 { CODEC_ID_ANM, MKTAG('A', 'N', 'M', ' ')},
34062
4a0cac2ced3f decoder: add ffmpeg ansi decoder
compn
parents: 34043
diff changeset
131 { CODEC_ID_ANSI, MKTAG('T', 'X', 'T', '4')},
33201
70a2195b4904 Add mapping between codec ID and tag for ANM and AVS.
reimar
parents: 33038
diff changeset
132 { CODEC_ID_AVS, MKTAG('A', 'V', 'S', ' ')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
133 { CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')},
26459
f6183d22bdb3 Add BFI video support through FFmpeg.
diego
parents: 26328
diff changeset
134 { CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')},
34245
3498659ef543 Support BMV decoding (bug 2009).
cehoyos
parents: 34244
diff changeset
135 { CODEC_ID_BMV_VIDEO, MKTAG('B', 'M', 'V', 'V')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
136 { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')},
30062
54002b08fc78 create CDGR fourcc in mp_taglist and add ffcdgraphics to codecs.conf
compn
parents: 29859
diff changeset
137 { CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')},
34644
3ed6c81c8dee Support playback of CDXL files with -demuxer lavf.
cehoyos
parents: 34636
diff changeset
138 { CODEC_ID_CDXL, MKTAG('C', 'D', 'X', 'L')},
34244
07aabc1bb1fd Add support for decoding EA CMV files.
reimar
parents: 34219
diff changeset
139 { CODEC_ID_CMV, MKTAG('M', 'V', 'I', 'f')},
34217
aafe86a9a6e8 Support Chronomaster DFA decoding (bug 2006).
cehoyos
parents: 34207
diff changeset
140 { CODEC_ID_DFA, MKTAG('C', 'D', 'F', 'A')},
29658
6235d300cf7e Allow playback of dnxhd files, as produced by FFmpeg regression test.
cehoyos
parents: 29622
diff changeset
141 { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
142 { CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
143 { CODEC_ID_DXA, MKTAG('D', 'X', 'A', '1')},
34742
6b1b5a34a94e Switch FLIC tag to the one used by FLIC-in-MOV.
reimar
parents: 34734
diff changeset
144 { CODEC_ID_FLIC, MKTAG('f', 'l', 'i', 'c')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
145 { CODEC_ID_IDCIN, MKTAG('I', 'D', 'C', 'I')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
146 { CODEC_ID_INTERPLAY_VIDEO, MKTAG('I', 'N', 'P', 'V')},
33038
6bcfd2a73d43 FFmpeg Bitmap Brothers JV decoder.
cehoyos
parents: 32904
diff changeset
147 { CODEC_ID_JV, MKTAG('F', 'F', 'J', 'V')},
34304
05d2e60c728b Support FFmpeg's EA MAD decoder.
cehoyos
parents: 34303
diff changeset
148 { CODEC_ID_MAD, MKTAG('M', 'A', 'D', 'k')},
27101
2b2ee1d4a62a add ffmdec and ffadpcmxa
compn
parents: 26846
diff changeset
149 { CODEC_ID_MDEC, MKTAG('M', 'D', 'E', 'C')},
34357
dd20c9da3051 Support FFmpeg mmvideo decoder.
cehoyos
parents: 34316
diff changeset
150 { CODEC_ID_MMVIDEO, MKTAG('M', 'M', 'V', ' ')},
27323
7a41444980f3 add ffmotionpixels codec
compn
parents: 27200
diff changeset
151 { CODEC_ID_MOTIONPIXELS, MKTAG('M', 'V', 'I', '1')},
34207
82e08cd39ae2 Support Mobotix MxPEG decoding (bug 2004).
cehoyos
parents: 34196
diff changeset
152 { CODEC_ID_MXPEG, MKTAG('M', 'X', 'P', 'G')},
34219
f25ac0f261f6 Restore NUV1 internal fourcc.
reimar
parents: 34217
diff changeset
153 { CODEC_ID_NUV, MKTAG('N', 'U', 'V', '1')},
26735
884d72a2dc78 add rl2 codec
compn
parents: 26459
diff changeset
154 { CODEC_ID_RL2, MKTAG('R', 'L', '2', 'V')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
155 { CODEC_ID_ROQ, MKTAG('R', 'o', 'Q', 'V')},
27429
bc54ab99e5b6 add mapping for real audio and video CODEC_ID to MPlayer's fourcc
aurel
parents: 27324
diff changeset
156 { CODEC_ID_RV10, MKTAG('R', 'V', '1', '0')},
bc54ab99e5b6 add mapping for real audio and video CODEC_ID to MPlayer's fourcc
aurel
parents: 27324
diff changeset
157 { CODEC_ID_RV20, MKTAG('R', 'V', '2', '0')},
bc54ab99e5b6 add mapping for real audio and video CODEC_ID to MPlayer's fourcc
aurel
parents: 27324
diff changeset
158 { CODEC_ID_RV30, MKTAG('R', 'V', '3', '0')},
bc54ab99e5b6 add mapping for real audio and video CODEC_ID to MPlayer's fourcc
aurel
parents: 27324
diff changeset
159 { CODEC_ID_RV40, MKTAG('R', 'V', '4', '0')},
34910
3629ef4a19ce Support LucasArts SMUSH and VIMA decoding.
cehoyos
parents: 34742
diff changeset
160 #if LIBAVUTIL_VERSION_MICRO >= 100
3629ef4a19ce Support LucasArts SMUSH and VIMA decoding.
cehoyos
parents: 34742
diff changeset
161 { CODEC_ID_SANM, MKTAG('S', 'A', 'N', 'M')},
3629ef4a19ce Support LucasArts SMUSH and VIMA decoding.
cehoyos
parents: 34742
diff changeset
162 #endif
32573
77c851105750 make tag for svq3, fixes:
compn
parents: 32497
diff changeset
163 { CODEC_ID_SVQ3, MKTAG('S', 'V', 'Q', '3')},
34363
995cbc4b5884 Support FFmpeg 8088flex TMV decoder.
cehoyos
parents: 34359
diff changeset
164 { CODEC_ID_TMV, MKTAG('t', 'm', 'v', '8')},
29778
88b76f9e4233 cosmetics: alphabetize
compn
parents: 29777
diff changeset
165 { CODEC_ID_TGV, MKTAG('f', 'V', 'G', 'T')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
166 { CODEC_ID_THP, MKTAG('T', 'H', 'P', 'V')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
167 { CODEC_ID_TIERTEXSEQVIDEO, MKTAG('T', 'S', 'E', 'Q')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
168 { CODEC_ID_TXD, MKTAG('T', 'X', 'D', 'V')},
27324
f52396a61654 add ffvp6a codec
compn
parents: 27323
diff changeset
169 { CODEC_ID_VP6A, MKTAG('V', 'P', '6', 'A')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
170 { CODEC_ID_VMDVIDEO, MKTAG('V', 'M', 'D', 'V')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
171 { CODEC_ID_WS_VQA, MKTAG('V', 'Q', 'A', 'V')},
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
172 { CODEC_ID_XAN_WC3, MKTAG('W', 'C', '3', 'V')},
35186
130cdc6e5a00 Support FFmpeg YOP decoder.
cehoyos
parents: 35141
diff changeset
173 { CODEC_ID_YOP, MKTAG('Y', 'O', 'P', '1')},
26328
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
174 { 0, 0 },
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
175 };
11aac031b4b7 Split the lavf taglists out of the lavf muxer to allow using libmpmux
albeu
parents:
diff changeset
176
34636
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
177 static void get_taglists(const struct AVCodecTag *dst[3], int audio)
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
178 {
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
179 dst[0] = audio ? mp_wav_tags : mp_bmp_tags;
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
180 dst[1] = audio ? avformat_get_riff_audio_tags() : avformat_get_riff_video_tags();
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
181 dst[2] = NULL;
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
182 }
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
183
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
184 enum CodecID mp_tag2codec_id(uint32_t tag, int audio)
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
185 {
34636
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
186 const struct AVCodecTag *taglists[3];
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
187 get_taglists(taglists, audio);
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
188 return av_codec_get_id(taglists, tag);
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
189 }
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
190
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
191 uint32_t mp_codec_id2tag(enum CodecID codec_id, uint32_t old_tag, int audio)
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
192 {
34636
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
193 const struct AVCodecTag *taglists[3];
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
194 // For some formats (like PCM) always trust CODEC_ID_* more than codec_tag
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
195 uint32_t tag = av_codec_get_tag(mp_codecid_override_taglists, codec_id);
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
196 if (tag)
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
197 return tag;
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
198
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
199 // mp4a tag is used for all mp4 files no matter what they actually contain
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
200 // mp4v is sometimes also used for files containing e.g. mjpeg
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
201 if (audio && old_tag != MKTAG('m', 'p', '4', 'a') ||
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
202 !audio && old_tag != MKTAG('m', 'p', '4', 'v'))
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
203 tag = old_tag;
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
204 if (tag)
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
205 return tag;
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
206
34636
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
207 get_taglists(taglists, audio);
fde1a35cf043 Simplify codec id <-> tag mapping using avformat_get_riff_*_tags.
reimar
parents: 34413
diff changeset
208 return av_codec_get_tag(taglists, codec_id);
34155
505b49b171f4 Change codec tag/id conversion to not use ff_codec_bmp_tags/ff_codec_wav_tags.
reimar
parents: 34097
diff changeset
209 }