Chromium Code Reviews| Index: media/base/container_names.h |
| diff --git a/media/base/container_names.h b/media/base/container_names.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0731c127a8f0b7de8e1062ad4e3a77ee612b62bd |
| --- /dev/null |
| +++ b/media/base/container_names.h |
| @@ -0,0 +1,273 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_BASE_CONTAINER_NAMES_H_ |
| +#define MEDIA_BASE_CONTAINER_NAMES_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "media/base/media_export.h" |
| + |
| +namespace media { |
| + |
| +// This is the complete set of possible input formats specified in the |
| +// 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.
|
| +enum FFmpegContainerName { |
| + CONTAINER_UNKNOWN, // unavailable |
| + CONTAINER_4XM, // 4X Technologies |
| + CONTAINER_AAC, // raw ADTS AAC (Advanced Audio Coding) |
| + CONTAINER_AC3, // raw AC-3 |
| + CONTAINER_EAC3, // raw E-AC-3 |
| + CONTAINER_ACT, // ACT Voice file format |
| + CONTAINER_ADX, // CRI ADX |
| + CONTAINER_AEA, // MD STUDIO audio |
| + CONTAINER_AFC, // AFC |
| + CONTAINER_AIFF, // Audio IFF |
| + CONTAINER_AMR, // 3GPP AMR |
| + CONTAINER_ANM, // Deluxe Paint Animation |
| + CONTAINER_APC, // CRYO APC |
| + CONTAINER_APE, // Monkey's Audio |
| + CONTAINER_AQTITLE, // AQTitle subtitles |
| + CONTAINER_ASF, // ASF (Advanced / Active Streaming Format) |
| + CONTAINER_ASS, // SSA (SubStation Alpha) subtitle |
| + CONTAINER_AST, // AST (Audio Stream) |
| + CONTAINER_AU, // Sun AU |
| + CONTAINER_AVI, // AVI (Audio Video Interleaved) |
| + CONTAINER_AVISYNTH, // AVISynth |
| + CONTAINER_AVR, // AVR (Audio Visual Research) |
| + CONTAINER_AVS, // AVS |
| + CONTAINER_BETHSOFTVID, // Bethesda Softworks VID |
| + CONTAINER_BFI, // Brute Force & Ignorance |
| + CONTAINER_BINK, // Bink |
| + CONTAINER_BIN, // Binary text |
| + CONTAINER_XBIN, // eXtended BINary text (XBIN) |
| + CONTAINER_ADF, // Artworx Data Format |
| + CONTAINER_IDF, // iCE Draw File |
| + CONTAINER_BIT, // G.729 BIT file format |
| + CONTAINER_BMV, // Discworld II BMV |
| + CONTAINER_BRSTM, // BRSTM (Binary Revolution Stream) |
| + CONTAINER_C93, // Interplay C93 |
| + CONTAINER_CAF, // Apple CAF (Core Audio Format) |
| + CONTAINER_CDG, // CD Graphics |
| + CONTAINER_CDXL, // Commodore CDXL video |
| + CONTAINER_CONCAT, // Virtual concatenation script |
| + CONTAINER_DAUD, // D-Cinema audio |
| + CONTAINER_DFA, // Chronomaster DFA |
| + CONTAINER_DSICIN, // Delphine Software International CIN |
| + CONTAINER_DTS, // raw DTS |
| + CONTAINER_DTSHD, // raw DTS-HD |
| + CONTAINER_DV, // DV (Digital Video) |
| + CONTAINER_DXA, // DXA |
| + CONTAINER_EA_CDATA, // Electronic Arts cdata |
| + CONTAINER_EA, // Electronic Arts Multimedia |
| + CONTAINER_EPAF, // Ensoniq Paris Audio File |
| + CONTAINER_FFM, // FFM (FFserver live feed) |
| + CONTAINER_FFMETADATA, // FFmpeg metadata in text |
| + CONTAINER_FILMSTRIP, // Adobe Filmstrip |
| + CONTAINER_FLAC, // raw FLAC |
| + CONTAINER_FLIC, // FLI/FLC/FLX animation |
| + CONTAINER_FLV, // FLV (Flash Video) |
| + CONTAINER_FRM, // Megalux Frame |
| + CONTAINER_G722, // raw G.722 |
| + CONTAINER_G723_1, // G.723.1 |
| + CONTAINER_G729, // G.729 raw format demuxer |
| + CONTAINER_GIF, // CompuServe Graphics Interchange Format (GIF) |
| + CONTAINER_GSM, // raw GSM |
| + CONTAINER_GXF, // GXF (General eXchange Format) |
| + CONTAINER_HLS, // Apple HTTP Live Streaming |
| + CONTAINER_ICO, // Microsoft Windows ICO |
| + CONTAINER_IDCIN, // id Cinematic |
| + CONTAINER_ROQ, // id RoQ |
| + CONTAINER_IFF, // IFF (Interchange File Format) |
| + CONTAINER_ILBC, // iLBC storage |
| + CONTAINER_IMAGE2, // image2 sequence |
| + CONTAINER_IMAGE2PIPE, // piped image2 sequence |
| + CONTAINER_INGENIENT, // raw Ingenient MJPEG |
| + CONTAINER_IPMOVIE, // Interplay MVE |
| + CONTAINER_IRCAM, // Berkeley/IRCAM/CARL Sound Format |
| + CONTAINER_ISS, // Funcom ISS |
| + CONTAINER_IV8, // IndigoVision 8000 video |
| + CONTAINER_IVF, // On2 IVF |
| + CONTAINER_JACOSUB, // JACOsub subtitle format |
| + CONTAINER_JV, // Bitmap Brothers JV |
| + CONTAINER_LIBMODPLUG, // ModPlug demuxer |
| + CONTAINER_LIBNUT, // NUT format |
| + CONTAINER_LMLM4, // raw lmlm4 |
| + CONTAINER_LOAS, // LOAS AudioSyncStream |
| + CONTAINER_LVF, // LVF |
| + CONTAINER_LXF, // VR native stream (LXF) |
| + CONTAINER_WEBM, // Matroska / WebM |
| + CONTAINER_MGSTS, // Metal Gear Solid: The Twin Snakes |
| + CONTAINER_MICRODVD, // MicroDVD subtitle format |
| + CONTAINER_MM, // American Laser Games MM |
| + CONTAINER_MMF, // Yamaha SMAF |
| + CONTAINER_MOV, // QuickTime / MOV |
| + CONTAINER_MP3, // MP2/3 (MPEG audio layer 2/3) |
| + CONTAINER_MPC8, // Musepack SV8 |
| + CONTAINER_MPC, // Musepack |
| + CONTAINER_MPEG, // MPEG-PS (MPEG-2 Program Stream) |
| + CONTAINER_VOBSUB, // VobSub subtitle format |
| + CONTAINER_MPEGTS, // MPEG-TS (MPEG-2 Transport Stream) |
| + CONTAINER_MPEGTSRAW, // raw MPEG-TS (MPEG-2 Transport Stream) |
| + CONTAINER_MPL2, // MPL2 subtitles |
| + CONTAINER_MPSUB, // MPlayer subtitles |
| + CONTAINER_MSNWCTCP, // MSN TCP Webcam stream |
| + CONTAINER_MTV, // MTV |
| + CONTAINER_MV, // Silicon Graphics Movie |
| + CONTAINER_MVI, // Motion Pixels MVI |
| + CONTAINER_MXF, // MXF (Material eXchange Format) |
| + CONTAINER_MXG, // MxPEG clip |
| + CONTAINER_NC, // NC camera feed |
| + CONTAINER_NISTSPHERE, // NIST SPeech HEader REsources |
| + CONTAINER_NSV, // Nullsoft Streaming Video |
| + CONTAINER_NUT, // NUT |
| + CONTAINER_NUV, // NuppelVideo |
| + CONTAINER_OGG, // Ogg |
| + CONTAINER_OMA, // Sony OpenMG audio |
| + CONTAINER_PAF, // Amazing Studio Packed Animation File |
| + CONTAINER_F64BE, // PCM 64-bit floating-point big-endian |
| + CONTAINER_F64LE, // PCM 64-bit floating-point little-endian |
| + CONTAINER_F32BE, // PCM 32-bit floating-point big-endian |
| + CONTAINER_F32LE, // PCM 32-bit floating-point little-endian |
| + CONTAINER_S32BE, // PCM signed 32-bit big-endian |
| + CONTAINER_S32LE, // PCM signed 32-bit little-endian |
| + CONTAINER_S24BE, // PCM signed 24-bit big-endian |
| + CONTAINER_S24LE, // PCM signed 24-bit little-endian |
| + CONTAINER_S16BE, // PCM signed 16-bit big-endian |
| + CONTAINER_S16LE, // PCM signed 16-bit little-endian |
| + CONTAINER_S8, // PCM signed 8-bit |
| + CONTAINER_U32BE, // PCM unsigned 32-bit big-endian |
| + CONTAINER_U32LE, // PCM unsigned 32-bit little-endian |
| + CONTAINER_U24BE, // PCM unsigned 24-bit big-endian |
| + CONTAINER_U24LE, // PCM unsigned 24-bit little-endian |
| + CONTAINER_U16BE, // PCM unsigned 16-bit big-endian |
| + CONTAINER_U16LE, // PCM unsigned 16-bit little-endian |
| + CONTAINER_U8, // PCM unsigned 8-bit |
| + CONTAINER_ALAW, // PCM A-law |
| + CONTAINER_MULAW, // PCM mu-law |
| + CONTAINER_PJS, // PJS (Phoenix Japanimation Society) subtitles |
| + CONTAINER_PMP, // Playstation Portable PMP |
| + CONTAINER_PSXSTR, // Sony Playstation STR |
| + CONTAINER_PVA, // TechnoTrend PVA |
| + CONTAINER_PVF, // PVF (Portable Voice Format) |
| + CONTAINER_QCP, // QCP |
| + CONTAINER_R3D, // REDCODE R3D |
| + CONTAINER_LATM, // raw LOAS/LATM |
| + CONTAINER_MLP, // raw MLP |
| + CONTAINER_TRUEHD, // raw TrueHD |
| + CONTAINER_SHN, // raw Shorten |
| + CONTAINER_RAWVIDEO, // raw video |
| + CONTAINER_REALTEXT, // RealText subtitle format |
| + CONTAINER_RL2, // RL2 |
| + CONTAINER_RM, // RealMedia |
| + CONTAINER_RDT, // RDT demuxer |
| + CONTAINER_RPL, // RPL / ARMovie |
| + CONTAINER_RSO, // Lego Mindstorms RSO |
| + CONTAINER_SDP, // SDP |
| + CONTAINER_RTP, // RTP input |
| + CONTAINER_RTSP, // RTSP input |
| + CONTAINER_SAMI, // SAMI subtitle format |
| + CONTAINER_SAP, // SAP input |
| + CONTAINER_SBG, // SBaGen binaural beats script |
| + CONTAINER_FILM_CPK, // Sega FILM / CPK |
| + CONTAINER_VMD, // Sierra VMD |
| + CONTAINER_SIFF, // Beam Software SIFF |
| + CONTAINER_SMK, // Smacker |
| + CONTAINER_SMJPEG, // Loki SDL MJPEG |
| + CONTAINER_SMUSH, // LucasArts Smush |
| + CONTAINER_SOL, // Sierra SOL |
| + CONTAINER_SOX, // SoX native |
| + CONTAINER_SPDIF, // IEC 61937 (compressed data in S/PDIF) |
| + CONTAINER_SRT, // SubRip subtitle |
| + CONTAINER_SUBVIEWER1, // SubViewer v1 subtitle format |
| + CONTAINER_SUBVIEWER, // SubViewer subtitle format |
| + CONTAINER_SWF, // SWF (ShockWave Flash) |
| + CONTAINER_TAK, // raw TAK |
| + CONTAINER_TEDCAPTIONS, // TED Talks captions |
| + CONTAINER_THP, // THP |
| + CONTAINER_TIERTEXSEQ, // Tiertex Limited SEQ |
| + CONTAINER_TMV, // 8088flex TMV |
| + CONTAINER_TTA, // TTA (True Audio) |
| + CONTAINER_TTY, // Tele-typewriter |
| + CONTAINER_TXD, // Renderware TeXture Dictionary |
| + CONTAINER_VC1TEST, // VC-1 test bitstream |
| + CONTAINER_VIVO, // Vivo |
| + CONTAINER_VOC, // Creative Voice |
| + CONTAINER_VPLAYER, // VPlayer subtitles |
| + CONTAINER_VQF, // NTT TwinVQ |
| + CONTAINER_WAV, // WAV / WAVE (Waveform Audio) |
| + CONTAINER_W64, // Sony Wave64 |
| + CONTAINER_WC3MOVIE, // Wing Commander III movie |
| + CONTAINER_WEBVTT, // WebVTT subtitle |
| + CONTAINER_WSAUD, // Westwood Studios audio |
| + CONTAINER_WSVQA, // Westwood Studios VQA |
| + CONTAINER_WTV, // Windows Television (WTV) |
| + CONTAINER_WV, // WavPack |
| + CONTAINER_XA, // Maxis XA |
| + CONTAINER_XMV, // Microsoft XMV |
| + CONTAINER_XWMA, // Microsoft xWMA |
| + CONTAINER_YOP, // Psygnosis YOP |
| + CONTAINER_YUV4MPEGPIPE, // YUV4MPEG pipe |
| + CONTAINER_MJPEG, // raw MJPEG video |
| + CONTAINER_VC1, // raw VC-1 |
| + CONTAINER_M4V, // raw MPEG-4 video |
| + CONTAINER_H264, // raw H.264 video |
| + CONTAINER_H261, // raw H.261 |
| + CONTAINER_H263, // raw H.263 |
| + CONTAINER_DIRAC, // raw Dirac |
| + CONTAINER_DNXHD, // raw DNxHD (SMPTE VC-3) |
| + CONTAINER_MPEGVIDEO, // raw MPEG video |
| + CONTAINER_CAVSVIDEO, // raw Chinese AVS (Audio Video Standard) |
| + CONTAINER_ALSA, // ALSA audio input |
| + CONTAINER_BKTR, // video grab |
| + CONTAINER_DSHOW, // DirectShow capture |
| + CONTAINER_DV1394, // DV1394 A/V grab |
| + CONTAINER_FBDEV, // Linux framebuffer |
| + CONTAINER_IEC61883, // libiec61883 (new DV1394) A/V input device |
| + CONTAINER_JACK, // JACK Audio Connection Kit |
| + CONTAINER_LAVFI, // Libavfilter virtual input device |
| + CONTAINER_LIBCDIO, // CD grabbing |
| + CONTAINER_LIBDC1394, // dc1394 v.1/v.2 A/V grab |
| + CONTAINER_OPENAL, // OpenAL audio capture device |
| + CONTAINER_OSS, // OSS (Open Sound System) capture |
| + CONTAINER_PULSE, // Pulse audio input |
| + CONTAINER_SNDIO, // sndio audio capture |
| + CONTAINER_V4L2, // Video4Linux2 device grab |
| + CONTAINER_V4L, // Video4Linux device grab |
| + CONTAINER_VFWCAP, // VfW video capture |
| + CONTAINER_X11GRAB, // X11grab |
| + CONTAINER_MAX // Must be last |
| +}; |
| + |
| +// Mapping of a ID to name |
| +typedef struct ContainerNameMapping { |
| + enum FFmpegContainerName id; |
| + const char* name; |
| +} 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.
|
| + |
| +class MEDIA_EXPORT ContainerNames { |
| + public: |
| + ContainerNames() {} |
| + ~ContainerNames() {} |
| + |
| + // Log the container based on the name returned by FFmpeg. |
| + void LogContainer(const char* container_name); |
| + |
| + // Log the container by examining the first part of the stream. |
| + void LogContainer(const uint8 buffer[], size_t buffer_size); |
| + |
| + // Mapping from the strings returned by FFmpeg to container ID. |
| + 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.
|
| + |
| + // Determine the container type |
| + enum FFmpegContainerName LookupContainer(const char* container_name); |
| + enum FFmpegContainerName LookupContainer(const uint8 buffer[], |
| + 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.
|
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(ContainerNames); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_CONTAINER_NAMES_H_ |