Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: media/filters/stream_parser_factory.cc

Issue 816353010: Implemented HEVC video demuxing and parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 = HISTOGRAM_OPUS // Must be equal to largest logged entry. 52 HISTOGRAM_HEVC,
53 HISTOGRAM_MAX = HISTOGRAM_HEVC // Must be equal to largest logged entry.
53 }; 54 };
54 55
55 const char* pattern; 56 const char* pattern;
56 Type type; 57 Type type;
57 CodecIDValidatorFunction validator; 58 CodecIDValidatorFunction validator;
58 HistogramTag tag; 59 HistogramTag tag;
59 }; 60 };
60 61
61 typedef StreamParser* (*ParserFactoryFunction)( 62 typedef StreamParser* (*ParserFactoryFunction)(
62 const std::vector<std::string>& codecs, 63 const std::vector<std::string>& codecs,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 MEDIA_LOG(DEBUG, log_cb) << "Unsupported audio object type " 138 MEDIA_LOG(DEBUG, log_cb) << "Unsupported audio object type "
138 << audio_object_type << " in codec '" << codec_id 139 << audio_object_type << " in codec '" << codec_id
139 << "'"; 140 << "'";
140 return false; 141 return false;
141 } 142 }
142 143
143 static const CodecInfo kH264AVC1CodecInfo = { "avc1.*", CodecInfo::VIDEO, NULL, 144 static const CodecInfo kH264AVC1CodecInfo = { "avc1.*", CodecInfo::VIDEO, NULL,
144 CodecInfo::HISTOGRAM_H264 }; 145 CodecInfo::HISTOGRAM_H264 };
145 static const CodecInfo kH264AVC3CodecInfo = { "avc3.*", CodecInfo::VIDEO, NULL, 146 static const CodecInfo kH264AVC3CodecInfo = { "avc3.*", CodecInfo::VIDEO, NULL,
146 CodecInfo::HISTOGRAM_H264 }; 147 CodecInfo::HISTOGRAM_H264 };
148 #if defined(ENABLE_HEVC_DEMUXING)
149 static const CodecInfo kHEVCHEV1CodecInfo = { "hev1.*", CodecInfo::VIDEO, NULL,
150 CodecInfo::HISTOGRAM_HEVC };
151 static const CodecInfo kHEVCHVC1CodecInfo = { "hvc1.*", CodecInfo::VIDEO, NULL,
152 CodecInfo::HISTOGRAM_HEVC };
153 #endif
147 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, 154 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO,
148 &ValidateMP4ACodecID, 155 &ValidateMP4ACodecID,
149 CodecInfo::HISTOGRAM_MPEG4AAC }; 156 CodecInfo::HISTOGRAM_MPEG4AAC };
150 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO, 157 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO,
151 NULL, 158 NULL,
152 CodecInfo::HISTOGRAM_MPEG2AAC }; 159 CodecInfo::HISTOGRAM_MPEG2AAC };
153 160
154 static const CodecInfo* kVideoMP4Codecs[] = { 161 static const CodecInfo* kVideoMP4Codecs[] = {
155 &kH264AVC1CodecInfo, 162 &kH264AVC1CodecInfo,
156 &kH264AVC3CodecInfo, 163 &kH264AVC3CodecInfo,
164 #if defined(ENABLE_HEVC_DEMUXING)
165 &kHEVCHEV1CodecInfo,
166 &kHEVCHVC1CodecInfo,
167 #endif
157 &kMPEG4AACCodecInfo, 168 &kMPEG4AACCodecInfo,
158 &kMPEG2AACLCCodecInfo, 169 &kMPEG2AACLCCodecInfo,
159 NULL 170 NULL
160 }; 171 };
161 172
162 static const CodecInfo* kAudioMP4Codecs[] = { 173 static const CodecInfo* kAudioMP4Codecs[] = {
163 &kMPEG4AACCodecInfo, 174 &kMPEG4AACCodecInfo,
164 &kMPEG2AACLCCodecInfo, 175 &kMPEG2AACLCCodecInfo,
165 NULL 176 NULL
166 }; 177 };
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 224
214 static StreamParser* BuildADTSParser( 225 static StreamParser* BuildADTSParser(
215 const std::vector<std::string>& codecs, const LogCB& log_cb) { 226 const std::vector<std::string>& codecs, const LogCB& log_cb) {
216 return new ADTSStreamParser(); 227 return new ADTSStreamParser();
217 } 228 }
218 229
219 #if defined(ENABLE_MPEG2TS_STREAM_PARSER) 230 #if defined(ENABLE_MPEG2TS_STREAM_PARSER)
220 static const CodecInfo* kVideoMP2TCodecs[] = { 231 static const CodecInfo* kVideoMP2TCodecs[] = {
221 &kH264AVC1CodecInfo, 232 &kH264AVC1CodecInfo,
222 &kH264AVC3CodecInfo, 233 &kH264AVC3CodecInfo,
234 #if defined(ENABLE_HEVC_DEMUXING)
235 // TODO(servolk): implement ES parser for HEVC in mpeg2ts container
ddorwin 2015/06/12 00:52:27 Remove until we need it. It doesn't sound like we
servolk 2015/06/12 21:57:31 Done.
236 //&kHEVCHEV1CodecInfo,
237 //&kHEVCHVC1CodecInfo,
238 #endif
223 &kMPEG4AACCodecInfo, 239 &kMPEG4AACCodecInfo,
224 &kMPEG2AACLCCodecInfo, 240 &kMPEG2AACLCCodecInfo,
225 NULL 241 NULL
226 }; 242 };
227 243
228 static StreamParser* BuildMP2TParser( 244 static StreamParser* BuildMP2TParser(
229 const std::vector<std::string>& codecs, const media::LogCB& log_cb) { 245 const std::vector<std::string>& codecs, const media::LogCB& log_cb) {
230 bool has_sbr = false; 246 bool has_sbr = false;
231 for (size_t i = 0; i < codecs.size(); ++i) { 247 for (size_t i = 0; i < codecs.size(); ++i) {
232 std::string codec_id = codecs[i]; 248 std::string codec_id = codecs[i];
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 CodecInfo::HISTOGRAM_MAX + 1); 433 CodecInfo::HISTOGRAM_MAX + 1);
418 } 434 }
419 435
420 stream_parser.reset(factory_function(codecs, log_cb)); 436 stream_parser.reset(factory_function(codecs, log_cb));
421 } 437 }
422 438
423 return stream_parser.Pass(); 439 return stream_parser.Pass();
424 } 440 }
425 441
426 } // namespace media 442 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698