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

Side by Side Diff: media/base/video_codecs.cc

Issue 2864593003: Add MimeUtil::Parse{Audio|Video}CodecString (Closed)
Patch Set: Feedback && Proprietary Codecs fix && Rebase Created 3 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
« no previous file with comments | « media/base/mime_util_unittest.cc ('k') | media/blink/webmediacapabilitiesclient_impl.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/base/video_codecs.h" 5 #include "media/base/video_codecs.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 ? gfx::ColorSpace::RangeID::FULL 230 ? gfx::ColorSpace::RangeID::FULL
231 : gfx::ColorSpace::RangeID::LIMITED; 231 : gfx::ColorSpace::RangeID::LIMITED;
232 232
233 return true; 233 return true;
234 } 234 }
235 235
236 bool ParseLegacyVp9CodecID(const std::string& codec_id, 236 bool ParseLegacyVp9CodecID(const std::string& codec_id,
237 VideoCodecProfile* profile, 237 VideoCodecProfile* profile,
238 uint8_t* level_idc) { 238 uint8_t* level_idc) {
239 if (codec_id == "vp9" || codec_id == "vp9.0") { 239 if (codec_id == "vp9" || codec_id == "vp9.0") {
240 // Profile is not included in the codec string. Assuming profile 0 to be 240 // Profile is not included in the codec string. Consumers of parsed codec
241 // backward compatible. 241 // should handle by rejecting ambiguous string or resolving to a default
242 *profile = VP9PROFILE_PROFILE0; 242 // profile.
243 *profile = VIDEO_CODEC_PROFILE_UNKNOWN;
243 // Use 0 to indicate unknown level. 244 // Use 0 to indicate unknown level.
244 *level_idc = 0; 245 *level_idc = 0;
245 return true; 246 return true;
246 } 247 }
247 return false; 248 return false;
248 } 249 }
249 250
250 bool ParseAVCCodecId(const std::string& codec_id, 251 bool ParseAVCCodecId(const std::string& codec_id,
251 VideoCodecProfile* profile, 252 VideoCodecProfile* profile,
252 uint8_t* level_idc) { 253 uint8_t* level_idc) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 return kCodecHEVC; 625 return kCodecHEVC;
625 #endif 626 #endif
626 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) 627 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
627 if (ParseDolbyVisionCodecId(codec_id, &profile, &level)) 628 if (ParseDolbyVisionCodecId(codec_id, &profile, &level))
628 return kCodecDolbyVision; 629 return kCodecDolbyVision;
629 #endif 630 #endif
630 return kUnknownVideoCodec; 631 return kUnknownVideoCodec;
631 } 632 }
632 633
633 } // namespace media 634 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mime_util_unittest.cc ('k') | media/blink/webmediacapabilitiesclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698