| 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/filters/ffmpeg_demuxer.h" | 5 #include "media/filters/ffmpeg_demuxer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 GetCodecName(video_config.codec())); | 154 GetCodecName(video_config.codec())); |
| 155 | 155 |
| 156 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", video_config.codec(), | 156 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", video_config.codec(), |
| 157 kVideoCodecMax + 1); | 157 kVideoCodecMax + 1); |
| 158 | 158 |
| 159 // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1. | 159 // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1. |
| 160 if (video_config.profile() >= 0) { | 160 if (video_config.profile() >= 0) { |
| 161 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodecProfile", video_config.profile(), | 161 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodecProfile", video_config.profile(), |
| 162 VIDEO_CODEC_PROFILE_MAX + 1); | 162 VIDEO_CODEC_PROFILE_MAX + 1); |
| 163 } | 163 } |
| 164 UMA_HISTOGRAM_COUNTS_10000("Media.VideoCodedWidth", | |
| 165 video_config.coded_size().width()); | |
| 166 UmaHistogramAspectRatio("Media.VideoCodedAspectRatio", | |
| 167 video_config.coded_size()); | |
| 168 UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", | 164 UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", |
| 169 video_config.visible_rect().width()); | 165 video_config.visible_rect().width()); |
| 170 UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", | 166 UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", |
| 171 video_config.visible_rect()); | 167 video_config.visible_rect()); |
| 172 UMA_HISTOGRAM_ENUMERATION("Media.VideoPixelFormatUnion", | 168 UMA_HISTOGRAM_ENUMERATION("Media.VideoPixelFormatUnion", |
| 173 video_config.format(), PIXEL_FORMAT_MAX + 1); | 169 video_config.format(), PIXEL_FORMAT_MAX + 1); |
| 174 UMA_HISTOGRAM_ENUMERATION("Media.VideoFrameColorSpace", | 170 UMA_HISTOGRAM_ENUMERATION("Media.VideoFrameColorSpace", |
| 175 video_config.color_space(), COLOR_SPACE_MAX + 1); | 171 video_config.color_space(), COLOR_SPACE_MAX + 1); |
| 176 | 172 |
| 177 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py | 173 // Note the PRESUBMIT_IGNORE_UMA_MAX below, this silences the PRESUBMIT.py |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 } else if (stream->type() == DemuxerStream::VIDEO) { | 1498 } else if (stream->type() == DemuxerStream::VIDEO) { |
| 1503 ++video_track_count; | 1499 ++video_track_count; |
| 1504 std::string suffix = ""; | 1500 std::string suffix = ""; |
| 1505 if (video_track_count > 1) | 1501 if (video_track_count > 1) |
| 1506 suffix = "_track" + base::IntToString(video_track_count); | 1502 suffix = "_track" + base::IntToString(video_track_count); |
| 1507 const AVCodecContext* video_codec = avctx->streams[i]->codec; | 1503 const AVCodecContext* video_codec = avctx->streams[i]->codec; |
| 1508 const VideoDecoderConfig& video_config = stream->video_decoder_config(); | 1504 const VideoDecoderConfig& video_config = stream->video_decoder_config(); |
| 1509 params.SetString("video_codec_name" + suffix, GetCodecName(video_codec)); | 1505 params.SetString("video_codec_name" + suffix, GetCodecName(video_codec)); |
| 1510 params.SetInteger("width" + suffix, video_codec->width); | 1506 params.SetInteger("width" + suffix, video_codec->width); |
| 1511 params.SetInteger("height" + suffix, video_codec->height); | 1507 params.SetInteger("height" + suffix, video_codec->height); |
| 1512 params.SetInteger("coded_width" + suffix, video_codec->coded_width); | |
| 1513 params.SetInteger("coded_height" + suffix, video_codec->coded_height); | |
| 1514 params.SetString("time_base" + suffix, | 1508 params.SetString("time_base" + suffix, |
| 1515 base::StringPrintf("%d/%d", video_codec->time_base.num, | 1509 base::StringPrintf("%d/%d", video_codec->time_base.num, |
| 1516 video_codec->time_base.den)); | 1510 video_codec->time_base.den)); |
| 1517 params.SetString("video_format" + suffix, | 1511 params.SetString("video_format" + suffix, |
| 1518 VideoPixelFormatToString(video_config.format())); | 1512 VideoPixelFormatToString(video_config.format())); |
| 1519 params.SetBoolean("video_is_encrypted" + suffix, | 1513 params.SetBoolean("video_is_encrypted" + suffix, |
| 1520 video_config.is_encrypted()); | 1514 video_config.is_encrypted()); |
| 1521 } | 1515 } |
| 1522 } | 1516 } |
| 1523 params.SetBoolean("found_audio_stream", (audio_track_count > 0)); | 1517 params.SetBoolean("found_audio_stream", (audio_track_count > 0)); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1788 | 1782 |
| 1789 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1783 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
| 1790 DCHECK(task_runner_->BelongsToCurrentThread()); | 1784 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 1791 for (const auto& stream : streams_) { | 1785 for (const auto& stream : streams_) { |
| 1792 if (stream) | 1786 if (stream) |
| 1793 stream->SetLiveness(liveness); | 1787 stream->SetLiveness(liveness); |
| 1794 } | 1788 } |
| 1795 } | 1789 } |
| 1796 | 1790 |
| 1797 } // namespace media | 1791 } // namespace media |
| OLD | NEW |