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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id); | 387 VideoCodec codec = CodecIDToVideoCodec(stream->codec->codec_id); |
388 | 388 |
389 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; | 389 VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
390 if (codec == kCodecVP8) | 390 if (codec == kCodecVP8) |
391 profile = VP8PROFILE_ANY; | 391 profile = VP8PROFILE_ANY; |
392 else if (codec == kCodecVP9) | 392 else if (codec == kCodecVP9) |
393 profile = VP9PROFILE_ANY; | 393 profile = VP9PROFILE_ANY; |
394 else | 394 else |
395 profile = ProfileIDToVideoCodecProfile(stream->codec->profile); | 395 profile = ProfileIDToVideoCodecProfile(stream->codec->profile); |
396 | 396 |
| 397 // Without the FFmpeg h264 decoder, AVFormat is unable to get the profile, so |
| 398 // default to baseline and let the VDA fail later if it doesn't support the |
| 399 // real profile. This is alright because if the FFmpeg h264 decoder isn't |
| 400 // enabled, there is no fallback if the VDA fails. |
| 401 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS) |
| 402 if (codec == kCodecH264) |
| 403 profile = H264PROFILE_BASELINE; |
| 404 #endif |
| 405 |
397 gfx::Size natural_size = GetNaturalSize( | 406 gfx::Size natural_size = GetNaturalSize( |
398 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); | 407 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); |
399 | 408 |
400 if (record_stats) { | 409 if (record_stats) { |
401 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py | 410 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py |
402 // check for uma enum max usage, since we're abusing | 411 // check for uma enum max usage, since we're abusing |
403 // UMA_HISTOGRAM_ENUMERATION to report a discrete value. | 412 // UMA_HISTOGRAM_ENUMERATION to report a discrete value. |
404 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", | 413 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", |
405 stream->codec->color_range, | 414 stream->codec->color_range, |
406 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX | 415 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 return false; | 646 return false; |
638 | 647 |
639 *out = parsed_time; | 648 *out = parsed_time; |
640 return true; | 649 return true; |
641 } | 650 } |
642 | 651 |
643 return false; | 652 return false; |
644 } | 653 } |
645 | 654 |
646 } // namespace media | 655 } // namespace media |
OLD | NEW |