OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Converts video formats to its corresponding FFmpeg's pixel formats. | 98 // Converts video formats to its corresponding FFmpeg's pixel formats. |
99 PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format); | 99 PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format); |
100 | 100 |
101 // Converts an FFmpeg video codec ID into its corresponding supported codec id. | 101 // Converts an FFmpeg video codec ID into its corresponding supported codec id. |
102 VideoCodec CodecIDToVideoCodec(CodecID codec_id); | 102 VideoCodec CodecIDToVideoCodec(CodecID codec_id); |
103 | 103 |
104 // Converts an FFmpeg audio codec ID into its corresponding supported codec id. | 104 // Converts an FFmpeg audio codec ID into its corresponding supported codec id. |
105 AudioCodec CodecIDToAudioCodec(CodecID codec_id); | 105 AudioCodec CodecIDToAudioCodec(CodecID codec_id); |
106 | 106 |
107 // Calculates the duration of one frame based on the frame rate specified by | |
108 // |config|. | |
109 base::TimeDelta GetFrameDuration(const VideoDecoderConfig& config); | |
110 | |
111 // Closes & destroys all AVStreams in the context and then closes & | 107 // Closes & destroys all AVStreams in the context and then closes & |
112 // destroys the AVFormatContext. | 108 // destroys the AVFormatContext. |
113 void DestroyAVFormatContext(AVFormatContext* format_context); | 109 void DestroyAVFormatContext(AVFormatContext* format_context); |
114 | 110 |
115 } // namespace media | 111 } // namespace media |
116 | 112 |
117 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 113 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
OLD | NEW |