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 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 // Used for FFmpeg error codes. | 10 // Used for FFmpeg error codes. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include <libavutil/imgutils.h> | 45 #include <libavutil/imgutils.h> |
46 #include <libavutil/log.h> | 46 #include <libavutil/log.h> |
47 #include <libavutil/mathematics.h> | 47 #include <libavutil/mathematics.h> |
48 #include <libavutil/opt.h> | 48 #include <libavutil/opt.h> |
49 MSVC_POP_WARNING(); | 49 MSVC_POP_WARNING(); |
50 } // extern "C" | 50 } // extern "C" |
51 | 51 |
52 namespace media { | 52 namespace media { |
53 | 53 |
54 class AudioDecoderConfig; | 54 class AudioDecoderConfig; |
55 class EncryptionScheme; | |
56 class VideoDecoderConfig; | 55 class VideoDecoderConfig; |
57 | 56 |
58 // The following implement the deleters declared in ffmpeg_deleters.h (which | 57 // The following implement the deleters declared in ffmpeg_deleters.h (which |
59 // contains the declarations needed for use with |scoped_ptr| without #include | 58 // contains the declarations needed for use with |scoped_ptr| without #include |
60 // "pollution"). | 59 // "pollution"). |
61 | 60 |
62 inline void ScopedPtrAVFree::operator()(void* x) const { | 61 inline void ScopedPtrAVFree::operator()(void* x) const { |
63 av_free(x); | 62 av_free(x); |
64 } | 63 } |
65 | 64 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 VideoDecoderConfig* config); | 106 VideoDecoderConfig* config); |
108 void VideoDecoderConfigToAVCodecContext( | 107 void VideoDecoderConfigToAVCodecContext( |
109 const VideoDecoderConfig& config, | 108 const VideoDecoderConfig& config, |
110 AVCodecContext* codec_context); | 109 AVCodecContext* codec_context); |
111 | 110 |
112 // Returns true if AVCodecContext is successfully converted to an | 111 // Returns true if AVCodecContext is successfully converted to an |
113 // AudioDecoderConfig. Returns false if conversion fails, in which case |config| | 112 // AudioDecoderConfig. Returns false if conversion fails, in which case |config| |
114 // is not modified. | 113 // is not modified. |
115 MEDIA_EXPORT bool AVCodecContextToAudioDecoderConfig( | 114 MEDIA_EXPORT bool AVCodecContextToAudioDecoderConfig( |
116 const AVCodecContext* codec_context, | 115 const AVCodecContext* codec_context, |
117 const EncryptionScheme& encryption_scheme, | 116 bool is_encrypted, |
118 AudioDecoderConfig* config); | 117 AudioDecoderConfig* config); |
119 | 118 |
120 // Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can | 119 // Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can |
121 // be used when FFmpeg's channel layout is not informative in order to make a | 120 // be used when FFmpeg's channel layout is not informative in order to make a |
122 // good guess about the plausible channel layout based on number of channels. | 121 // good guess about the plausible channel layout based on number of channels. |
123 MEDIA_EXPORT ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, | 122 MEDIA_EXPORT ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, |
124 int channels); | 123 int channels); |
125 | 124 |
126 MEDIA_EXPORT AVCodecID AudioCodecToCodecID(AudioCodec audio_codec, | 125 MEDIA_EXPORT AVCodecID AudioCodecToCodecID(AudioCodec audio_codec, |
127 SampleFormat sample_format); | 126 SampleFormat sample_format); |
(...skipping 18 matching lines...) Expand all Loading... |
146 // date string. Otherwise returns fals and timeline_offset is unmodified. | 145 // date string. Otherwise returns fals and timeline_offset is unmodified. |
147 MEDIA_EXPORT bool FFmpegUTCDateToTime(const char* date_utc, base::Time* out); | 146 MEDIA_EXPORT bool FFmpegUTCDateToTime(const char* date_utc, base::Time* out); |
148 | 147 |
149 // Returns a 32-bit hash for the given codec name. See the VerifyUmaCodecHashes | 148 // Returns a 32-bit hash for the given codec name. See the VerifyUmaCodecHashes |
150 // unit test for more information and code for generating the histogram XML. | 149 // unit test for more information and code for generating the histogram XML. |
151 MEDIA_EXPORT int32_t HashCodecName(const char* codec_name); | 150 MEDIA_EXPORT int32_t HashCodecName(const char* codec_name); |
152 | 151 |
153 } // namespace media | 152 } // namespace media |
154 | 153 |
155 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 154 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
OLD | NEW |