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

Unified Diff: media/blink/key_system_config_selector.cc

Issue 2686133002: EME: Require codecs parameter for audio/videoCapabilities (Closed)
Patch Set: changes + additional test fixes Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/key_system_config_selector.cc
diff --git a/media/blink/key_system_config_selector.cc b/media/blink/key_system_config_selector.cc
index 441aed0f01a4ef5b262f5bada68bfbc197474331..57998696127b922bcb7bc8ffda611e29826626cf 100644
--- a/media/blink/key_system_config_selector.cc
+++ b/media/blink/key_system_config_selector.cc
@@ -306,22 +306,11 @@ bool IsSupportedMediaFormat(const std::string& container_mime_type,
use_aes_decryptor
? IsSupportedMediaFormat(container_mime_type, codec_vector)
: IsSupportedEncryptedMediaFormat(container_mime_type, codec_vector);
- switch (support_result) {
- case IsSupported:
- return true;
- case MayBeSupported:
- // If no codecs were specified, the best possible result is
- // MayBeSupported, indicating support for the container.
- return codec_vector.empty();
- case IsNotSupported:
- return false;
- }
- NOTREACHED();
- return false;
+ return (support_result == IsSupported);
}
// TODO(sandersd): Move contentType parsing from Blink to here so that invalid
-// parameters can be rejected. http://crbug.com/417561
+// parameters can be rejected. http://crbug.com/449690, http://crbug.com/690131
bool KeySystemConfigSelector::IsSupportedContentType(
const std::string& key_system,
EmeMediaType media_type,
@@ -334,17 +323,8 @@ bool KeySystemConfigSelector::IsSupportedContentType(
// contentTypes must provide a codec string unless the container implies a
// particular codec. For EME, none of the currently supported containers
// imply a codec, so |codecs| must be provided.
- if (codecs.empty()) {
- // Since the spec didn't initially require this, add an exemption for
- // some existing containers to give clients time to adapt.
- // TODO(jrummell): Remove this exemption once the number of contentTypes
- // without codecs drops low enough (UMA added in the blink code).
- // http://crbug.com/605661.
- if (container_lower != "audio/webm" && container_lower != "video/webm" &&
- container_lower != "audio/mp4" && container_lower != "video/mp4") {
- return false;
- }
- }
+ if (codecs.empty())
+ return false;
// Check that |container_mime_type| and |codecs| are supported by Chrome. This
// is done primarily to validate extended codecs, but it also ensures that the

Powered by Google App Engine
This is Rietveld 408576698