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 #include "media/base/video_decoder_config.h" | 5 #include "media/base/video_decoder_config.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
| 12 // The names come from src/third_party/ffmpeg/libavcodec/codec_desc.c |
| 13 const char* VideoCodecName(VideoCodec video_codec) { |
| 14 switch (video_codec) { |
| 15 case kUnknownVideoCodec: |
| 16 return "unknown"; |
| 17 case kCodecH264: |
| 18 return "h264"; |
| 19 case kCodecVC1: |
| 20 return "vc1"; |
| 21 case kCodecMPEG2: |
| 22 return "mpeg2video"; |
| 23 case kCodecMPEG4: |
| 24 return "mpeg4"; |
| 25 case kCodecTheora: |
| 26 return "theora"; |
| 27 case kCodecVP8: |
| 28 return "vp8"; |
| 29 case kCodecVP9: |
| 30 return "vp9"; |
| 31 default: |
| 32 NOTREACHED() << "Invalid VideoCodec: " << video_codec; |
| 33 return "unknown"; |
| 34 } |
| 35 } |
| 36 |
12 VideoDecoderConfig::VideoDecoderConfig() | 37 VideoDecoderConfig::VideoDecoderConfig() |
13 : codec_(kUnknownVideoCodec), | 38 : codec_(kUnknownVideoCodec), |
14 profile_(VIDEO_CODEC_PROFILE_UNKNOWN), | 39 profile_(VIDEO_CODEC_PROFILE_UNKNOWN), |
15 format_(VideoFrame::UNKNOWN), | 40 format_(VideoFrame::UNKNOWN), |
16 is_encrypted_(false) { | 41 is_encrypted_(false) { |
17 } | 42 } |
18 | 43 |
19 VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec, | 44 VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec, |
20 VideoCodecProfile profile, | 45 VideoCodecProfile profile, |
21 VideoFrame::Format format, | 46 VideoFrame::Format format, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 186 |
162 size_t VideoDecoderConfig::extra_data_size() const { | 187 size_t VideoDecoderConfig::extra_data_size() const { |
163 return extra_data_.size(); | 188 return extra_data_.size(); |
164 } | 189 } |
165 | 190 |
166 bool VideoDecoderConfig::is_encrypted() const { | 191 bool VideoDecoderConfig::is_encrypted() const { |
167 return is_encrypted_; | 192 return is_encrypted_; |
168 } | 193 } |
169 | 194 |
170 } // namespace media | 195 } // namespace media |
OLD | NEW |