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 #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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 profile = VP8PROFILE_MAIN; | 382 profile = VP8PROFILE_MAIN; |
| 383 else if (codec == kCodecVP9) | 383 else if (codec == kCodecVP9) |
| 384 profile = VP9PROFILE_MAIN; | 384 profile = VP9PROFILE_MAIN; |
| 385 else | 385 else |
| 386 profile = ProfileIDToVideoCodecProfile(stream->codec->profile); | 386 profile = ProfileIDToVideoCodecProfile(stream->codec->profile); |
| 387 | 387 |
| 388 gfx::Size natural_size = GetNaturalSize( | 388 gfx::Size natural_size = GetNaturalSize( |
| 389 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); | 389 visible_rect.size(), aspect_ratio.num, aspect_ratio.den); |
| 390 | 390 |
| 391 if (record_stats) { | 391 if (record_stats) { |
| 392 // Note the 'PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py | |
|
scherkus (not reviewing)
2014/02/25 03:44:49
nit: remove leading ' ... or did you mean to termi
| |
| 393 // check for uma enum max usage, since we're abusing | |
| 394 // UMA_HISTOGRAM_ENUMERATION to report a discrete value. | |
| 392 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", | 395 UMA_HISTOGRAM_ENUMERATION("Media.VideoColorRange", |
| 393 stream->codec->color_range, | 396 stream->codec->color_range, |
| 394 AVCOL_RANGE_NB); | 397 AVCOL_RANGE_NB); // PRESUBMIT_IGNORE_UMA_MAX |
| 395 } | 398 } |
| 396 | 399 |
| 397 VideoFrame::Format format = PixelFormatToVideoFormat(stream->codec->pix_fmt); | 400 VideoFrame::Format format = PixelFormatToVideoFormat(stream->codec->pix_fmt); |
| 398 if (codec == kCodecVP9) { | 401 if (codec == kCodecVP9) { |
| 399 // TODO(tomfinegan): libavcodec doesn't know about VP9. | 402 // TODO(tomfinegan): libavcodec doesn't know about VP9. |
| 400 format = VideoFrame::YV12; | 403 format = VideoFrame::YV12; |
| 401 coded_size = natural_size; | 404 coded_size = natural_size; |
| 402 } | 405 } |
| 403 | 406 |
| 404 bool is_encrypted = false; | 407 bool is_encrypted = false; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 return PIX_FMT_YUVJ420P; | 539 return PIX_FMT_YUVJ420P; |
| 537 case VideoFrame::YV12A: | 540 case VideoFrame::YV12A: |
| 538 return PIX_FMT_YUVA420P; | 541 return PIX_FMT_YUVA420P; |
| 539 default: | 542 default: |
| 540 DVLOG(1) << "Unsupported VideoFrame::Format: " << video_format; | 543 DVLOG(1) << "Unsupported VideoFrame::Format: " << video_format; |
| 541 } | 544 } |
| 542 return PIX_FMT_NONE; | 545 return PIX_FMT_NONE; |
| 543 } | 546 } |
| 544 | 547 |
| 545 } // namespace media | 548 } // namespace media |
| OLD | NEW |