| Index: media/ffmpeg/ffmpeg_common.cc
|
| diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
|
| index 72323c7e3e68dface57fae46de5806dae3974eb5..680f46407c0abf5baa2d2154e3200c77c49bcc4e 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:
|
| + 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);
|
|
|