Add Yet More Backwards-Compatibility

It turns out the array of things certain apps pass as the MIME type is
greater than we believed. To support this, we will treat anything that
is not a known type as video/mp4 to mimic old behavior.

(This is a merge of https://widevine-internal-review.googlesource.com/9636
from the Widevine CDM repo.)

Bug: 13750843
Change-Id: I4b7bbe7d266ade9b35c6c5beb21502bf0715b854
This commit is contained in:
John "Juce" Bruce
2014-04-01 15:42:03 -07:00
parent ef875d25ed
commit b920034e3b

View File

@@ -151,19 +151,11 @@ status_t WVDrmPlugin::getKeyRequest(
string cdmMimeType = mimeType.string();
// Provide backwards-compatibility for versions of apps that pass the wrong
// MIME type.
// TODO(b/13731637) - Remove this.
if (cdmMimeType == "") {
ALOGW("ALERT: Empty MIME type is supported for backwards-compatibility "
"only and may go away in the future. Switch to \"video/mp4\" to "
"become compliant.");
cdmMimeType = "video/mp4";
} else if (cdmMimeType == "video/avc") {
ALOGW("ALERT: MIME type \"video/avc\" is supported for backwards-"
"compatibility only and may go away in the future. Switch to "
"\"video/mp4\" to become compliant.");
cdmMimeType = "video/mp4";
// Provide backwards-compatibility for apps that pass non-EME-compatible MIME
// types.
if (cdmMimeType != wvcdm::ISO_BMFF_MIME_TYPE &&
cdmMimeType != wvcdm::WEBM_MIME_TYPE) {
cdmMimeType = wvcdm::ISO_BMFF_MIME_TYPE;
}
CdmInitData processedInitData;