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

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

Issue 2550413003: Recognize codec id vp9.2 as VP9 profile 2 (Closed)
Patch Set: rebase Created 4 years 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 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 VideoCodecProfile* profile, 159 VideoCodecProfile* profile,
160 uint8_t* level_idc) { 160 uint8_t* level_idc) {
161 if (codec_id == "vp9" || codec_id == "vp9.0") { 161 if (codec_id == "vp9" || codec_id == "vp9.0") {
162 // Profile is not included in the codec string. Assuming profile 0 to be 162 // Profile is not included in the codec string. Assuming profile 0 to be
163 // backward compatible. 163 // backward compatible.
164 *profile = VP9PROFILE_PROFILE0; 164 *profile = VP9PROFILE_PROFILE0;
165 // Use 0 to indicate unknown level. 165 // Use 0 to indicate unknown level.
166 *level_idc = 0; 166 *level_idc = 0;
167 return true; 167 return true;
168 } 168 }
169 if (codec_id == "vp9.2") {
ddorwin 2016/12/08 02:08:01 We need to address https://crbug.com/672240.
170 *profile = VP9PROFILE_PROFILE2;
171 // Use 0 to indicate unknown level.
172 *level_idc = 0;
173 return true;
174 }
169 return false; 175 return false;
170 } 176 }
171 177
172 bool ParseAVCCodecId(const std::string& codec_id, 178 bool ParseAVCCodecId(const std::string& codec_id,
173 VideoCodecProfile* profile, 179 VideoCodecProfile* profile,
174 uint8_t* level_idc) { 180 uint8_t* level_idc) {
175 // Make sure we have avc1.xxxxxx or avc3.xxxxxx , where xxxxxx are hex digits 181 // Make sure we have avc1.xxxxxx or avc3.xxxxxx , where xxxxxx are hex digits
176 if (!base::StartsWith(codec_id, "avc1.", base::CompareCase::SENSITIVE) && 182 if (!base::StartsWith(codec_id, "avc1.", base::CompareCase::SENSITIVE) &&
177 !base::StartsWith(codec_id, "avc3.", base::CompareCase::SENSITIVE)) { 183 !base::StartsWith(codec_id, "avc3.", base::CompareCase::SENSITIVE)) {
178 return false; 184 return false;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 if (ParseAVCCodecId(codec_id, &profile, &level)) 394 if (ParseAVCCodecId(codec_id, &profile, &level))
389 return kCodecH264; 395 return kCodecH264;
390 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 396 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
391 if (ParseHEVCCodecId(codec_id, &profile, &level)) 397 if (ParseHEVCCodecId(codec_id, &profile, &level))
392 return kCodecHEVC; 398 return kCodecHEVC;
393 #endif 399 #endif
394 return kUnknownVideoCodec; 400 return kUnknownVideoCodec;
395 } 401 }
396 402
397 } // namespace media 403 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698