summaryrefslogtreecommitdiffstats
path: root/media/ffmpeg/ffmpeg_common.cc
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-11 22:31:24 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-11 22:31:24 +0000
commit0b5f7e52bab18455a11ea763ae424f30755dc20f (patch)
treeddcfd55906e694285269a2bf683175d2320cab95 /media/ffmpeg/ffmpeg_common.cc
parent33cdc9b854044864f7494c23a21f78733a961236 (diff)
downloadchromium_src-0b5f7e52bab18455a11ea763ae424f30755dc20f.zip
chromium_src-0b5f7e52bab18455a11ea763ae424f30755dc20f.tar.gz
chromium_src-0b5f7e52bab18455a11ea763ae424f30755dc20f.tar.bz2
Remove FFmpegVideoDecodeEngine's dependency on AVStream (again).
First step of many towards removing DemuxerStream::QueryInterface, AVStreamProvider, and MediaFormat. This time without memory leaks! BUG=28206 TEST=media_unittests git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/ffmpeg/ffmpeg_common.cc')
-rw-r--r--media/ffmpeg/ffmpeg_common.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 244d2729..dce96a5 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -4,8 +4,50 @@
#include "media/ffmpeg/ffmpeg_common.h"
+#include "base/logging.h"
+
namespace media {
// TODO(scherkus): combine ffmpeg_common.h with ffmpeg_util.h
+VideoCodec CodecIDToVideoCodec(CodecID codec_id) {
+ switch (codec_id) {
+ case CODEC_ID_VC1:
+ return kCodecVC1;
+ case CODEC_ID_H264:
+ return kCodecH264;
+ case CODEC_ID_THEORA:
+ return kCodecTheora;
+ case CODEC_ID_MPEG2VIDEO:
+ return kCodecMPEG2;
+ case CODEC_ID_MPEG4:
+ return kCodecMPEG4;
+ case CODEC_ID_VP8:
+ return kCodecVP8;
+ default:
+ NOTREACHED();
+ }
+ return kUnknown;
+}
+
+CodecID VideoCodecToCodecID(VideoCodec video_codec) {
+ switch (video_codec) {
+ case kCodecVC1:
+ return CODEC_ID_VC1;
+ case kCodecH264:
+ return CODEC_ID_H264;
+ case kCodecTheora:
+ return CODEC_ID_THEORA;
+ case kCodecMPEG2:
+ return CODEC_ID_MPEG2VIDEO;
+ case kCodecMPEG4:
+ return CODEC_ID_MPEG4;
+ case kCodecVP8:
+ return CODEC_ID_VP8;
+ default:
+ NOTREACHED();
+ }
+ return CODEC_ID_NONE;
+}
+
} // namespace media