Index: media/ffmpeg/ffmpeg_common.cc |
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc |
index 72323c7e3e68dface57fae46de5806dae3974eb5..de605a965e59097011691dff91763f0915307ad8 100644 |
--- a/media/ffmpeg/ffmpeg_common.cc |
+++ b/media/ffmpeg/ffmpeg_common.cc |
@@ -215,6 +215,30 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, |
} |
} |
+VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format) { |
+ switch (pixel_format) { |
+ case PIX_FMT_YUV422P: |
+ return VideoFrame::YV16; |
+ case PIX_FMT_YUV420P: |
+ return VideoFrame::YV12; |
+ default: |
+ NOTREACHED() << "Unsupported PixelFormat: " << pixel_format; |
+ } |
+ return VideoFrame::INVALID; |
+} |
+ |
+PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format) { |
+ switch (video_format) { |
+ case VideoFrame::YV16: |
scherkus (not reviewing)
2011/09/29 20:48:05
fix indentation
|
+ return PIX_FMT_YUV422P; |
+ case VideoFrame::YV12: |
+ return PIX_FMT_YUV420P; |
+ default: |
+ NOTREACHED() << "Unsupported VideoFrame Format: " << video_format; |
+ } |
+ return PIX_FMT_NONE; |
+} |
+ |
base::TimeDelta GetFrameDuration(AVStream* stream) { |
AVRational time_base = { stream->r_frame_rate.den, stream->r_frame_rate.num }; |
return ConvertFromTimeBase(time_base, 1); |