| 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. |
| 400 #if defined(DISABLE_FFMPEG_VIDEO_DECODERS) |
| 401 if (codec == kCodecH264) |
| 402 profile = H264PROFILE_BASELINE; |
| 403 #endif |
| 404 |
| 397 gfx::Size natural_size = GetNaturalSize( | 405 gfx::Size natural_size = GetNaturalSize( |
| 398 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); | 406 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); |
| 399 | 407 |
| 400 if (record_stats) { | 408 if (record_stats) { |
| 401 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py | 409 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py |
| 402 // check for uma enum max usage, since we're abusing | 410 // check for uma enum max usage, since we're abusing |
| 403 // UMA_HISTOGRAM_ENUMERATION to report a discrete value. | 411 // UMA_HISTOGRAM_ENUMERATION to report a discrete value. |
| 404 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", | 412 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", |
| 405 stream->codec->color_range, | 413 stream->codec->color_range, |
| 406 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX | 414 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 return false; | 645 return false; |
| 638 | 646 |
| 639 *out = parsed_time; | 647 *out = parsed_time; |
| 640 return true; | 648 return true; |
| 641 } | 649 } |
| 642 | 650 |
| 643 return false; | 651 return false; |
| 644 } | 652 } |
| 645 | 653 |
| 646 } // namespace media | 654 } // namespace media |
| OLD | NEW |