Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 HISTOGRAM_UNKNOWN, | 42 HISTOGRAM_UNKNOWN, |
| 43 HISTOGRAM_VP8, | 43 HISTOGRAM_VP8, |
| 44 HISTOGRAM_VP9, | 44 HISTOGRAM_VP9, |
| 45 HISTOGRAM_VORBIS, | 45 HISTOGRAM_VORBIS, |
| 46 HISTOGRAM_H264, | 46 HISTOGRAM_H264, |
| 47 HISTOGRAM_MPEG2AAC, | 47 HISTOGRAM_MPEG2AAC, |
| 48 HISTOGRAM_MPEG4AAC, | 48 HISTOGRAM_MPEG4AAC, |
| 49 HISTOGRAM_EAC3, | 49 HISTOGRAM_EAC3, |
| 50 HISTOGRAM_MP3, | 50 HISTOGRAM_MP3, |
| 51 HISTOGRAM_OPUS, | 51 HISTOGRAM_OPUS, |
| 52 HISTOGRAM_MAX // Must be the last entry. | 52 HISTOGRAM_MAX = HISTOGRAM_OPUS // Must be equal to last entry! |
|
rileya (GONE FROM CHROMIUM)
2014/01/29 19:24:11
HISTOGRAM_MAX now seems like kind of a misnomer, a
Ami GONE FROM CHROMIUM
2014/01/29 21:29:02
Can this enum type be replaced with a union of aud
| |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 const char* pattern; | 55 const char* pattern; |
| 56 Type type; | 56 Type type; |
| 57 CodecIDValidatorFunction validator; | 57 CodecIDValidatorFunction validator; |
| 58 HistogramTag tag; | 58 HistogramTag tag; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 typedef StreamParser* (*ParserFactoryFunction)( | 61 typedef StreamParser* (*ParserFactoryFunction)( |
| 62 const std::vector<std::string>& codecs, | 62 const std::vector<std::string>& codecs, |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 log_cb, | 390 log_cb, |
| 391 &factory_function, | 391 &factory_function, |
| 392 &audio_codecs, | 392 &audio_codecs, |
| 393 &video_codecs)) { | 393 &video_codecs)) { |
| 394 *has_audio = !audio_codecs.empty(); | 394 *has_audio = !audio_codecs.empty(); |
| 395 *has_video = !video_codecs.empty(); | 395 *has_video = !video_codecs.empty(); |
| 396 | 396 |
| 397 // Log the number of codecs specified, as well as the details on each one. | 397 // Log the number of codecs specified, as well as the details on each one. |
| 398 UMA_HISTOGRAM_COUNTS_100("Media.MSE.NumberOfTracks", codecs.size()); | 398 UMA_HISTOGRAM_COUNTS_100("Media.MSE.NumberOfTracks", codecs.size()); |
| 399 for (size_t i = 0; i < audio_codecs.size(); ++i) { | 399 for (size_t i = 0; i < audio_codecs.size(); ++i) { |
| 400 UMA_HISTOGRAM_ENUMERATION( | 400 UMA_HISTOGRAM_ENUMERATION("Media.MSE.AudioCodec", |
| 401 "Media.MSE.AudioCodec", audio_codecs[i], CodecInfo::HISTOGRAM_MAX); | 401 audio_codecs[i], |
| 402 CodecInfo::HISTOGRAM_MAX + 1); | |
| 402 } | 403 } |
| 403 for (size_t i = 0; i < video_codecs.size(); ++i) { | 404 for (size_t i = 0; i < video_codecs.size(); ++i) { |
| 404 UMA_HISTOGRAM_ENUMERATION( | 405 UMA_HISTOGRAM_ENUMERATION("Media.MSE.VideoCodec", |
| 405 "Media.MSE.VideoCodec", video_codecs[i], CodecInfo::HISTOGRAM_MAX); | 406 video_codecs[i], |
| 407 CodecInfo::HISTOGRAM_MAX + 1); | |
| 406 } | 408 } |
| 407 | 409 |
| 408 stream_parser.reset(factory_function(codecs, log_cb)); | 410 stream_parser.reset(factory_function(codecs, log_cb)); |
| 409 } | 411 } |
| 410 | 412 |
| 411 return stream_parser.Pass(); | 413 return stream_parser.Pass(); |
| 412 } | 414 } |
| 413 | 415 |
| 414 } // namespace media | 416 } // namespace media |
| OLD | NEW |