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

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

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: fix build break on Android Created 3 years, 9 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
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/formats/mp4/avc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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 kDolbyVisionAVCCodecInfo1 = {
175 "dva1.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_DOLBYVISION};
176 static const CodecInfo kDolbyVisionAVCCodecInfo2 = {
177 "dvav.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_DOLBYVISION};
178 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
179 static const CodecInfo kDolbyVisionHEVCCodecInfo1 = {
180 "dvh1.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_DOLBYVISION};
181 static const CodecInfo kDolbyVisionHEVCCodecInfo2 = {
182 "dvhe.*", CodecInfo::VIDEO, NULL, CodecInfo::HISTOGRAM_DOLBYVISION};
183 #endif
184 #endif
171 static const CodecInfo kMPEG4VP09CodecInfo = {"vp09.*", CodecInfo::VIDEO, 185 static const CodecInfo kMPEG4VP09CodecInfo = {"vp09.*", CodecInfo::VIDEO,
172 &CheckIfMp4Vp9DemuxingEnabled, 186 &CheckIfMp4Vp9DemuxingEnabled,
173 CodecInfo::HISTOGRAM_VP9}; 187 CodecInfo::HISTOGRAM_VP9};
174 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO, 188 static const CodecInfo kMPEG4AACCodecInfo = { "mp4a.40.*", CodecInfo::AUDIO,
175 &ValidateMP4ACodecID, 189 &ValidateMP4ACodecID,
176 CodecInfo::HISTOGRAM_MPEG4AAC }; 190 CodecInfo::HISTOGRAM_MPEG4AAC };
177 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO, 191 static const CodecInfo kMPEG2AACLCCodecInfo = { "mp4a.67", CodecInfo::AUDIO,
178 NULL, 192 NULL,
179 CodecInfo::HISTOGRAM_MPEG2AAC }; 193 CodecInfo::HISTOGRAM_MPEG2AAC };
180 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) 194 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING)
(...skipping 11 matching lines...) Expand all
192 CodecInfo::HISTOGRAM_AC3}; 206 CodecInfo::HISTOGRAM_AC3};
193 static const CodecInfo kEAC3CodecInfo1 = {"ec-3", CodecInfo::AUDIO, NULL, 207 static const CodecInfo kEAC3CodecInfo1 = {"ec-3", CodecInfo::AUDIO, NULL,
194 CodecInfo::HISTOGRAM_EAC3}; 208 CodecInfo::HISTOGRAM_EAC3};
195 static const CodecInfo kEAC3CodecInfo2 = {"mp4a.a6", CodecInfo::AUDIO, NULL, 209 static const CodecInfo kEAC3CodecInfo2 = {"mp4a.a6", CodecInfo::AUDIO, NULL,
196 CodecInfo::HISTOGRAM_EAC3}; 210 CodecInfo::HISTOGRAM_EAC3};
197 static const CodecInfo kEAC3CodecInfo3 = {"mp4a.A6", CodecInfo::AUDIO, NULL, 211 static const CodecInfo kEAC3CodecInfo3 = {"mp4a.A6", CodecInfo::AUDIO, NULL,
198 CodecInfo::HISTOGRAM_EAC3}; 212 CodecInfo::HISTOGRAM_EAC3};
199 #endif 213 #endif
200 214
201 static const CodecInfo* kVideoMP4Codecs[] = { 215 static const CodecInfo* kVideoMP4Codecs[] = {
202 &kH264AVC1CodecInfo, &kH264AVC3CodecInfo, 216 &kH264AVC1CodecInfo, &kH264AVC3CodecInfo,
203 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 217 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
204 &kHEVCHEV1CodecInfo, &kHEVCHVC1CodecInfo, 218 &kHEVCHEV1CodecInfo, &kHEVCHVC1CodecInfo,
205 #endif 219 #endif
206 &kMPEG4VP09CodecInfo, 220 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
207 &kMPEG4AACCodecInfo, &kMPEG2AACLCCodecInfo, NULL}; 221 &kDolbyVisionAVCCodecInfo1, &kDolbyVisionAVCCodecInfo2,
222 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
223 &kDolbyVisionHEVCCodecInfo1, &kDolbyVisionHEVCCodecInfo2,
224 #endif
225 #endif
226 &kMPEG4VP09CodecInfo, &kMPEG4AACCodecInfo,
227 &kMPEG2AACLCCodecInfo, NULL};
208 228
209 static const CodecInfo* kAudioMP4Codecs[] = {&kMPEG4AACCodecInfo, 229 static const CodecInfo* kAudioMP4Codecs[] = {&kMPEG4AACCodecInfo,
210 &kMPEG2AACLCCodecInfo, 230 &kMPEG2AACLCCodecInfo,
211 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) 231 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING)
212 &kAC3CodecInfo1, 232 &kAC3CodecInfo1,
213 &kAC3CodecInfo2, 233 &kAC3CodecInfo2,
214 &kAC3CodecInfo3, 234 &kAC3CodecInfo3,
215 &kEAC3CodecInfo1, 235 &kEAC3CodecInfo1,
216 &kEAC3CodecInfo2, 236 &kEAC3CodecInfo2,
217 &kEAC3CodecInfo3, 237 &kEAC3CodecInfo3,
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 CodecInfo::HISTOGRAM_MAX + 1); 484 CodecInfo::HISTOGRAM_MAX + 1);
465 } 485 }
466 486
467 stream_parser.reset(factory_function(codecs, media_log)); 487 stream_parser.reset(factory_function(codecs, media_log));
468 } 488 }
469 489
470 return stream_parser; 490 return stream_parser;
471 } 491 }
472 492
473 } // namespace media 493 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/formats/mp4/avc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698