| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/stream_parser_factory.h" | 5 #include "media/filters/stream_parser_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 HISTOGRAM_UNKNOWN, | 43 HISTOGRAM_UNKNOWN, |
| 44 HISTOGRAM_VP8, | 44 HISTOGRAM_VP8, |
| 45 HISTOGRAM_VP9, | 45 HISTOGRAM_VP9, |
| 46 HISTOGRAM_VORBIS, | 46 HISTOGRAM_VORBIS, |
| 47 HISTOGRAM_H264, | 47 HISTOGRAM_H264, |
| 48 HISTOGRAM_MPEG2AAC, | 48 HISTOGRAM_MPEG2AAC, |
| 49 HISTOGRAM_MPEG4AAC, | 49 HISTOGRAM_MPEG4AAC, |
| 50 HISTOGRAM_EAC3, | 50 HISTOGRAM_EAC3, |
| 51 HISTOGRAM_MP3, | 51 HISTOGRAM_MP3, |
| 52 HISTOGRAM_OPUS, | 52 HISTOGRAM_OPUS, |
| 53 HISTOGRAM_MAX // Must be the last entry. | 53 HISTOGRAM_MAX = HISTOGRAM_OPUS // Must be equal to largest logged entry. |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 const char* pattern; | 56 const char* pattern; |
| 57 Type type; | 57 Type type; |
| 58 CodecIDValidatorFunction validator; | 58 CodecIDValidatorFunction validator; |
| 59 HistogramTag tag; | 59 HistogramTag tag; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 typedef StreamParser* (*ParserFactoryFunction)( | 62 typedef StreamParser* (*ParserFactoryFunction)( |
| 63 const std::vector<std::string>& codecs, | 63 const std::vector<std::string>& codecs, |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 log_cb, | 410 log_cb, |
| 411 &factory_function, | 411 &factory_function, |
| 412 &audio_codecs, | 412 &audio_codecs, |
| 413 &video_codecs)) { | 413 &video_codecs)) { |
| 414 *has_audio = !audio_codecs.empty(); | 414 *has_audio = !audio_codecs.empty(); |
| 415 *has_video = !video_codecs.empty(); | 415 *has_video = !video_codecs.empty(); |
| 416 | 416 |
| 417 // Log the number of codecs specified, as well as the details on each one. | 417 // Log the number of codecs specified, as well as the details on each one. |
| 418 UMA_HISTOGRAM_COUNTS_100("Media.MSE.NumberOfTracks", codecs.size()); | 418 UMA_HISTOGRAM_COUNTS_100("Media.MSE.NumberOfTracks", codecs.size()); |
| 419 for (size_t i = 0; i < audio_codecs.size(); ++i) { | 419 for (size_t i = 0; i < audio_codecs.size(); ++i) { |
| 420 UMA_HISTOGRAM_ENUMERATION( | 420 UMA_HISTOGRAM_ENUMERATION("Media.MSE.AudioCodec", |
| 421 "Media.MSE.AudioCodec", audio_codecs[i], CodecInfo::HISTOGRAM_MAX); | 421 audio_codecs[i], |
| 422 CodecInfo::HISTOGRAM_MAX + 1); |
| 422 } | 423 } |
| 423 for (size_t i = 0; i < video_codecs.size(); ++i) { | 424 for (size_t i = 0; i < video_codecs.size(); ++i) { |
| 424 UMA_HISTOGRAM_ENUMERATION( | 425 UMA_HISTOGRAM_ENUMERATION("Media.MSE.VideoCodec", |
| 425 "Media.MSE.VideoCodec", video_codecs[i], CodecInfo::HISTOGRAM_MAX); | 426 video_codecs[i], |
| 427 CodecInfo::HISTOGRAM_MAX + 1); |
| 426 } | 428 } |
| 427 | 429 |
| 428 stream_parser.reset(factory_function(codecs, log_cb)); | 430 stream_parser.reset(factory_function(codecs, log_cb)); |
| 429 } | 431 } |
| 430 | 432 |
| 431 return stream_parser.Pass(); | 433 return stream_parser.Pass(); |
| 432 } | 434 } |
| 433 | 435 |
| 434 } // namespace media | 436 } // namespace media |
| OLD | NEW |