OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_BASE_CONTAINER_NAMES_H_ | |
6 #define MEDIA_BASE_CONTAINER_NAMES_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "media/base/media_export.h" | |
10 | |
11 namespace media { | |
12 | |
13 // This is the complete set of possible input formats specified in the | |
14 // FFmpeg code. Not all of these are enabled in FFmpeg. | |
xhwang
2013/04/29 21:00:25
Add a comment that this list must be in sync with
jrummell
2013/04/30 21:36:50
Done.
| |
15 enum FFmpegContainerName { | |
16 CONTAINER_UNKNOWN, // unavailable | |
17 CONTAINER_4XM, // 4X Technologies | |
18 CONTAINER_AAC, // raw ADTS AAC (Advanced Audio Coding) | |
19 CONTAINER_AC3, // raw AC-3 | |
20 CONTAINER_EAC3, // raw E-AC-3 | |
21 CONTAINER_ACT, // ACT Voice file format | |
22 CONTAINER_ADX, // CRI ADX | |
23 CONTAINER_AEA, // MD STUDIO audio | |
24 CONTAINER_AFC, // AFC | |
25 CONTAINER_AIFF, // Audio IFF | |
26 CONTAINER_AMR, // 3GPP AMR | |
27 CONTAINER_ANM, // Deluxe Paint Animation | |
28 CONTAINER_APC, // CRYO APC | |
29 CONTAINER_APE, // Monkey's Audio | |
30 CONTAINER_AQTITLE, // AQTitle subtitles | |
31 CONTAINER_ASF, // ASF (Advanced / Active Streaming Format) | |
32 CONTAINER_ASS, // SSA (SubStation Alpha) subtitle | |
33 CONTAINER_AST, // AST (Audio Stream) | |
34 CONTAINER_AU, // Sun AU | |
35 CONTAINER_AVI, // AVI (Audio Video Interleaved) | |
36 CONTAINER_AVISYNTH, // AVISynth | |
37 CONTAINER_AVR, // AVR (Audio Visual Research) | |
38 CONTAINER_AVS, // AVS | |
39 CONTAINER_BETHSOFTVID, // Bethesda Softworks VID | |
40 CONTAINER_BFI, // Brute Force & Ignorance | |
41 CONTAINER_BINK, // Bink | |
42 CONTAINER_BIN, // Binary text | |
43 CONTAINER_XBIN, // eXtended BINary text (XBIN) | |
44 CONTAINER_ADF, // Artworx Data Format | |
45 CONTAINER_IDF, // iCE Draw File | |
46 CONTAINER_BIT, // G.729 BIT file format | |
47 CONTAINER_BMV, // Discworld II BMV | |
48 CONTAINER_BRSTM, // BRSTM (Binary Revolution Stream) | |
49 CONTAINER_C93, // Interplay C93 | |
50 CONTAINER_CAF, // Apple CAF (Core Audio Format) | |
51 CONTAINER_CDG, // CD Graphics | |
52 CONTAINER_CDXL, // Commodore CDXL video | |
53 CONTAINER_CONCAT, // Virtual concatenation script | |
54 CONTAINER_DAUD, // D-Cinema audio | |
55 CONTAINER_DFA, // Chronomaster DFA | |
56 CONTAINER_DSICIN, // Delphine Software International CIN | |
57 CONTAINER_DTS, // raw DTS | |
58 CONTAINER_DTSHD, // raw DTS-HD | |
59 CONTAINER_DV, // DV (Digital Video) | |
60 CONTAINER_DXA, // DXA | |
61 CONTAINER_EA_CDATA, // Electronic Arts cdata | |
62 CONTAINER_EA, // Electronic Arts Multimedia | |
63 CONTAINER_EPAF, // Ensoniq Paris Audio File | |
64 CONTAINER_FFM, // FFM (FFserver live feed) | |
65 CONTAINER_FFMETADATA, // FFmpeg metadata in text | |
66 CONTAINER_FILMSTRIP, // Adobe Filmstrip | |
67 CONTAINER_FLAC, // raw FLAC | |
68 CONTAINER_FLIC, // FLI/FLC/FLX animation | |
69 CONTAINER_FLV, // FLV (Flash Video) | |
70 CONTAINER_FRM, // Megalux Frame | |
71 CONTAINER_G722, // raw G.722 | |
72 CONTAINER_G723_1, // G.723.1 | |
73 CONTAINER_G729, // G.729 raw format demuxer | |
74 CONTAINER_GIF, // CompuServe Graphics Interchange Format (GIF) | |
75 CONTAINER_GSM, // raw GSM | |
76 CONTAINER_GXF, // GXF (General eXchange Format) | |
77 CONTAINER_HLS, // Apple HTTP Live Streaming | |
78 CONTAINER_ICO, // Microsoft Windows ICO | |
79 CONTAINER_IDCIN, // id Cinematic | |
80 CONTAINER_ROQ, // id RoQ | |
81 CONTAINER_IFF, // IFF (Interchange File Format) | |
82 CONTAINER_ILBC, // iLBC storage | |
83 CONTAINER_IMAGE2, // image2 sequence | |
84 CONTAINER_IMAGE2PIPE, // piped image2 sequence | |
85 CONTAINER_INGENIENT, // raw Ingenient MJPEG | |
86 CONTAINER_IPMOVIE, // Interplay MVE | |
87 CONTAINER_IRCAM, // Berkeley/IRCAM/CARL Sound Format | |
88 CONTAINER_ISS, // Funcom ISS | |
89 CONTAINER_IV8, // IndigoVision 8000 video | |
90 CONTAINER_IVF, // On2 IVF | |
91 CONTAINER_JACOSUB, // JACOsub subtitle format | |
92 CONTAINER_JV, // Bitmap Brothers JV | |
93 CONTAINER_LIBMODPLUG, // ModPlug demuxer | |
94 CONTAINER_LIBNUT, // NUT format | |
95 CONTAINER_LMLM4, // raw lmlm4 | |
96 CONTAINER_LOAS, // LOAS AudioSyncStream | |
97 CONTAINER_LVF, // LVF | |
98 CONTAINER_LXF, // VR native stream (LXF) | |
99 CONTAINER_WEBM, // Matroska / WebM | |
100 CONTAINER_MGSTS, // Metal Gear Solid: The Twin Snakes | |
101 CONTAINER_MICRODVD, // MicroDVD subtitle format | |
102 CONTAINER_MM, // American Laser Games MM | |
103 CONTAINER_MMF, // Yamaha SMAF | |
104 CONTAINER_MOV, // QuickTime / MOV | |
105 CONTAINER_MP3, // MP2/3 (MPEG audio layer 2/3) | |
106 CONTAINER_MPC8, // Musepack SV8 | |
107 CONTAINER_MPC, // Musepack | |
108 CONTAINER_MPEG, // MPEG-PS (MPEG-2 Program Stream) | |
109 CONTAINER_VOBSUB, // VobSub subtitle format | |
110 CONTAINER_MPEGTS, // MPEG-TS (MPEG-2 Transport Stream) | |
111 CONTAINER_MPEGTSRAW, // raw MPEG-TS (MPEG-2 Transport Stream) | |
112 CONTAINER_MPL2, // MPL2 subtitles | |
113 CONTAINER_MPSUB, // MPlayer subtitles | |
114 CONTAINER_MSNWCTCP, // MSN TCP Webcam stream | |
115 CONTAINER_MTV, // MTV | |
116 CONTAINER_MV, // Silicon Graphics Movie | |
117 CONTAINER_MVI, // Motion Pixels MVI | |
118 CONTAINER_MXF, // MXF (Material eXchange Format) | |
119 CONTAINER_MXG, // MxPEG clip | |
120 CONTAINER_NC, // NC camera feed | |
121 CONTAINER_NISTSPHERE, // NIST SPeech HEader REsources | |
122 CONTAINER_NSV, // Nullsoft Streaming Video | |
123 CONTAINER_NUT, // NUT | |
124 CONTAINER_NUV, // NuppelVideo | |
125 CONTAINER_OGG, // Ogg | |
126 CONTAINER_OMA, // Sony OpenMG audio | |
127 CONTAINER_PAF, // Amazing Studio Packed Animation File | |
128 CONTAINER_F64BE, // PCM 64-bit floating-point big-endian | |
129 CONTAINER_F64LE, // PCM 64-bit floating-point little-endian | |
130 CONTAINER_F32BE, // PCM 32-bit floating-point big-endian | |
131 CONTAINER_F32LE, // PCM 32-bit floating-point little-endian | |
132 CONTAINER_S32BE, // PCM signed 32-bit big-endian | |
133 CONTAINER_S32LE, // PCM signed 32-bit little-endian | |
134 CONTAINER_S24BE, // PCM signed 24-bit big-endian | |
135 CONTAINER_S24LE, // PCM signed 24-bit little-endian | |
136 CONTAINER_S16BE, // PCM signed 16-bit big-endian | |
137 CONTAINER_S16LE, // PCM signed 16-bit little-endian | |
138 CONTAINER_S8, // PCM signed 8-bit | |
139 CONTAINER_U32BE, // PCM unsigned 32-bit big-endian | |
140 CONTAINER_U32LE, // PCM unsigned 32-bit little-endian | |
141 CONTAINER_U24BE, // PCM unsigned 24-bit big-endian | |
142 CONTAINER_U24LE, // PCM unsigned 24-bit little-endian | |
143 CONTAINER_U16BE, // PCM unsigned 16-bit big-endian | |
144 CONTAINER_U16LE, // PCM unsigned 16-bit little-endian | |
145 CONTAINER_U8, // PCM unsigned 8-bit | |
146 CONTAINER_ALAW, // PCM A-law | |
147 CONTAINER_MULAW, // PCM mu-law | |
148 CONTAINER_PJS, // PJS (Phoenix Japanimation Society) subtitles | |
149 CONTAINER_PMP, // Playstation Portable PMP | |
150 CONTAINER_PSXSTR, // Sony Playstation STR | |
151 CONTAINER_PVA, // TechnoTrend PVA | |
152 CONTAINER_PVF, // PVF (Portable Voice Format) | |
153 CONTAINER_QCP, // QCP | |
154 CONTAINER_R3D, // REDCODE R3D | |
155 CONTAINER_LATM, // raw LOAS/LATM | |
156 CONTAINER_MLP, // raw MLP | |
157 CONTAINER_TRUEHD, // raw TrueHD | |
158 CONTAINER_SHN, // raw Shorten | |
159 CONTAINER_RAWVIDEO, // raw video | |
160 CONTAINER_REALTEXT, // RealText subtitle format | |
161 CONTAINER_RL2, // RL2 | |
162 CONTAINER_RM, // RealMedia | |
163 CONTAINER_RDT, // RDT demuxer | |
164 CONTAINER_RPL, // RPL / ARMovie | |
165 CONTAINER_RSO, // Lego Mindstorms RSO | |
166 CONTAINER_SDP, // SDP | |
167 CONTAINER_RTP, // RTP input | |
168 CONTAINER_RTSP, // RTSP input | |
169 CONTAINER_SAMI, // SAMI subtitle format | |
170 CONTAINER_SAP, // SAP input | |
171 CONTAINER_SBG, // SBaGen binaural beats script | |
172 CONTAINER_FILM_CPK, // Sega FILM / CPK | |
173 CONTAINER_VMD, // Sierra VMD | |
174 CONTAINER_SIFF, // Beam Software SIFF | |
175 CONTAINER_SMK, // Smacker | |
176 CONTAINER_SMJPEG, // Loki SDL MJPEG | |
177 CONTAINER_SMUSH, // LucasArts Smush | |
178 CONTAINER_SOL, // Sierra SOL | |
179 CONTAINER_SOX, // SoX native | |
180 CONTAINER_SPDIF, // IEC 61937 (compressed data in S/PDIF) | |
181 CONTAINER_SRT, // SubRip subtitle | |
182 CONTAINER_SUBVIEWER1, // SubViewer v1 subtitle format | |
183 CONTAINER_SUBVIEWER, // SubViewer subtitle format | |
184 CONTAINER_SWF, // SWF (ShockWave Flash) | |
185 CONTAINER_TAK, // raw TAK | |
186 CONTAINER_TEDCAPTIONS, // TED Talks captions | |
187 CONTAINER_THP, // THP | |
188 CONTAINER_TIERTEXSEQ, // Tiertex Limited SEQ | |
189 CONTAINER_TMV, // 8088flex TMV | |
190 CONTAINER_TTA, // TTA (True Audio) | |
191 CONTAINER_TTY, // Tele-typewriter | |
192 CONTAINER_TXD, // Renderware TeXture Dictionary | |
193 CONTAINER_VC1TEST, // VC-1 test bitstream | |
194 CONTAINER_VIVO, // Vivo | |
195 CONTAINER_VOC, // Creative Voice | |
196 CONTAINER_VPLAYER, // VPlayer subtitles | |
197 CONTAINER_VQF, // NTT TwinVQ | |
198 CONTAINER_WAV, // WAV / WAVE (Waveform Audio) | |
199 CONTAINER_W64, // Sony Wave64 | |
200 CONTAINER_WC3MOVIE, // Wing Commander III movie | |
201 CONTAINER_WEBVTT, // WebVTT subtitle | |
202 CONTAINER_WSAUD, // Westwood Studios audio | |
203 CONTAINER_WSVQA, // Westwood Studios VQA | |
204 CONTAINER_WTV, // Windows Television (WTV) | |
205 CONTAINER_WV, // WavPack | |
206 CONTAINER_XA, // Maxis XA | |
207 CONTAINER_XMV, // Microsoft XMV | |
208 CONTAINER_XWMA, // Microsoft xWMA | |
209 CONTAINER_YOP, // Psygnosis YOP | |
210 CONTAINER_YUV4MPEGPIPE, // YUV4MPEG pipe | |
211 CONTAINER_MJPEG, // raw MJPEG video | |
212 CONTAINER_VC1, // raw VC-1 | |
213 CONTAINER_M4V, // raw MPEG-4 video | |
214 CONTAINER_H264, // raw H.264 video | |
215 CONTAINER_H261, // raw H.261 | |
216 CONTAINER_H263, // raw H.263 | |
217 CONTAINER_DIRAC, // raw Dirac | |
218 CONTAINER_DNXHD, // raw DNxHD (SMPTE VC-3) | |
219 CONTAINER_MPEGVIDEO, // raw MPEG video | |
220 CONTAINER_CAVSVIDEO, // raw Chinese AVS (Audio Video Standard) | |
221 CONTAINER_ALSA, // ALSA audio input | |
222 CONTAINER_BKTR, // video grab | |
223 CONTAINER_DSHOW, // DirectShow capture | |
224 CONTAINER_DV1394, // DV1394 A/V grab | |
225 CONTAINER_FBDEV, // Linux framebuffer | |
226 CONTAINER_IEC61883, // libiec61883 (new DV1394) A/V input device | |
227 CONTAINER_JACK, // JACK Audio Connection Kit | |
228 CONTAINER_LAVFI, // Libavfilter virtual input device | |
229 CONTAINER_LIBCDIO, // CD grabbing | |
230 CONTAINER_LIBDC1394, // dc1394 v.1/v.2 A/V grab | |
231 CONTAINER_OPENAL, // OpenAL audio capture device | |
232 CONTAINER_OSS, // OSS (Open Sound System) capture | |
233 CONTAINER_PULSE, // Pulse audio input | |
234 CONTAINER_SNDIO, // sndio audio capture | |
235 CONTAINER_V4L2, // Video4Linux2 device grab | |
236 CONTAINER_V4L, // Video4Linux device grab | |
237 CONTAINER_VFWCAP, // VfW video capture | |
238 CONTAINER_X11GRAB, // X11grab | |
239 CONTAINER_MAX // Must be last | |
240 }; | |
241 | |
242 // Mapping of a ID to name | |
243 typedef struct ContainerNameMapping { | |
244 enum FFmpegContainerName id; | |
245 const char* name; | |
246 } ContainerNameMapping; | |
Ilya Sherman
2013/04/29 23:48:06
nit: No need for typedef nor the second instance o
jrummell
2013/04/30 21:36:50
Done.
| |
247 | |
248 class MEDIA_EXPORT ContainerNames { | |
249 public: | |
250 ContainerNames() {} | |
251 ~ContainerNames() {} | |
252 | |
253 // Log the container based on the name returned by FFmpeg. | |
254 void LogContainer(const char* container_name); | |
255 | |
256 // Log the container by examining the first part of the stream. | |
257 void LogContainer(const uint8 buffer[], size_t buffer_size); | |
258 | |
259 // Mapping from the strings returned by FFmpeg to container ID. | |
260 static const ContainerNameMapping container_name_mapping[215]; | |
xhwang
2013/04/29 21:00:25
215 seems a magic number? Is it CONTAINER_MAX?
xhwang
2013/04/29 21:00:25
Hide this as a file scope constant in the .cc file
jrummell
2013/04/30 21:36:50
It's the actual array size. Since the tests need a
jrummell
2013/04/30 21:36:50
The mapping needs to be accessed by the test code.
| |
261 | |
262 // Determine the container type | |
263 enum FFmpegContainerName LookupContainer(const char* container_name); | |
264 enum FFmpegContainerName LookupContainer(const uint8 buffer[], | |
265 size_t buffer_size); | |
xhwang
2013/04/29 21:00:25
We discourage the use of function overloading: htt
jrummell
2013/04/30 21:36:50
Done.
| |
266 | |
267 private: | |
268 DISALLOW_COPY_AND_ASSIGN(ContainerNames); | |
269 }; | |
270 | |
271 } // namespace media | |
272 | |
273 #endif // MEDIA_BASE_CONTAINER_NAMES_H_ | |
OLD | NEW |