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/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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 if (ToAudioSampleRate(audio_config.samples_per_second(), &asr)) { | 153 if (ToAudioSampleRate(audio_config.samples_per_second(), &asr)) { |
| 154 UMA_HISTOGRAM_ENUMERATION("Media.AudioSamplesPerSecond", asr, | 154 UMA_HISTOGRAM_ENUMERATION("Media.AudioSamplesPerSecond", asr, |
| 155 kAudioSampleRateMax + 1); | 155 kAudioSampleRateMax + 1); |
| 156 } else { | 156 } else { |
| 157 UMA_HISTOGRAM_COUNTS("Media.AudioSamplesPerSecondUnexpected", | 157 UMA_HISTOGRAM_COUNTS("Media.AudioSamplesPerSecondUnexpected", |
| 158 audio_config.samples_per_second()); | 158 audio_config.samples_per_second()); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Record video decoder config UMA stats corresponding to a src= playback. | 162 // Record video decoder config UMA stats corresponding to a src= playback. |
| 163 static void RecordVideoCodecStats(const VideoDecoderConfig& video_config, | 163 static void RecordVideoCodecStats(container_names::MediaContainerName container, |
| 164 const VideoDecoderConfig& video_config, | |
| 164 AVColorRange color_range, | 165 AVColorRange color_range, |
| 165 MediaLog* media_log) { | 166 MediaLog* media_log) { |
| 166 media_log->RecordRapporWithSecurityOrigin("Media.OriginUrl.SRC.VideoCodec." + | 167 media_log->RecordRapporWithSecurityOrigin("Media.OriginUrl.SRC.VideoCodec." + |
| 167 GetCodecName(video_config.codec())); | 168 GetCodecName(video_config.codec())); |
| 168 | 169 |
| 169 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", video_config.codec(), | 170 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", video_config.codec(), |
| 170 kVideoCodecMax + 1); | 171 kVideoCodecMax + 1); |
| 172 if (container == container_names::CONTAINER_MOV) { | |
|
DaleCurtis
2017/04/27 21:51:02
There are a few other usages of the iformat.name i
kqyang
2017/04/27 22:04:57
Done.
| |
| 173 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec.MP4", video_config.codec(), | |
| 174 kVideoCodecMax + 1); | |
| 175 } else if (container == container_names::CONTAINER_WEBM) { | |
| 176 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec.WebM", video_config.codec(), | |
| 177 kVideoCodecMax + 1); | |
| 178 } | |
| 171 | 179 |
| 172 // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1. | 180 // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1. |
| 173 if (video_config.profile() >= 0) { | 181 if (video_config.profile() >= 0) { |
| 174 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodecProfile", video_config.profile(), | 182 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodecProfile", video_config.profile(), |
| 175 VIDEO_CODEC_PROFILE_MAX + 1); | 183 VIDEO_CODEC_PROFILE_MAX + 1); |
| 176 } | 184 } |
| 177 UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", | 185 UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", |
| 178 video_config.visible_rect().width()); | 186 video_config.visible_rect().width()); |
| 179 UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", | 187 UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", |
| 180 video_config.visible_rect()); | 188 video_config.visible_rect()); |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1378 | 1386 |
| 1379 media_track = media_tracks->AddAudioTrack(audio_config, track_id, "main", | 1387 media_track = media_tracks->AddAudioTrack(audio_config, track_id, "main", |
| 1380 track_label, track_language); | 1388 track_label, track_language); |
| 1381 media_track->set_id(base::UintToString(track_id)); | 1389 media_track->set_id(base::UintToString(track_id)); |
| 1382 DCHECK(track_id_to_demux_stream_map_.find(media_track->id()) == | 1390 DCHECK(track_id_to_demux_stream_map_.find(media_track->id()) == |
| 1383 track_id_to_demux_stream_map_.end()); | 1391 track_id_to_demux_stream_map_.end()); |
| 1384 track_id_to_demux_stream_map_[media_track->id()] = streams_[i].get(); | 1392 track_id_to_demux_stream_map_[media_track->id()] = streams_[i].get(); |
| 1385 } else if (codec_type == AVMEDIA_TYPE_VIDEO) { | 1393 } else if (codec_type == AVMEDIA_TYPE_VIDEO) { |
| 1386 VideoDecoderConfig video_config = streams_[i]->video_decoder_config(); | 1394 VideoDecoderConfig video_config = streams_[i]->video_decoder_config(); |
| 1387 | 1395 |
| 1388 RecordVideoCodecStats(video_config, stream->codecpar->color_range, | 1396 RecordVideoCodecStats(glue_->container(), video_config, |
| 1389 media_log_); | 1397 stream->codecpar->color_range, media_log_); |
| 1390 | 1398 |
| 1391 media_track = media_tracks->AddVideoTrack(video_config, track_id, "main", | 1399 media_track = media_tracks->AddVideoTrack(video_config, track_id, "main", |
| 1392 track_label, track_language); | 1400 track_label, track_language); |
| 1393 media_track->set_id(base::UintToString(track_id)); | 1401 media_track->set_id(base::UintToString(track_id)); |
| 1394 DCHECK(track_id_to_demux_stream_map_.find(media_track->id()) == | 1402 DCHECK(track_id_to_demux_stream_map_.find(media_track->id()) == |
| 1395 track_id_to_demux_stream_map_.end()); | 1403 track_id_to_demux_stream_map_.end()); |
| 1396 track_id_to_demux_stream_map_[media_track->id()] = streams_[i].get(); | 1404 track_id_to_demux_stream_map_[media_track->id()] = streams_[i].get(); |
| 1397 } | 1405 } |
| 1398 | 1406 |
| 1399 max_duration = std::max(max_duration, streams_[i]->duration()); | 1407 max_duration = std::max(max_duration, streams_[i]->duration()); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1881 | 1889 |
| 1882 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { | 1890 void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) { |
| 1883 DCHECK(task_runner_->BelongsToCurrentThread()); | 1891 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 1884 for (const auto& stream : streams_) { | 1892 for (const auto& stream : streams_) { |
| 1885 if (stream) | 1893 if (stream) |
| 1886 stream->SetLiveness(liveness); | 1894 stream->SetLiveness(liveness); |
| 1887 } | 1895 } |
| 1888 } | 1896 } |
| 1889 | 1897 |
| 1890 } // namespace media | 1898 } // namespace media |
| OLD | NEW |