OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 5 #ifndef MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
6 #define MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 6 #define MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
7 | 7 |
8 // Used for FFmpeg error codes. | 8 // Used for FFmpeg error codes. |
9 #include <cerrno> | 9 #include <cerrno> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 AVCodecContext* codec_context); | 74 AVCodecContext* codec_context); |
75 | 75 |
76 VideoCodec CodecIDToVideoCodec(CodecID codec_id); | 76 VideoCodec CodecIDToVideoCodec(CodecID codec_id); |
77 CodecID VideoCodecToCodecID(VideoCodec video_codec); | 77 CodecID VideoCodecToCodecID(VideoCodec video_codec); |
78 | 78 |
79 // Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can | 79 // Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can |
80 // be used when FFmpeg's channel layout is not informative in order to make a | 80 // be used when FFmpeg's channel layout is not informative in order to make a |
81 // good guess about the plausible channel layout based on number of channels. | 81 // good guess about the plausible channel layout based on number of channels. |
82 ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, | 82 ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, |
83 int channels); | 83 int channels); |
84 // Converts FFmpeg's pixel formats to the corresponding supported video format. | |
scherkus (not reviewing)
2011/09/28 17:32:17
nit: add one blank line before this (in general co
shadi1
2011/09/29 18:31:03
Done.
shadi1
2011/09/29 18:31:03
Done.
| |
85 VideoFrame::Format PixFmtToVideoFormat(PixelFormat pix_fmt); | |
scherkus (not reviewing)
2011/09/28 17:32:17
nit: PixFmt -> PixelFormat
shadi1
2011/09/29 18:31:03
Done.
| |
84 | 86 |
85 // Calculates duration of one frame in the |stream| based on its frame rate. | 87 // Calculates duration of one frame in the |stream| based on its frame rate. |
86 base::TimeDelta GetFrameDuration(AVStream* stream); | 88 base::TimeDelta GetFrameDuration(AVStream* stream); |
87 | 89 |
88 // Get the timestamp of the next seek point after |timestamp|. | 90 // Get the timestamp of the next seek point after |timestamp|. |
89 // Returns true if a valid seek point was found after |timestamp| and | 91 // Returns true if a valid seek point was found after |timestamp| and |
90 // |seek_time| was set. Returns false if a seek point could not be | 92 // |seek_time| was set. Returns false if a seek point could not be |
91 // found or the parameters are invalid. | 93 // found or the parameters are invalid. |
92 MEDIA_EXPORT bool GetSeekTimeAfter(AVStream* stream, | 94 MEDIA_EXPORT bool GetSeekTimeAfter(AVStream* stream, |
93 const base::TimeDelta& timestamp, | 95 const base::TimeDelta& timestamp, |
(...skipping 24 matching lines...) Expand all Loading... | |
118 int GetNaturalHeight(AVStream* stream); | 120 int GetNaturalHeight(AVStream* stream); |
119 int GetNaturalWidth(AVStream* stream); | 121 int GetNaturalWidth(AVStream* stream); |
120 | 122 |
121 // Closes & destroys all AVStreams in the context and then closes & | 123 // Closes & destroys all AVStreams in the context and then closes & |
122 // destroys the AVFormatContext. | 124 // destroys the AVFormatContext. |
123 void DestroyAVFormatContext(AVFormatContext* format_context); | 125 void DestroyAVFormatContext(AVFormatContext* format_context); |
124 | 126 |
125 } // namespace media | 127 } // namespace media |
126 | 128 |
127 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 129 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
OLD | NEW |