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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 HISTOGRAM_VP9, | 53 HISTOGRAM_VP9, |
| 54 HISTOGRAM_VORBIS, | 54 HISTOGRAM_VORBIS, |
| 55 HISTOGRAM_H264, | 55 HISTOGRAM_H264, |
| 56 HISTOGRAM_MPEG2AAC, | 56 HISTOGRAM_MPEG2AAC, |
| 57 HISTOGRAM_MPEG4AAC, | 57 HISTOGRAM_MPEG4AAC, |
| 58 HISTOGRAM_EAC3, | 58 HISTOGRAM_EAC3, |
| 59 HISTOGRAM_MP3, | 59 HISTOGRAM_MP3, |
| 60 HISTOGRAM_OPUS, | 60 HISTOGRAM_OPUS, |
| 61 HISTOGRAM_HEVC, | 61 HISTOGRAM_HEVC, |
| 62 HISTOGRAM_AC3, | 62 HISTOGRAM_AC3, |
| 63 HISTOGRAM_MAX = HISTOGRAM_AC3 // Must be equal to largest logged entry. | 63 HISTOGRAM_DOLBYVISION, |
| 64 HISTOGRAM_MAX = | |
| 65 HISTOGRAM_DOLBYVISION // Must be equal to largest logged entry. | |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 const char* pattern; | 68 const char* pattern; |
| 67 Type type; | 69 Type type; |
| 68 CodecIDValidatorFunction validator; | 70 CodecIDValidatorFunction validator; |
| 69 HistogramTag tag; | 71 HistogramTag tag; |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 typedef StreamParser* (*ParserFactoryFunction)( | 74 typedef StreamParser* (*ParserFactoryFunction)( |
| 73 const std::vector<std::string>& codecs, | 75 const std::vector<std::string>& codecs, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 static const CodecInfo kH264AVC1CodecInfo = { "avc1.*", CodecInfo::VIDEO, NULL, | 163 static const CodecInfo kH264AVC1CodecInfo = { "avc1.*", CodecInfo::VIDEO, NULL, |
| 162 CodecInfo::HISTOGRAM_H264 }; | 164 CodecInfo::HISTOGRAM_H264 }; |
| 163 static const CodecInfo kH264AVC3CodecInfo = { "avc3.*", CodecInfo::VIDEO, NULL, | 165 static const CodecInfo kH264AVC3CodecInfo = { "avc3.*", CodecInfo::VIDEO, NULL, |
| 164 CodecInfo::HISTOGRAM_H264 }; | 166 CodecInfo::HISTOGRAM_H264 }; |
| 165 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 167 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 166 static const CodecInfo kHEVCHEV1CodecInfo = { "hev1.*", CodecInfo::VIDEO, NULL, | 168 static const CodecInfo kHEVCHEV1CodecInfo = { "hev1.*", CodecInfo::VIDEO, NULL, |
| 167 CodecInfo::HISTOGRAM_HEVC }; | 169 CodecInfo::HISTOGRAM_HEVC }; |
| 168 static const CodecInfo kHEVCHVC1CodecInfo = { "hvc1.*", CodecInfo::VIDEO, NULL, | 170 static const CodecInfo kHEVCHVC1CodecInfo = { "hvc1.*", CodecInfo::VIDEO, NULL, |
| 169 CodecInfo::HISTOGRAM_HEVC }; | 171 CodecInfo::HISTOGRAM_HEVC }; |
| 170 #endif | 172 #endif |
| 173 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) | |
| 174 static const CodecInfo kDolbyVisionAVCCodecInfo = { | |
| 175 "dvav.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_DOLBYVISION}; | |
|
wolenetz
2017/01/25 23:42:41
Hmm. Does Dolby Vision support require HEVC suppor
erickung1
2017/02/03 18:18:31
Done.
| |
| 176 static const CodecInfo kDolbyVisionHEVCCodecInfo = { | |
| 177 "dvhe.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_DOLBYVISION}; | |
|
wolenetz
2017/01/25 23:42:41
Hmm. Does part of Dolby Vision support also requir
erickung1
2017/02/03 18:18:31
Dolby Vision profile 0 requires AVC support
Dolby
| |
| 178 #endif | |
| 171 static const CodecInfo kMPEG4VP09CodecInfo = {"vp09.*", CodecInfo::VIDEO, | 179 static const CodecInfo kMPEG4VP09CodecInfo = {"vp09.*", CodecInfo::VIDEO, |
| 172 &CheckIfMp4Vp9DemuxingEnabled, | 180 &CheckIfMp4Vp9DemuxingEnabled, |
| 173 CodecInfo::HISTOGRAM_VP9}; | 181 CodecInfo::HISTOGRAM_VP9}; |
| 174 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, | 182 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, |
| 175 &ValidateMP4ACodecID, | 183 &ValidateMP4ACodecID, |
| 176 CodecInfo::HISTOGRAM_MPEG4AAC }; | 184 CodecInfo::HISTOGRAM_MPEG4AAC }; |
| 177 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO, | 185 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO, |
| 178 NULL, | 186 NULL, |
| 179 CodecInfo::HISTOGRAM_MPEG2AAC }; | 187 CodecInfo::HISTOGRAM_MPEG2AAC }; |
| 180 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) | 188 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 192 CodecInfo::HISTOGRAM_AC3}; | 200 CodecInfo::HISTOGRAM_AC3}; |
| 193 static const CodecInfo kEAC3CodecInfo1 = {"ec-3", CodecInfo::AUDIO, NULL, | 201 static const CodecInfo kEAC3CodecInfo1 = {"ec-3", CodecInfo::AUDIO, NULL, |
| 194 CodecInfo::HISTOGRAM_EAC3}; | 202 CodecInfo::HISTOGRAM_EAC3}; |
| 195 static const CodecInfo kEAC3CodecInfo2 = {"mp4a.a6", CodecInfo::AUDIO, NULL, | 203 static const CodecInfo kEAC3CodecInfo2 = {"mp4a.a6", CodecInfo::AUDIO, NULL, |
| 196 CodecInfo::HISTOGRAM_EAC3}; | 204 CodecInfo::HISTOGRAM_EAC3}; |
| 197 static const CodecInfo kEAC3CodecInfo3 = {"mp4a.A6", CodecInfo::AUDIO, NULL, | 205 static const CodecInfo kEAC3CodecInfo3 = {"mp4a.A6", CodecInfo::AUDIO, NULL, |
| 198 CodecInfo::HISTOGRAM_EAC3}; | 206 CodecInfo::HISTOGRAM_EAC3}; |
| 199 #endif | 207 #endif |
| 200 | 208 |
| 201 static const CodecInfo* kVideoMP4Codecs[] = { | 209 static const CodecInfo* kVideoMP4Codecs[] = { |
| 202 &kH264AVC1CodecInfo, &kH264AVC3CodecInfo, | 210 &kH264AVC1CodecInfo, &kH264AVC3CodecInfo, |
| 203 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 211 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 204 &kHEVCHEV1CodecInfo, &kHEVCHVC1CodecInfo, | 212 &kHEVCHEV1CodecInfo, &kHEVCHVC1CodecInfo, |
| 205 #endif | 213 #endif |
| 206 &kMPEG4VP09CodecInfo, | 214 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) |
| 207 &kMPEG4AACCodecInfo, &kMPEG2AACLCCodecInfo, NULL}; | 215 &kDolbyVisionAVCCodecInfo, &kDolbyVisionHEVCCodecInfo, |
| 216 #endif | |
| 217 &kMPEG4VP09CodecInfo, &kMPEG4AACCodecInfo, | |
| 218 &kMPEG2AACLCCodecInfo, NULL}; | |
| 208 | 219 |
| 209 static const CodecInfo* kAudioMP4Codecs[] = {&kMPEG4AACCodecInfo, | 220 static const CodecInfo* kAudioMP4Codecs[] = {&kMPEG4AACCodecInfo, |
| 210 &kMPEG2AACLCCodecInfo, | 221 &kMPEG2AACLCCodecInfo, |
| 211 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) | 222 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 212 &kAC3CodecInfo1, | 223 &kAC3CodecInfo1, |
| 213 &kAC3CodecInfo2, | 224 &kAC3CodecInfo2, |
| 214 &kAC3CodecInfo3, | 225 &kAC3CodecInfo3, |
| 215 &kEAC3CodecInfo1, | 226 &kEAC3CodecInfo1, |
| 216 &kEAC3CodecInfo2, | 227 &kEAC3CodecInfo2, |
| 217 &kEAC3CodecInfo3, | 228 &kEAC3CodecInfo3, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 CodecInfo::HISTOGRAM_MAX + 1); | 475 CodecInfo::HISTOGRAM_MAX + 1); |
| 465 } | 476 } |
| 466 | 477 |
| 467 stream_parser.reset(factory_function(codecs, media_log)); | 478 stream_parser.reset(factory_function(codecs, media_log)); |
| 468 } | 479 } |
| 469 | 480 |
| 470 return stream_parser; | 481 return stream_parser; |
| 471 } | 482 } |
| 472 | 483 |
| 473 } // namespace media | 484 } // namespace media |
| OLD | NEW |