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

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 254983006: Fix: Adding list of supported codecs for MP4 containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments, adding mp4a to list Created 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/renderer/renderer_webkitplatformsupport_impl.h" 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 if (!key_system.isEmpty()) { 412 if (!key_system.isEmpty()) {
413 // Check whether the key system is supported with the mime_type and codecs. 413 // Check whether the key system is supported with the mime_type and codecs.
414 414
415 // Chromium only supports ASCII parameters. 415 // Chromium only supports ASCII parameters.
416 if (!base::IsStringASCII(key_system)) 416 if (!base::IsStringASCII(key_system))
417 return IsNotSupported; 417 return IsNotSupported;
418 418
419 std::string key_system_ascii = 419 std::string key_system_ascii =
420 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); 420 GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system));
421 std::vector<std::string> strict_codecs; 421 std::vector<std::string> strict_codecs;
422 bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); 422 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, true);
amogh.bihani 2014/05/16 11:25:29 ddorwin@ After adding mp4 containers in strict med
ddorwin 2014/05/16 17:26:24 This will allow "vp8.1", which it shouldn't. EME
AmoghBihani 2014/05/16 18:13:51 Well the test for vp8.1 will not pass as we next c
ddorwin 2014/05/16 18:49:49 Okay. It would be good to add tests to make sure w
423 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix);
424 423
425 if (!IsSupportedKeySystemWithMediaMimeType( 424 if (!IsSupportedKeySystemWithMediaMimeType(
426 mime_type_ascii, strict_codecs, key_system_ascii)) { 425 mime_type_ascii, strict_codecs, key_system_ascii)) {
427 return IsNotSupported; 426 return IsNotSupported;
428 } 427 }
429 428
430 // Continue processing the mime_type and codecs. 429 // Continue processing the mime_type and codecs.
431 } 430 }
432 431
433 // Check list of strict codecs to see if it is supported. 432 // Check list of strict codecs to see if it is supported.
434 if (net::IsStrictMediaMimeType(mime_type_ascii)) { 433 if (net::IsStrictMediaMimeType(mime_type_ascii)) {
435 // Check if the codecs are a perfect match. 434 // Check if the codecs are a perfect match.
436 std::vector<std::string> strict_codecs; 435 std::vector<std::string> strict_codecs;
437 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false); 436 net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, false);
438 if (net::IsSupportedStrictMediaMimeType(mime_type_ascii, strict_codecs)) 437 return static_cast<WebMimeRegistry::SupportsType> (
439 return IsSupported; 438 net::IsSupportedStrictMediaMimeType(mime_type_ascii,strict_codecs));
ddorwin 2014/05/16 17:26:24 nit: space after ','
440
441 // We support the container, but no codecs were specified.
442 if (codecs.isNull())
443 return MayBeSupported;
444
445 return IsNotSupported;
446 } 439 }
ddorwin 2014/05/16 17:26:24 Where is the "no codecs" case handled now?
AmoghBihani 2014/05/16 18:13:51 That has gone in mime_util.cc line 820 of this pat
447 440
448 // If we don't recognize the codec, it's possible we support it. 441 // If we don't recognize the codec, it's possible we support it.
449 std::vector<std::string> parsed_codecs; 442 std::vector<std::string> parsed_codecs;
450 net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true); 443 net::ParseCodecString(ToASCIIOrEmpty(codecs), &parsed_codecs, true);
451 if (!net::AreSupportedMediaCodecs(parsed_codecs)) 444 if (!net::AreSupportedMediaCodecs(parsed_codecs))
452 return MayBeSupported; 445 return MayBeSupported;
453 446
454 // Otherwise we have a perfect match. 447 // Otherwise we have a perfect match.
455 return IsSupported; 448 return IsSupported;
456 } 449 }
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 return; 1169 return;
1177 QuotaDispatcher::ThreadSpecificInstance( 1170 QuotaDispatcher::ThreadSpecificInstance(
1178 thread_safe_sender_.get(), 1171 thread_safe_sender_.get(),
1179 quota_message_filter_.get())->QueryStorageUsageAndQuota( 1172 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1180 storage_partition, 1173 storage_partition,
1181 static_cast<quota::StorageType>(type), 1174 static_cast<quota::StorageType>(type),
1182 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1175 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1183 } 1176 }
1184 1177
1185 } // namespace content 1178 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698