/src/vlc/include/vlc_codecs.h
Line | Count | Source (jump to first uncovered line) |
1 | | /***************************************************************************** |
2 | | * vlc_codecs.h: codec related structures needed by the demuxers and decoders |
3 | | ***************************************************************************** |
4 | | * Copyright (C) 1999-2001 VLC authors and VideoLAN |
5 | | * |
6 | | * Author: Gildas Bazin <gbazin@videolan.org> |
7 | | * |
8 | | * This program is free software; you can redistribute it and/or modify it |
9 | | * under the terms of the GNU Lesser General Public License as published by |
10 | | * the Free Software Foundation; either version 2.1 of the License, or |
11 | | * (at your option) any later version. |
12 | | * |
13 | | * This program is distributed in the hope that it will be useful, |
14 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | * GNU Lesser General Public License for more details. |
17 | | * |
18 | | * You should have received a copy of the GNU Lesser General Public License |
19 | | * along with this program; if not, write to the Free Software Foundation, |
20 | | * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. |
21 | | *****************************************************************************/ |
22 | | |
23 | | #ifndef VLC_CODECS_H |
24 | | #define VLC_CODECS_H 1 |
25 | | |
26 | | #include <vlc_fourcc.h> |
27 | | /** |
28 | | * \file |
29 | | * This file defines codec related structures needed by the demuxers and decoders |
30 | | */ |
31 | | |
32 | | /* Structures exported to the demuxers and decoders */ |
33 | | |
34 | | #if !(defined _GUID_DEFINED || defined GUID_DEFINED) |
35 | | #define GUID_DEFINED |
36 | | typedef struct _GUID |
37 | | { |
38 | | uint32_t Data1; |
39 | | uint16_t Data2; |
40 | | uint16_t Data3; |
41 | | uint8_t Data4[8]; |
42 | | } GUID, *REFGUID, *LPGUID; |
43 | | #endif /* GUID_DEFINED */ |
44 | | |
45 | | typedef GUID vlc_guid_t; |
46 | | |
47 | | #ifdef HAVE_ATTRIBUTE_PACKED |
48 | | # define ATTR_PACKED __attribute__((__packed__)) |
49 | | #elif defined(__SUNPRO_C) |
50 | | # pragma pack(1) |
51 | | # define ATTR_PACKED |
52 | | #elif defined(_MSC_VER) |
53 | | # include <pshpack1.h> |
54 | | # define ATTR_PACKED |
55 | | #elif defined(__APPLE__) |
56 | | # pragma pack(push, 1) |
57 | | # define ATTR_PACKED |
58 | | #else |
59 | | # error FIXME |
60 | | #endif |
61 | | |
62 | | #ifndef _WAVEFORMATEX_ |
63 | | #define _WAVEFORMATEX_ |
64 | | typedef struct |
65 | | ATTR_PACKED |
66 | | _WAVEFORMATEX { |
67 | | uint16_t wFormatTag; |
68 | | uint16_t nChannels; |
69 | | uint32_t nSamplesPerSec; |
70 | | uint32_t nAvgBytesPerSec; |
71 | | uint16_t nBlockAlign; |
72 | | uint16_t wBitsPerSample; |
73 | | uint16_t cbSize; |
74 | | } WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; |
75 | | #endif /* _WAVEFORMATEX_ */ |
76 | | |
77 | | #ifndef _WAVEFORMATEXTENSIBLE_ |
78 | | #define _WAVEFORMATEXTENSIBLE_ |
79 | | typedef struct |
80 | | ATTR_PACKED |
81 | | _WAVEFORMATEXTENSIBLE { |
82 | | WAVEFORMATEX Format; |
83 | | union { |
84 | | uint16_t wValidBitsPerSample; /* bits of precision */ |
85 | | uint16_t wSamplesPerBlock; /* valid if wBitsPerSample==0 */ |
86 | | uint16_t wReserved; /* If neither applies, set to zero. */ |
87 | | } Samples; |
88 | | |
89 | | uint32_t dwChannelMask; /* Channels present */ |
90 | | |
91 | | GUID SubFormat; |
92 | | } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; |
93 | | #endif /* _WAVEFORMATEXTENSIBLE_ */ |
94 | | |
95 | | #ifndef _WAVEFORMATEXTENSIBLE_IEC61937_ |
96 | | #define _WAVEFORMATEXTENSIBLE_IEC61937_ |
97 | | typedef struct |
98 | | ATTR_PACKED |
99 | | _WAVEFORMATEXTENSIBLE_IEC61937 { |
100 | | WAVEFORMATEXTENSIBLE FormatExt; |
101 | | uint32_t dwEncodedSamplesPerSec; |
102 | | uint32_t dwEncodedChannelCount; |
103 | | uint32_t dwAverageBytesPerSec; |
104 | | } WAVEFORMATEXTENSIBLE_IEC61937, *PWAVEFORMATEXTENSIBLE_IEC61937; |
105 | | #endif /* _WAVEFORMATEXTENSIBLE_IEC61937_ */ |
106 | | |
107 | | #ifndef _WAVEHEADER_ |
108 | | #define _WAVEHEADER_ |
109 | | typedef struct |
110 | | ATTR_PACKED |
111 | | _WAVEHEADER { |
112 | | uint32_t MainChunkID; |
113 | | uint32_t Length; |
114 | | uint32_t ChunkTypeID; |
115 | | uint32_t SubChunkID; |
116 | | uint32_t SubChunkLength; |
117 | | uint16_t Format; |
118 | | uint16_t Modus; |
119 | | uint32_t SampleFreq; |
120 | | uint32_t BytesPerSec; |
121 | | uint16_t BytesPerSample; |
122 | | uint16_t BitsPerSample; |
123 | | uint32_t DataChunkID; |
124 | | uint32_t DataLength; |
125 | | } WAVEHEADER; |
126 | | #endif /* _WAVEHEADER_ */ |
127 | | |
128 | | #ifndef _VLC_BITMAPINFOHEADER_ |
129 | | #define _VLC_BITMAPINFOHEADER_ |
130 | | |
131 | | typedef struct |
132 | | ATTR_PACKED |
133 | | { |
134 | | uint32_t biSize; |
135 | | uint32_t biWidth; |
136 | | uint32_t biHeight; |
137 | | uint16_t biPlanes; |
138 | | uint16_t biBitCount; |
139 | | uint32_t biCompression; |
140 | | uint32_t biSizeImage; |
141 | | uint32_t biXPelsPerMeter; |
142 | | uint32_t biYPelsPerMeter; |
143 | | uint32_t biClrUsed; |
144 | | uint32_t biClrImportant; |
145 | | } VLC_BITMAPINFOHEADER, *VLC_PBITMAPINFOHEADER, *VLC_LPBITMAPINFOHEADER; |
146 | | #endif |
147 | | |
148 | | #if defined(__SUNPRO_C) |
149 | | # pragma pack() |
150 | | #elif defined(_MSC_VER) |
151 | | # include <poppack.h> |
152 | | #elif defined(__APPLE__) && !defined(HAVE_ATTRIBUTE_PACKED) |
153 | | # pragma pack(pop) |
154 | | #endif |
155 | | |
156 | | #if defined(static_assert) || defined(__cpp_static_assert) |
157 | | #define VLC_CHECK_WAV_FORMAT(name, val) \ |
158 | | static_assert(name == val, "unpexpected definition of " #name); |
159 | | #else |
160 | | #define VLC_CHECK_WAV_FORMAT(name, val) |
161 | | #endif |
162 | | |
163 | | /* WAVE format wFormatTag IDs */ |
164 | | /* See http://msdn.microsoft.com/en-us/library/aa904731%28v=vs.80%29.aspx */ |
165 | 199 | #define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */ |
166 | | #ifndef WAVE_FORMAT_PCM |
167 | 160 | #define WAVE_FORMAT_PCM 0x0001 /* Microsoft Corporation */ |
168 | | #else |
169 | | VLC_CHECK_WAV_FORMAT(WAVE_FORMAT_PCM, 0x0001) |
170 | | #endif |
171 | | #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ |
172 | | #define WAVE_FORMAT_IEEE_FLOAT 0x0003 /* Microsoft Corporation */ |
173 | | #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ |
174 | | #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ |
175 | | #define WAVE_FORMAT_DTS 0x0008 /* Microsoft Corporation */ |
176 | | #define WAVE_FORMAT_WMAS 0x000a /* WMA 9 Speech */ |
177 | | #ifndef WAVE_FORMAT_IMA_ADPCM |
178 | | #define WAVE_FORMAT_IMA_ADPCM 0x0011 /* Intel Corporation */ |
179 | | #else |
180 | | VLC_CHECK_WAV_FORMAT(WAVE_FORMAT_IMA_ADPCM, 0x0011) |
181 | | #endif |
182 | | #define WAVE_FORMAT_YAMAHA_ADPCM 0x0020 /* Yamaha */ |
183 | | #define WAVE_FORMAT_TRUESPEECH 0x0022 /* TrueSpeech */ |
184 | | #define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */ |
185 | | #define WAVE_FORMAT_MSNAUDIO 0x0032 /* Microsoft Corporation */ |
186 | | #define WAVE_FORMAT_AMR_NB_2 0x0038 /* AMR NB rogue */ |
187 | | #define WAVE_FORMAT_MSG723 0x0042 /* Microsoft G.723 [G723.1] */ |
188 | | #define WAVE_FORMAT_SHARP_G726 0x0045 /* ITU-T standard */ |
189 | 39 | #define WAVE_FORMAT_MPEG 0x0050 /* Microsoft Corporation */ |
190 | 39 | #define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */ |
191 | | #define WAVE_FORMAT_AMR_NARROWBAND 0x0057 /* AMR NB */ |
192 | | #define WAVE_FORMAT_AMR_WIDEBAND 0x0058 /* AMR Wideband */ |
193 | | #define WAVE_FORMAT_G726_ADPCM 0x0064 /* G.726 ADPCM */ |
194 | | #define WAVE_FORMAT_VOXWARE_RT29 0x0075 /* VoxWare MetaSound */ |
195 | | #define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 /* Sonic Foundry */ |
196 | | #define WAVE_FORMAT_VIVOG723 0x0111 /* Vivo G.723.1 */ |
197 | | |
198 | | #define WAVE_FORMAT_AAC 0x00FF /* */ |
199 | | #define WAVE_FORMAT_AAC_MS 0xa106 /* Microsoft AAC */ |
200 | | #define WAVE_FORMAT_SIPRO 0x0130 /* Sipro Lab Telecom Inc. */ |
201 | | |
202 | | #define WAVE_FORMAT_WMA1 0x0160 /* WMA version 1 */ |
203 | | #define WAVE_FORMAT_WMA2 0x0161 /* WMA (v2) 7, 8, 9 Series */ |
204 | | #define WAVE_FORMAT_WMAP 0x0162 /* WMA 9 Professional */ |
205 | | #define WAVE_FORMAT_WMAL 0x0163 /* WMA 9 Lossless */ |
206 | | |
207 | | #define WAVE_FORMAT_CREATIVE_ADPCM 0x0200 /* Creative */ |
208 | | |
209 | | #define WAVE_FORMAT_ULEAD_DV_AUDIO_NTSC 0x0215 /* Ulead */ |
210 | | #define WAVE_FORMAT_ULEAD_DV_AUDIO_PAL 0x0216 /* Ulead */ |
211 | | |
212 | | #define WAVE_FORMAT_ATRAC3 0x0270 /* Atrac3, != from MSDN doc */ |
213 | | #define WAVE_FORMAT_SONY_ATRAC3 0x0272 /* Atrac3, != from MSDN doc */ |
214 | | |
215 | | #define WAVE_FORMAT_IMC 0x0401 |
216 | | #define WAVE_FORMAT_INDEO_AUDIO 0x0402 /* Indeo Audio Coder */ |
217 | | |
218 | | #define WAVE_FORMAT_ON2_AVC 0x0500 /* VP7 */ |
219 | | #define WAVE_FORMAT_ON2_AVC_2 0x0501 /* VP6 */ |
220 | | |
221 | | #define WAVE_FORMAT_QNAP_ADTS 0x0AAC /* Qnap ADTS */ |
222 | | #define WAVE_FORMAT_AAC_ADTS 0x1600 /* AAC/ADTS */ |
223 | | #define WAVE_FORMAT_AAC_2 0x1601 /* Other AAC */ |
224 | | #define WAVE_FORMAT_AAC_LATM 0x1602 /* AAC/LATM */ |
225 | | #define WAVE_FORMAT_HEAAC 0x1610 /* Raw AAC or ADTS */ |
226 | | |
227 | 78 | #define WAVE_FORMAT_A52 0x2000 /* a52 */ |
228 | 36 | #define WAVE_FORMAT_DTSINC_DTS 0x2001 /* DTS */ |
229 | | #ifndef WAVE_FORMAT_ALAC |
230 | | #define WAVE_FORMAT_ALAC 0x6c61 |
231 | | #else |
232 | | VLC_CHECK_WAV_FORMAT(WAVE_FORMAT_ALAC, 0x6c61) |
233 | | #endif |
234 | | #ifndef WAVE_FORMAT_OPUS |
235 | | #define WAVE_FORMAT_OPUS 0x704f |
236 | | #else |
237 | | VLC_CHECK_WAV_FORMAT(WAVE_FORMAT_OPUS, 0x704f) |
238 | | #endif |
239 | | #define WAVE_FORMAT_AVCODEC_AAC 0x706D |
240 | | #define WAVE_FORMAT_DIVIO_AAC 0x4143 /* Divio's AAC */ |
241 | | |
242 | | #define WAVE_FORMAT_AMR_NB 0x7361 |
243 | | #define WAVE_FORMAT_AMR_WB 0x7362 |
244 | | #define WAVE_FORMAT_AMR_WP 0x7363 |
245 | | |
246 | | #define WAVE_FORMAT_GSM_AMR_FIXED 0x7A21 /* Fixed bitrate, no SID */ |
247 | | #define WAVE_FORMAT_GSM_AMR 0x7A22 /* Variable bitrate, including SID */ |
248 | | |
249 | | #define WAVE_FORMAT_DK3 0x0062 |
250 | | #define WAVE_FORMAT_DK4 0x0061 |
251 | | |
252 | | /* At least libavformat use that ID: from libavformat/riff.c ('Vo' == 0x566f) |
253 | | * { CODEC_ID_VORBIS, ('V'<<8)+'o' }, //HACK/FIXME, does vorbis in WAV/AVI have an (in)official id? |
254 | | */ |
255 | | #define WAVE_FORMAT_VORBIS 0x566f |
256 | | |
257 | | /* It seems that these IDs are used by braindead & obsolete VorbisACM encoder |
258 | | * (Windows only) |
259 | | * A few info is available except VorbisACM source (remember, Windows only) |
260 | | * (available on http://svn.xiph.org), but it seems that vo3+ at least is |
261 | | * made of Vorbis data encapsulated in Ogg container... |
262 | | */ |
263 | | #define WAVE_FORMAT_VORB_1 0x674f |
264 | | #define WAVE_FORMAT_VORB_2 0x6750 |
265 | | #define WAVE_FORMAT_VORB_3 0x6751 |
266 | | #define WAVE_FORMAT_VORB_1PLUS 0x676f |
267 | | #define WAVE_FORMAT_VORB_2PLUS 0x6770 |
268 | | #define WAVE_FORMAT_VORB_3PLUS 0x6771 |
269 | | |
270 | | #define WAVE_FORMAT_G723_1 0xa100 |
271 | | #define WAVE_FORMAT_AAC_3 0xa106 |
272 | | #define WAVE_FORMAT_SPEEX 0xa109 /* Speex audio */ |
273 | | #ifndef WAVE_FORMAT_FLAC |
274 | | #define WAVE_FORMAT_FLAC 0xf1ac /* Xiph Flac */ |
275 | | #endif |
276 | | |
277 | | #if !defined(WAVE_FORMAT_EXTENSIBLE) |
278 | 0 | #define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */ |
279 | | #endif |
280 | | |
281 | | /* GUID SubFormat IDs */ |
282 | | #define VLC_KSDATAFORMAT_SUBTYPE_ATRAC3P {0xE923AABF, 0xCB58, 0x4471, {0xA1, 0x19, 0xFF, 0xFA, 0x01, 0xE4, 0xCE, 0x62}} /* Undocumented */ |
283 | 0 | #define VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} |
284 | 0 | #define VLC_WAVEFORMATEX_GUIDBASE {0x00000000, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} /* Generated from Wave Format */ |
285 | | #define VLC_AMBISONIC_SUBTYPE_PCM {0x00000001, 0x0721, 0x11D3, {0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00}} /* AMBISONIC_B_FORMAT_PCM */ |
286 | | #define VLC_AMBISONIC_SUBTYPE_IEEE_FLOAT {0x00000003, 0x0721, 0x11D3, {0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00}} /* AMBISONIC_B_FORMAT_IEEE_FLOAT */ |
287 | | |
288 | | /* Microsoft speaker definitions */ |
289 | | #define WAVE_SPEAKER_FRONT_LEFT 0x1 |
290 | | #define WAVE_SPEAKER_FRONT_RIGHT 0x2 |
291 | | #define WAVE_SPEAKER_FRONT_CENTER 0x4 |
292 | | #define WAVE_SPEAKER_LOW_FREQUENCY 0x8 |
293 | | #define WAVE_SPEAKER_BACK_LEFT 0x10 |
294 | | #define WAVE_SPEAKER_BACK_RIGHT 0x20 |
295 | | #define WAVE_SPEAKER_FRONT_LEFT_OF_CENTER 0x40 |
296 | | #define WAVE_SPEAKER_FRONT_RIGHT_OF_CENTER 0x80 |
297 | | #define WAVE_SPEAKER_BACK_CENTER 0x100 |
298 | | #define WAVE_SPEAKER_SIDE_LEFT 0x200 |
299 | | #define WAVE_SPEAKER_SIDE_RIGHT 0x400 |
300 | | #define WAVE_SPEAKER_TOP_CENTER 0x800 |
301 | | #define WAVE_SPEAKER_TOP_FRONT_LEFT 0x1000 |
302 | | #define WAVE_SPEAKER_TOP_FRONT_CENTER 0x2000 |
303 | | #define WAVE_SPEAKER_TOP_FRONT_RIGHT 0x4000 |
304 | | #define WAVE_SPEAKER_TOP_BACK_LEFT 0x8000 |
305 | | #define WAVE_SPEAKER_TOP_BACK_CENTER 0x10000 |
306 | | #define WAVE_SPEAKER_TOP_BACK_RIGHT 0x20000 |
307 | | #define WAVE_SPEAKER_RESERVED 0x80000000 |
308 | | |
309 | | static const struct |
310 | | { |
311 | | uint16_t i_tag; |
312 | | vlc_fourcc_t i_fourcc; |
313 | | const char *psz_name; |
314 | | } |
315 | | wave_format_tag_to_fourcc[] = |
316 | | { |
317 | | { WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" }, |
318 | | { WAVE_FORMAT_PCM, VLC_CODEC_S8, "PCM S8 audio" }, |
319 | | { WAVE_FORMAT_PCM, VLC_CODEC_S16L, "PCM S16L audio" }, |
320 | | { WAVE_FORMAT_PCM, VLC_CODEC_S24L, "PCM S24L audio" }, |
321 | | { WAVE_FORMAT_PCM, VLC_CODEC_S32L, "PCM S32L audio" }, |
322 | | { WAVE_FORMAT_ADPCM, VLC_CODEC_ADPCM_MS, "ADPCM" }, |
323 | | { WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" }, |
324 | | { WAVE_FORMAT_IEEE_FLOAT, VLC_CODEC_F32L, "PCM 32 (Float) audio" }, |
325 | | { WAVE_FORMAT_IEEE_FLOAT, VLC_CODEC_F64L, "PCM 64 (Float) audio" }, |
326 | | { WAVE_FORMAT_ALAW, VLC_CODEC_ALAW, "A-Law" }, |
327 | | { WAVE_FORMAT_MULAW, VLC_CODEC_MULAW, "Mu-Law" }, |
328 | | { WAVE_FORMAT_IMA_ADPCM, VLC_CODEC_ADPCM_IMA_WAV, "Ima-ADPCM" }, |
329 | | { WAVE_FORMAT_CREATIVE_ADPCM, VLC_CODEC_ADPCM_CREATIVE, "Creative ADPCM" }, |
330 | | { WAVE_FORMAT_YAMAHA_ADPCM, VLC_CODEC_ADPCM_YAMAHA, "Yamaha ADPCM" }, |
331 | | { WAVE_FORMAT_TRUESPEECH, VLC_CODEC_TRUESPEECH, "Truespeech" }, |
332 | | { WAVE_FORMAT_GSM610, VLC_CODEC_GSM_MS, "Microsoft WAV GSM" }, |
333 | | { WAVE_FORMAT_MSNAUDIO, VLC_CODEC_GSM_MS, "Microsoft MSN Audio" }, |
334 | | { WAVE_FORMAT_SHARP_G726, VLC_CODEC_ADPCM_G726, "G.726 ADPCM" }, |
335 | | { WAVE_FORMAT_G726_ADPCM, VLC_CODEC_ADPCM_G726, "G.726 ADPCM" }, |
336 | | { WAVE_FORMAT_G723_1, VLC_CODEC_G723_1, "G.723.1" }, |
337 | | { WAVE_FORMAT_MSG723, VLC_CODEC_G723_1, "Microsoft G.723 [G723.1]" }, |
338 | | { WAVE_FORMAT_VIVOG723, VLC_CODEC_G723_1, "Vivo G.723.1" }, |
339 | | { WAVE_FORMAT_MPEGLAYER3, VLC_CODEC_MP3, "Mpeg Audio Layer 3" }, |
340 | | { WAVE_FORMAT_MPEG, VLC_CODEC_MPGA, "Mpeg Audio" }, |
341 | | { WAVE_FORMAT_AMR_NARROWBAND, VLC_CODEC_AMR_NB, "AMR NB" }, |
342 | | { WAVE_FORMAT_AMR_NB, VLC_CODEC_AMR_NB, "AMR NB" }, |
343 | | { WAVE_FORMAT_AMR_NB_2, VLC_CODEC_AMR_NB, "AMR NB" }, |
344 | | { WAVE_FORMAT_AMR_WIDEBAND, VLC_CODEC_AMR_WB, "AMR Wideband" }, |
345 | | { WAVE_FORMAT_AMR_WB, VLC_CODEC_AMR_WB, "AMR Wideband" }, |
346 | | { WAVE_FORMAT_SIPRO, VLC_CODEC_SIPR, "Sipr Audio" }, |
347 | | { WAVE_FORMAT_A52, VLC_CODEC_A52, "DVM AC-3" }, |
348 | | { WAVE_FORMAT_WMA1, VLC_CODEC_WMA1, "Window Media Audio v1" }, |
349 | | { WAVE_FORMAT_WMA2, VLC_CODEC_WMA2, "Window Media Audio v2" }, |
350 | | { WAVE_FORMAT_WMAP, VLC_CODEC_WMAP, "Window Media Audio 9 Professional" }, |
351 | | { WAVE_FORMAT_WMAL, VLC_CODEC_WMAL, "Window Media Audio 9 Lossless" }, |
352 | | { WAVE_FORMAT_WMAS, VLC_CODEC_WMAS, "Window Media Audio 9 Speech" }, |
353 | | { WAVE_FORMAT_ATRAC3, VLC_CODEC_ATRAC3, "Sony Atrac3" }, |
354 | | { WAVE_FORMAT_SONY_ATRAC3, VLC_CODEC_ATRAC3, "Sony Atrac3" }, |
355 | | { WAVE_FORMAT_DK3, VLC_CODEC_ADPCM_DK3, "Duck DK3" }, |
356 | | { WAVE_FORMAT_DK4, VLC_CODEC_ADPCM_DK4, "Duck DK4" }, |
357 | | { WAVE_FORMAT_DTSINC_DTS, VLC_CODEC_DTS, "DTS Coherent Acoustics" }, |
358 | | { WAVE_FORMAT_DTS, VLC_CODEC_DTS, "DTS Coherent Acoustics" }, |
359 | | { WAVE_FORMAT_DIVIO_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio (Divio)" }, |
360 | | { WAVE_FORMAT_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio" }, |
361 | | { WAVE_FORMAT_QNAP_ADTS, VLC_CODEC_MP4A, "MPEG-4 ADTS Audio" }, |
362 | | { WAVE_FORMAT_AAC_ADTS, VLC_CODEC_MP4A, "MPEG-4 ADTS Audio" }, |
363 | | { WAVE_FORMAT_AAC_2, VLC_CODEC_MP4A, "MPEG-4 Audio" }, |
364 | | { WAVE_FORMAT_AAC_3, VLC_CODEC_MP4A, "MPEG-4 Audio" }, |
365 | | { WAVE_FORMAT_AAC_LATM, VLC_CODEC_MP4A, "MPEG-4 LATM Audio" }, |
366 | | { WAVE_FORMAT_HEAAC, VLC_CODEC_MP4A, "MPEG-4 Audio" }, |
367 | | { WAVE_FORMAT_ALAC, VLC_CODEC_ALAC, "Apple Lossless" }, |
368 | | { WAVE_FORMAT_OPUS, VLC_CODEC_OPUS, "Opus Audio" }, |
369 | | { WAVE_FORMAT_AVCODEC_AAC, VLC_CODEC_MP4A, "MPEG-4 Audio" }, |
370 | | { WAVE_FORMAT_AAC_MS, VLC_CODEC_MP4A, "MPEG-4 Audio" }, |
371 | | { WAVE_FORMAT_VORBIS, VLC_CODEC_VORBIS, "Vorbis Audio" }, |
372 | | { WAVE_FORMAT_VORB_1, VLC_FOURCC( 'v', 'o', 'r', '1' ), "Vorbis 1 Audio" }, |
373 | | { WAVE_FORMAT_VORB_1PLUS, VLC_FOURCC( 'v', 'o', '1', '+' ), "Vorbis 1+ Audio" }, |
374 | | { WAVE_FORMAT_VORB_2, VLC_FOURCC( 'v', 'o', 'r', '2' ), "Vorbis 2 Audio" }, |
375 | | { WAVE_FORMAT_VORB_2PLUS, VLC_FOURCC( 'v', 'o', '2', '+' ), "Vorbis 2+ Audio" }, |
376 | | { WAVE_FORMAT_VORB_3, VLC_FOURCC( 'v', 'o', 'r', '3' ), "Vorbis 3 Audio" }, |
377 | | { WAVE_FORMAT_VORB_3PLUS, VLC_FOURCC( 'v', 'o', '3', '+' ), "Vorbis 3+ Audio" }, |
378 | | { WAVE_FORMAT_SPEEX, VLC_CODEC_SPEEX, "Speex Audio" }, |
379 | | { WAVE_FORMAT_FLAC, VLC_CODEC_FLAC, "FLAC Audio" }, |
380 | | { WAVE_FORMAT_GSM_AMR_FIXED, VLC_CODEC_AMR_NB, "GSM-AMR Audio CBR, no SID" }, |
381 | | { WAVE_FORMAT_GSM_AMR, VLC_CODEC_AMR_NB, "GSM-AMR Audio VBR, SID" }, |
382 | | { WAVE_FORMAT_ULEAD_DV_AUDIO_NTSC, VLC_CODEC_ULEAD_DV_AUDIO_NTSC, "Ulead DV audio NTSC" }, |
383 | | { WAVE_FORMAT_ULEAD_DV_AUDIO_PAL, VLC_CODEC_ULEAD_DV_AUDIO_PAL, "Ulead DV audio PAL" }, |
384 | | { WAVE_FORMAT_IMC, VLC_CODEC_IMC, "IMC" }, |
385 | | { WAVE_FORMAT_INDEO_AUDIO, VLC_CODEC_INDEO_AUDIO, "Indeo Audio Coder" }, |
386 | | { WAVE_FORMAT_VOXWARE_RT29, VLC_CODEC_METASOUND, "VoxWare MetaSound" }, |
387 | | { WAVE_FORMAT_ON2_AVC, VLC_CODEC_ON2AVC, "On2 Audio for Video Codec (VP7)" }, |
388 | | { WAVE_FORMAT_ON2_AVC_2, VLC_CODEC_ON2AVC, "On2 Audio for Video Codec (VP6)" }, |
389 | | |
390 | | { WAVE_FORMAT_UNKNOWN, VLC_CODEC_UNKNOWN, "Unknown" } |
391 | | }; |
392 | | |
393 | | static inline void wf_tag_to_fourcc( uint16_t i_tag, vlc_fourcc_t *fcc, |
394 | | const char **ppsz_name ) |
395 | 0 | { |
396 | 0 | int i; |
397 | 0 | for( i = 0; wave_format_tag_to_fourcc[i].i_tag != 0; i++ ) |
398 | 0 | { |
399 | 0 | if( wave_format_tag_to_fourcc[i].i_tag == i_tag ) break; |
400 | 0 | } |
401 | 0 | if( fcc ) *fcc = wave_format_tag_to_fourcc[i].i_fourcc; |
402 | 0 | if( ppsz_name ) *ppsz_name = wave_format_tag_to_fourcc[i].psz_name; |
403 | 0 | } Unexecuted instantiation: asf.c:wf_tag_to_fourcc Unexecuted instantiation: libasf.c:wf_tag_to_fourcc Unexecuted instantiation: asfpacket.c:wf_tag_to_fourcc Unexecuted instantiation: avi.c:wf_tag_to_fourcc Unexecuted instantiation: libavi.c:wf_tag_to_fourcc Unexecuted instantiation: caf.c:wf_tag_to_fourcc Unexecuted instantiation: es.c:wf_tag_to_fourcc Unexecuted instantiation: mp4.c:wf_tag_to_fourcc Unexecuted instantiation: fragments.c:wf_tag_to_fourcc Unexecuted instantiation: attachments.c:wf_tag_to_fourcc Unexecuted instantiation: heif.c:wf_tag_to_fourcc Unexecuted instantiation: essetup.c:wf_tag_to_fourcc Unexecuted instantiation: meta.c:wf_tag_to_fourcc Unexecuted instantiation: libmp4.c:wf_tag_to_fourcc Unexecuted instantiation: wav.c:wf_tag_to_fourcc |
404 | | |
405 | | static inline void fourcc_to_wf_tag( vlc_fourcc_t fcc, uint16_t *pi_tag ) |
406 | 0 | { |
407 | 0 | int i; |
408 | 0 | for( i = 0; wave_format_tag_to_fourcc[i].i_tag != 0; i++ ) |
409 | 0 | { |
410 | 0 | if( wave_format_tag_to_fourcc[i].i_fourcc == fcc ) break; |
411 | 0 | } |
412 | 0 | if( pi_tag ) *pi_tag = wave_format_tag_to_fourcc[i].i_tag; |
413 | 0 | } Unexecuted instantiation: asf.c:fourcc_to_wf_tag Unexecuted instantiation: libasf.c:fourcc_to_wf_tag Unexecuted instantiation: asfpacket.c:fourcc_to_wf_tag Unexecuted instantiation: avi.c:fourcc_to_wf_tag Unexecuted instantiation: libavi.c:fourcc_to_wf_tag Unexecuted instantiation: caf.c:fourcc_to_wf_tag Unexecuted instantiation: es.c:fourcc_to_wf_tag Unexecuted instantiation: mp4.c:fourcc_to_wf_tag Unexecuted instantiation: fragments.c:fourcc_to_wf_tag Unexecuted instantiation: attachments.c:fourcc_to_wf_tag Unexecuted instantiation: heif.c:fourcc_to_wf_tag Unexecuted instantiation: essetup.c:fourcc_to_wf_tag Unexecuted instantiation: meta.c:fourcc_to_wf_tag Unexecuted instantiation: libmp4.c:fourcc_to_wf_tag Unexecuted instantiation: wav.c:fourcc_to_wf_tag |
414 | | |
415 | | /* If wFormatTag is WAVEFORMATEXTENSIBLE, we must look at the SubFormat tag |
416 | | * to determine the actual format. Microsoft has stopped giving out wFormatTag |
417 | | * assignments in lieu of letting 3rd parties generate their own GUIDs |
418 | | */ |
419 | | static const struct |
420 | | { |
421 | | const GUID guid_tag; |
422 | | const vlc_fourcc_t i_fourcc; |
423 | | const char *psz_name; |
424 | | } |
425 | | sub_format_tag_to_fourcc[] = |
426 | | { |
427 | | { VLC_AMBISONIC_SUBTYPE_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Ambisonic B format (PCM)" }, |
428 | | { VLC_AMBISONIC_SUBTYPE_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "Ambisonic B format (IEEE float)" }, |
429 | | { VLC_KSDATAFORMAT_SUBTYPE_ATRAC3P, VLC_CODEC_ATRAC3P, "Sony Atrac3+" }, |
430 | | { VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN, VLC_CODEC_UNKNOWN, "Unknown" } |
431 | | }; |
432 | | |
433 | | static inline int guidcmpbase( const GUID *s1, const GUID *s2 ) |
434 | 0 | { |
435 | 0 | return( s1->Data2 == s2->Data2 && |
436 | 0 | s1->Data3 == s2->Data3 && !memcmp( s1->Data4, s2->Data4, 8 ) ); |
437 | 0 | } Unexecuted instantiation: asf.c:guidcmpbase Unexecuted instantiation: libasf.c:guidcmpbase Unexecuted instantiation: asfpacket.c:guidcmpbase Unexecuted instantiation: avi.c:guidcmpbase Unexecuted instantiation: libavi.c:guidcmpbase Unexecuted instantiation: caf.c:guidcmpbase Unexecuted instantiation: es.c:guidcmpbase Unexecuted instantiation: mp4.c:guidcmpbase Unexecuted instantiation: fragments.c:guidcmpbase Unexecuted instantiation: attachments.c:guidcmpbase Unexecuted instantiation: heif.c:guidcmpbase Unexecuted instantiation: essetup.c:guidcmpbase Unexecuted instantiation: meta.c:guidcmpbase Unexecuted instantiation: libmp4.c:guidcmpbase Unexecuted instantiation: wav.c:guidcmpbase |
438 | | |
439 | | /* compares two GUIDs, returns 1 if identical, 0 otherwise */ |
440 | | static inline int guidcmp( const GUID *s1, const GUID *s2 ) |
441 | 39 | { |
442 | 39 | return( s1->Data1 == s2->Data1 && guidcmpbase( s1, s2 ) ); |
443 | 39 | } Line | Count | Source | 441 | 39 | { | 442 | 39 | return( s1->Data1 == s2->Data1 && guidcmpbase( s1, s2 ) ); | 443 | 39 | } |
Unexecuted instantiation: libasf.c:guidcmp Unexecuted instantiation: asfpacket.c:guidcmp Unexecuted instantiation: avi.c:guidcmp Unexecuted instantiation: libavi.c:guidcmp Unexecuted instantiation: caf.c:guidcmp Unexecuted instantiation: es.c:guidcmp Unexecuted instantiation: mp4.c:guidcmp Unexecuted instantiation: fragments.c:guidcmp Unexecuted instantiation: attachments.c:guidcmp Unexecuted instantiation: heif.c:guidcmp Unexecuted instantiation: essetup.c:guidcmp Unexecuted instantiation: meta.c:guidcmp Unexecuted instantiation: libmp4.c:guidcmp Unexecuted instantiation: wav.c:guidcmp |
444 | | |
445 | | #define GUID_FMT "0x%8.8x-0x%4.4x-0x%4.4x-0x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x" |
446 | | #define GUID_PRINT( guid ) \ |
447 | | (unsigned)(guid).Data1, \ |
448 | | (guid).Data2, \ |
449 | | (guid).Data3, \ |
450 | | (guid).Data4[0],(guid).Data4[1],(guid).Data4[2],(guid).Data4[3], \ |
451 | | (guid).Data4[4],(guid).Data4[5],(guid).Data4[6],(guid).Data4[7] |
452 | | |
453 | | |
454 | | static inline void sf_tag_to_fourcc( const GUID *guid_tag, |
455 | | vlc_fourcc_t *fcc, const char **ppsz_name ) |
456 | 0 | { |
457 | 0 | int i; |
458 | 0 | bool b_found = false; |
459 | |
|
460 | 0 | const GUID unknown = VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN; |
461 | 0 | const GUID waveformatex = VLC_WAVEFORMATEX_GUIDBASE; |
462 | |
|
463 | 0 | for( i = 0; !guidcmp( &sub_format_tag_to_fourcc[i].guid_tag, |
464 | 0 | &unknown ); i++ ) |
465 | 0 | { |
466 | 0 | if( guidcmp( &sub_format_tag_to_fourcc[i].guid_tag, guid_tag ) ) |
467 | 0 | { |
468 | 0 | b_found = true; |
469 | 0 | break; |
470 | 0 | } |
471 | 0 | } |
472 | |
|
473 | 0 | if( !b_found && guidcmpbase(guid_tag, &waveformatex) ) |
474 | 0 | { |
475 | 0 | wf_tag_to_fourcc(guid_tag->Data1, fcc, ppsz_name); |
476 | 0 | } |
477 | 0 | else |
478 | 0 | { |
479 | 0 | if( fcc ) *fcc = sub_format_tag_to_fourcc[i].i_fourcc; |
480 | 0 | if( ppsz_name ) *ppsz_name = sub_format_tag_to_fourcc[i].psz_name; |
481 | 0 | } |
482 | 0 | } Unexecuted instantiation: asf.c:sf_tag_to_fourcc Unexecuted instantiation: libasf.c:sf_tag_to_fourcc Unexecuted instantiation: asfpacket.c:sf_tag_to_fourcc Unexecuted instantiation: avi.c:sf_tag_to_fourcc Unexecuted instantiation: libavi.c:sf_tag_to_fourcc Unexecuted instantiation: caf.c:sf_tag_to_fourcc Unexecuted instantiation: es.c:sf_tag_to_fourcc Unexecuted instantiation: mp4.c:sf_tag_to_fourcc Unexecuted instantiation: fragments.c:sf_tag_to_fourcc Unexecuted instantiation: attachments.c:sf_tag_to_fourcc Unexecuted instantiation: heif.c:sf_tag_to_fourcc Unexecuted instantiation: essetup.c:sf_tag_to_fourcc Unexecuted instantiation: meta.c:sf_tag_to_fourcc Unexecuted instantiation: libmp4.c:sf_tag_to_fourcc Unexecuted instantiation: wav.c:sf_tag_to_fourcc |
483 | | |
484 | | #endif /* "codecs.h" */ |