| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 MEDIA_EXPORT base::TimeDelta ConvertFromTimeBase(const AVRational& time_base, | 65 MEDIA_EXPORT base::TimeDelta ConvertFromTimeBase(const AVRational& time_base, |
| 66 int64 timestamp); | 66 int64 timestamp); |
| 67 | 67 |
| 68 // Converts a base::TimeDelta into an int64 timestamp in |time_base| units. | 68 // Converts a base::TimeDelta into an int64 timestamp in |time_base| units. |
| 69 // For example if |timestamp| is 0.5 seconds and |time_base| is {1, 44100}, then | 69 // For example if |timestamp| is 0.5 seconds and |time_base| is {1, 44100}, then |
| 70 // the return value will be 22050 since that is how many 1/44100ths of a second | 70 // the return value will be 22050 since that is how many 1/44100ths of a second |
| 71 // represent 0.5 seconds. | 71 // represent 0.5 seconds. |
| 72 MEDIA_EXPORT int64 ConvertToTimeBase(const AVRational& time_base, | 72 MEDIA_EXPORT int64 ConvertToTimeBase(const AVRational& time_base, |
| 73 const base::TimeDelta& timestamp); | 73 const base::TimeDelta& timestamp); |
| 74 | 74 |
| 75 void AVCodecContextToAudioDecoderConfig( | 75 void AVStreamToAudioDecoderConfig( |
| 76 const AVCodecContext* codec_context, | 76 const AVStream* stream, |
| 77 AudioDecoderConfig* config); | 77 AudioDecoderConfig* config); |
| 78 void AudioDecoderConfigToAVCodecContext( | 78 void AudioDecoderConfigToAVCodecContext( |
| 79 const AudioDecoderConfig& config, | 79 const AudioDecoderConfig& config, |
| 80 AVCodecContext* codec_context); | 80 AVCodecContext* codec_context); |
| 81 | 81 |
| 82 void AVStreamToVideoDecoderConfig( | 82 void AVStreamToVideoDecoderConfig( |
| 83 const AVStream* stream, | 83 const AVStream* stream, |
| 84 VideoDecoderConfig* config); | 84 VideoDecoderConfig* config); |
| 85 void VideoDecoderConfigToAVCodecContext( | 85 void VideoDecoderConfigToAVCodecContext( |
| 86 const VideoDecoderConfig& config, | 86 const VideoDecoderConfig& config, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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 } // namespace media | 107 } // namespace media |
| 108 | 108 |
| 109 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 109 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
| OLD | NEW |