| 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/pattern.h" | 9 #include "base/strings/pattern.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 HISTOGRAM_UNKNOWN, | 45 HISTOGRAM_UNKNOWN, |
| 46 HISTOGRAM_VP8, | 46 HISTOGRAM_VP8, |
| 47 HISTOGRAM_VP9, | 47 HISTOGRAM_VP9, |
| 48 HISTOGRAM_VORBIS, | 48 HISTOGRAM_VORBIS, |
| 49 HISTOGRAM_H264, | 49 HISTOGRAM_H264, |
| 50 HISTOGRAM_MPEG2AAC, | 50 HISTOGRAM_MPEG2AAC, |
| 51 HISTOGRAM_MPEG4AAC, | 51 HISTOGRAM_MPEG4AAC, |
| 52 HISTOGRAM_EAC3, | 52 HISTOGRAM_EAC3, |
| 53 HISTOGRAM_MP3, | 53 HISTOGRAM_MP3, |
| 54 HISTOGRAM_OPUS, | 54 HISTOGRAM_OPUS, |
| 55 HISTOGRAM_MAX = HISTOGRAM_OPUS // Must be equal to largest logged entry. | 55 HISTOGRAM_HEVC, |
| 56 HISTOGRAM_MAX = HISTOGRAM_HEVC // Must be equal to largest logged entry. |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 const char* pattern; | 59 const char* pattern; |
| 59 Type type; | 60 Type type; |
| 60 CodecIDValidatorFunction validator; | 61 CodecIDValidatorFunction validator; |
| 61 HistogramTag tag; | 62 HistogramTag tag; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 typedef StreamParser* (*ParserFactoryFunction)( | 65 typedef StreamParser* (*ParserFactoryFunction)( |
| 65 const std::vector<std::string>& codecs, | 66 const std::vector<std::string>& codecs, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 MEDIA_LOG(DEBUG, media_log) << "Unsupported audio object type " | 142 MEDIA_LOG(DEBUG, media_log) << "Unsupported audio object type " |
| 142 << audio_object_type << " in codec '" << codec_id | 143 << audio_object_type << " in codec '" << codec_id |
| 143 << "'"; | 144 << "'"; |
| 144 return false; | 145 return false; |
| 145 } | 146 } |
| 146 | 147 |
| 147 static const CodecInfo kH264AVC1CodecInfo = { "avc1.*", CodecInfo::VIDEO, NULL, | 148 static const CodecInfo kH264AVC1CodecInfo = { "avc1.*", CodecInfo::VIDEO, NULL, |
| 148 CodecInfo::HISTOGRAM_H264 }; | 149 CodecInfo::HISTOGRAM_H264 }; |
| 149 static const CodecInfo kH264AVC3CodecInfo = { "avc3.*", CodecInfo::VIDEO, NULL, | 150 static const CodecInfo kH264AVC3CodecInfo = { "avc3.*", CodecInfo::VIDEO, NULL, |
| 150 CodecInfo::HISTOGRAM_H264 }; | 151 CodecInfo::HISTOGRAM_H264 }; |
| 152 #if defined(ENABLE_HEVC_DEMUXING) |
| 153 static const CodecInfo kHEVCHEV1CodecInfo = { "hev1.*", CodecInfo::VIDEO, NULL, |
| 154 CodecInfo::HISTOGRAM_HEVC }; |
| 155 static const CodecInfo kHEVCHVC1CodecInfo = { "hvc1.*", CodecInfo::VIDEO, NULL, |
| 156 CodecInfo::HISTOGRAM_HEVC }; |
| 157 #endif |
| 151 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, | 158 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, |
| 152 &ValidateMP4ACodecID, | 159 &ValidateMP4ACodecID, |
| 153 CodecInfo::HISTOGRAM_MPEG4AAC }; | 160 CodecInfo::HISTOGRAM_MPEG4AAC }; |
| 154 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO, | 161 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO, |
| 155 NULL, | 162 NULL, |
| 156 CodecInfo::HISTOGRAM_MPEG2AAC }; | 163 CodecInfo::HISTOGRAM_MPEG2AAC }; |
| 157 | 164 |
| 158 static const CodecInfo* kVideoMP4Codecs[] = { | 165 static const CodecInfo* kVideoMP4Codecs[] = { |
| 159 &kH264AVC1CodecInfo, | 166 &kH264AVC1CodecInfo, |
| 160 &kH264AVC3CodecInfo, | 167 &kH264AVC3CodecInfo, |
| 168 #if defined(ENABLE_HEVC_DEMUXING) |
| 169 &kHEVCHEV1CodecInfo, |
| 170 &kHEVCHVC1CodecInfo, |
| 171 #endif |
| 161 &kMPEG4AACCodecInfo, | 172 &kMPEG4AACCodecInfo, |
| 162 &kMPEG2AACLCCodecInfo, | 173 &kMPEG2AACLCCodecInfo, |
| 163 NULL | 174 NULL |
| 164 }; | 175 }; |
| 165 | 176 |
| 166 static const CodecInfo* kAudioMP4Codecs[] = { | 177 static const CodecInfo* kAudioMP4Codecs[] = { |
| 167 &kMPEG4AACCodecInfo, | 178 &kMPEG4AACCodecInfo, |
| 168 &kMPEG2AACLCCodecInfo, | 179 &kMPEG2AACLCCodecInfo, |
| 169 NULL | 180 NULL |
| 170 }; | 181 }; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 CodecInfo::HISTOGRAM_MAX + 1); | 428 CodecInfo::HISTOGRAM_MAX + 1); |
| 418 } | 429 } |
| 419 | 430 |
| 420 stream_parser.reset(factory_function(codecs, media_log)); | 431 stream_parser.reset(factory_function(codecs, media_log)); |
| 421 } | 432 } |
| 422 | 433 |
| 423 return stream_parser.Pass(); | 434 return stream_parser.Pass(); |
| 424 } | 435 } |
| 425 | 436 |
| 426 } // namespace media | 437 } // namespace media |
| OLD | NEW |