Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: media/ffmpeg/ffmpeg_common.h

Issue 8341033: Remove DemuxerStream::GetAVStream() once and for all. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/ffmpeg/ffmpeg_common.h
diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
index 8808f45068578961e9222f847deaa3d4efa1d406..555018176d74119c6ad0a9693715c078a14eecc4 100644
--- a/media/ffmpeg/ffmpeg_common.h
+++ b/media/ffmpeg/ffmpeg_common.h
@@ -74,8 +74,14 @@ void AudioDecoderConfigToAVCodecContext(
const AudioDecoderConfig& config,
AVCodecContext* codec_context);
-VideoCodec CodecIDToVideoCodec(CodecID codec_id);
-CodecID VideoCodecToCodecID(VideoCodec video_codec);
+void AVCodecContextToVideoDecoderConfig(
scherkus (not reviewing) 2011/10/25 22:42:15 I wonder whether this should be AVStreamToVideoDec
acolwell GONE FROM CHROMIUM 2011/10/26 17:09:13 If we are only likely to call this from contexts w
scherkus (not reviewing) 2011/10/26 19:08:00 Done.
+ const AVCodecContext* codec_context,
+ const AVRational& frame_rate,
+ const AVRational& aspect_ratio,
+ VideoDecoderConfig* config);
+void VideoDecoderConfigToAVCodecContext(
+ const VideoDecoderConfig& config,
+ AVCodecContext* codec_context);
// Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can
// be used when FFmpeg's channel layout is not informative in order to make a
@@ -89,12 +95,16 @@ VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format);
// Converts video formats to its corresponding FFmpeg's pixel formats.
PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format);
-// Calculates duration of one frame in the |stream| based on its frame rate.
-base::TimeDelta GetFrameDuration(AVStream* stream);
+// Calculates the duration of one frame based on the frame rate specified by
+// |config|.
+base::TimeDelta GetFrameDuration(const VideoDecoderConfig& config);
scherkus (not reviewing) 2011/10/25 22:42:15 should this be a method on VideoDecoderConfig? I'
acolwell GONE FROM CHROMIUM 2011/10/26 17:09:13 Yes.
+
+// Returns the aspect ratio based on the information contained inside |stream|.
+AVRational GetAspectRatio(AVStream* stream);
// Calculates the natural width and height of the video using the video's
-// encoded dimensions and sample_aspect_ratio.
-gfx::Size GetNaturalSize(AVStream* stream);
+// encoded dimensions and aspect ratio.
+gfx::Size GetNaturalSize(const VideoDecoderConfig& config);
scherkus (not reviewing) 2011/10/25 22:42:15 ditto here due to av_q2d()
acolwell GONE FROM CHROMIUM 2011/10/26 17:09:13 ditto
// Closes & destroys all AVStreams in the context and then closes &
// destroys the AVFormatContext.

Powered by Google App Engine
This is Rietveld 408576698