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/ffmpeg/ffmpeg_common.h" | 5 #include "media/ffmpeg/ffmpeg_common.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 case kSampleFormatPlanarS16: | 263 case kSampleFormatPlanarS16: |
264 return AV_SAMPLE_FMT_S16P; | 264 return AV_SAMPLE_FMT_S16P; |
265 case kSampleFormatPlanarF32: | 265 case kSampleFormatPlanarF32: |
266 return AV_SAMPLE_FMT_FLTP; | 266 return AV_SAMPLE_FMT_FLTP; |
267 default: | 267 default: |
268 DVLOG(1) << "Unknown SampleFormat: " << sample_format; | 268 DVLOG(1) << "Unknown SampleFormat: " << sample_format; |
269 } | 269 } |
270 return AV_SAMPLE_FMT_NONE; | 270 return AV_SAMPLE_FMT_NONE; |
271 } | 271 } |
272 | 272 |
273 static void AVCodecContextToAudioDecoderConfig( | 273 void AVCodecContextToAudioDecoderConfig( |
274 const AVCodecContext* codec_context, | 274 const AVCodecContext* codec_context, |
275 bool is_encrypted, | 275 bool is_encrypted, |
276 AudioDecoderConfig* config, | 276 AudioDecoderConfig* config, |
277 bool record_stats) { | 277 bool record_stats) { |
278 DCHECK_EQ(codec_context->codec_type, AVMEDIA_TYPE_AUDIO); | 278 DCHECK_EQ(codec_context->codec_type, AVMEDIA_TYPE_AUDIO); |
279 | 279 |
280 AudioCodec codec = CodecIDToAudioCodec(codec_context->codec_id); | 280 AudioCodec codec = CodecIDToAudioCodec(codec_context->codec_id); |
281 | 281 |
282 SampleFormat sample_format = | 282 SampleFormat sample_format = |
283 AVSampleFormatToSampleFormat(codec_context->sample_fmt); | 283 AVSampleFormatToSampleFormat(codec_context->sample_fmt); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 return false; | 572 return false; |
573 | 573 |
574 *out = parsed_time; | 574 *out = parsed_time; |
575 return true; | 575 return true; |
576 } | 576 } |
577 | 577 |
578 return false; | 578 return false; |
579 } | 579 } |
580 | 580 |
581 } // namespace media | 581 } // namespace media |
OLD | NEW |