Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 VideoDecoderConfig* config); | 84 VideoDecoderConfig* config); |
| 85 void VideoDecoderConfigToAVCodecContext( | 85 void VideoDecoderConfigToAVCodecContext( |
| 86 const VideoDecoderConfig& config, | 86 const VideoDecoderConfig& config, |
| 87 AVCodecContext* codec_context); | 87 AVCodecContext* codec_context); |
| 88 | 88 |
| 89 // Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can | 89 // Converts FFmpeg's channel layout to chrome's ChannelLayout. |channels| can |
| 90 // be used when FFmpeg's channel layout is not informative in order to make a | 90 // be used when FFmpeg's channel layout is not informative in order to make a |
| 91 // good guess about the plausible channel layout based on number of channels. | 91 // good guess about the plausible channel layout based on number of channels. |
| 92 ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, | 92 ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, |
| 93 int channels); | 93 int channels); |
| 94 // Given the number of channels, return the best layout, | |
| 95 // or return CHANNEL_LAYOUT_UNSUPPORTED if there is no good match. | |
| 96 ChannelLayout GuessChannelLayout(int channels); | |
|
DaleCurtis
2013/03/07 02:41:39
Needs to be moved to channel_layout
Chris Rogers
2013/03/09 01:37:50
Done.
| |
| 94 | 97 |
| 95 // Converts FFmpeg's pixel formats to its corresponding supported video format. | 98 // Converts FFmpeg's pixel formats to its corresponding supported video format. |
| 96 VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format); | 99 VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format); |
| 97 | 100 |
| 98 // Converts video formats to its corresponding FFmpeg's pixel formats. | 101 // Converts video formats to its corresponding FFmpeg's pixel formats. |
| 99 PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format); | 102 PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format); |
| 100 | 103 |
| 101 // Converts an FFmpeg video codec ID into its corresponding supported codec id. | 104 // Converts an FFmpeg video codec ID into its corresponding supported codec id. |
| 102 VideoCodec CodecIDToVideoCodec(CodecID codec_id); | 105 VideoCodec CodecIDToVideoCodec(CodecID codec_id); |
| 103 | 106 |
| 104 // Converts an FFmpeg audio codec ID into its corresponding supported codec id. | 107 // Converts an FFmpeg audio codec ID into its corresponding supported codec id. |
| 105 AudioCodec CodecIDToAudioCodec(CodecID codec_id); | 108 AudioCodec CodecIDToAudioCodec(CodecID codec_id); |
| 106 | 109 |
| 107 } // namespace media | 110 } // namespace media |
| 108 | 111 |
| 109 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ | 112 #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ |
| OLD | NEW |