summaryrefslogtreecommitdiffstats
path: root/components/cdm
diff options
context:
space:
mode:
authorsandersd <sandersd@chromium.org>2014-09-30 16:55:09 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-30 23:55:22 +0000
commit3573622da943ccb017e1dd93791a7efad5a3bcc8 (patch)
treeafaee486837fc0b967da71da604b0ce7d48ef354 /components/cdm
parenta683d267055e8b1cfd054986b8964b1a3456df55 (diff)
downloadchromium_src-3573622da943ccb017e1dd93791a7efad5a3bcc8.zip
chromium_src-3573622da943ccb017e1dd93791a7efad5a3bcc8.tar.gz
chromium_src-3573622da943ccb017e1dd93791a7efad5a3bcc8.tar.bz2
Implement Chromium side of MediaKeys.isTypeSupported().
BUG=405731 Review URL: https://codereview.chromium.org/557723003 Cr-Commit-Position: refs/heads/master@{#297550}
Diffstat (limited to 'components/cdm')
-rw-r--r--components/cdm/common/cdm_messages_android.h2
-rw-r--r--components/cdm/renderer/DEPS1
-rw-r--r--components/cdm/renderer/android_key_systems.cc10
-rw-r--r--components/cdm/renderer/widevine_key_systems.cc11
4 files changed, 23 insertions, 1 deletions
diff --git a/components/cdm/common/cdm_messages_android.h b/components/cdm/common/cdm_messages_android.h
index f78674d..8e0ad1c 100644
--- a/components/cdm/common/cdm_messages_android.h
+++ b/components/cdm/common/cdm_messages_android.h
@@ -7,7 +7,7 @@
#include <vector>
-#include "content/public/common/eme_codec.h"
+#include "content/public/common/eme_constants.h"
#include "ipc/ipc_message_macros.h"
#define IPC_MESSAGE_START EncryptedMediaMsgStart
diff --git a/components/cdm/renderer/DEPS b/components/cdm/renderer/DEPS
index 725e151..dbd28cf 100644
--- a/components/cdm/renderer/DEPS
+++ b/components/cdm/renderer/DEPS
@@ -1,3 +1,4 @@
include_rules = [
+ "+content/public/common",
"+content/public/renderer",
]
diff --git a/components/cdm/renderer/android_key_systems.cc b/components/cdm/renderer/android_key_systems.cc
index 99bc2bb..c6adc80 100644
--- a/components/cdm/renderer/android_key_systems.cc
+++ b/components/cdm/renderer/android_key_systems.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "components/cdm/common/cdm_messages_android.h"
#include "components/cdm/renderer/widevine_key_systems.h"
+#include "content/public/common/eme_constants.h"
#include "content/public/renderer/render_thread.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@@ -65,6 +66,15 @@ void AddAndroidPlatformKeySystems(
if (response.compositing_codecs != content::EME_CODEC_NONE) {
KeySystemInfo info(*it);
info.supported_codecs = response.compositing_codecs;
+ // Here we assume that support for a container implies support for the
+ // associated initialization data type. KeySystems handles validating
+ // |init_data_type| x |container| pairings.
+ if (response.compositing_codecs & content::EME_CODEC_WEBM_ALL)
+ info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_WEBM;
+#if defined(USE_PROPRIETARY_CODECS)
+ if (response.compositing_codecs & content::EME_CODEC_MP4_ALL)
+ info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_CENC;
+#endif // defined(USE_PROPRIETARY_CODECS)
concrete_key_systems->push_back(info);
}
}
diff --git a/components/cdm/renderer/widevine_key_systems.cc b/components/cdm/renderer/widevine_key_systems.cc
index 2a41322..d08b6ad 100644
--- a/components/cdm/renderer/widevine_key_systems.cc
+++ b/components/cdm/renderer/widevine_key_systems.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/logging.h"
+#include "content/public/common/eme_constants.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@@ -49,6 +50,16 @@ void AddWidevineWithCodecs(WidevineCdmType widevine_cdm_type,
// initDataType.
info.supported_codecs = supported_codecs;
+ // Here we assume that support for a container imples support for the
+ // associated initialization data type. KeySystems handles validating
+ // |init_data_type| x |container| pairings.
+ if (supported_codecs & content::EME_CODEC_WEBM_ALL)
+ info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_WEBM;
+#if defined(USE_PROPRIETARY_CODECS)
+ if (supported_codecs & content::EME_CODEC_MP4_ALL)
+ info.supported_init_data_types |= content::EME_INIT_DATA_TYPE_CENC;
+#endif // defined(USE_PROPRIETARY_CODECS)
+
#if defined(ENABLE_PEPPER_CDMS)
info.pepper_type = kWidevineCdmPluginMimeType;
#endif // defined(ENABLE_PEPPER_CDMS)