| OLD | NEW | 
|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <map> | 5 #include <map> | 
| 6 | 6 | 
| 7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" | 
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" | 
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" | 
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" | 
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 488 //   1 bit: constraint_set3_flag; ignored here. | 488 //   1 bit: constraint_set3_flag; ignored here. | 
| 489 //   4 bits: reserved; required to be 0 here. | 489 //   4 bits: reserved; required to be 0 here. | 
| 490 // | 490 // | 
| 491 // The spec indicates other ways, not implemented here, that a |profile_str| | 491 // The spec indicates other ways, not implemented here, that a |profile_str| | 
| 492 // can indicate a baseline conforming decoder is sufficient for decode in Annex | 492 // can indicate a baseline conforming decoder is sufficient for decode in Annex | 
| 493 // A.2.1: "[profile_idc not necessarily 0x42] with constraint_set0_flag set and | 493 // A.2.1: "[profile_idc not necessarily 0x42] with constraint_set0_flag set and | 
| 494 // in which level_idc and constraint_set3_flag represent a level less than or | 494 // in which level_idc and constraint_set3_flag represent a level less than or | 
| 495 // equal to the specified level." | 495 // equal to the specified level." | 
| 496 static bool IsValidH264BaselineProfile(const std::string& profile_str) { | 496 static bool IsValidH264BaselineProfile(const std::string& profile_str) { | 
| 497   return (profile_str.size() == 4 && profile_str[0] == '4' && | 497   return (profile_str.size() == 4 && profile_str[0] == '4' && | 
| 498           profile_str[1] == '2' && IsHexDigit(profile_str[2]) && | 498           profile_str[1] == '2' && base::IsHexDigit(profile_str[2]) && | 
| 499           profile_str[3] == '0'); | 499           profile_str[3] == '0'); | 
| 500 } | 500 } | 
| 501 | 501 | 
| 502 static bool IsValidH264Level(const std::string& level_str) { | 502 static bool IsValidH264Level(const std::string& level_str) { | 
| 503   uint32 level; | 503   uint32 level; | 
| 504   if (level_str.size() != 2 || !base::HexStringToUInt(level_str, &level)) | 504   if (level_str.size() != 2 || !base::HexStringToUInt(level_str, &level)) | 
| 505     return false; | 505     return false; | 
| 506 | 506 | 
| 507   // Valid levels taken from Table A-1 in ISO-14496-10. | 507   // Valid levels taken from Table A-1 in ISO-14496-10. | 
| 508   // Essentially |level_str| is toHex(10 * level). | 508   // Essentially |level_str| is toHex(10 * level). | 
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 649                       std::vector<std::string>* codecs_out, | 649                       std::vector<std::string>* codecs_out, | 
| 650                       const bool strip) { | 650                       const bool strip) { | 
| 651   g_media_mime_util.Get().ParseCodecString(codecs, codecs_out, strip); | 651   g_media_mime_util.Get().ParseCodecString(codecs, codecs_out, strip); | 
| 652 } | 652 } | 
| 653 | 653 | 
| 654 void RemoveProprietaryMediaTypesAndCodecsForTests() { | 654 void RemoveProprietaryMediaTypesAndCodecsForTests() { | 
| 655   g_media_mime_util.Get().RemoveProprietaryMediaTypesAndCodecsForTests(); | 655   g_media_mime_util.Get().RemoveProprietaryMediaTypesAndCodecsForTests(); | 
| 656 } | 656 } | 
| 657 | 657 | 
| 658 }  // namespace media | 658 }  // namespace media | 
| OLD | NEW | 
|---|