summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2013-08-21 11:59:23 -0700
committerJeff Tinker <jtinker@google.com>2013-08-22 09:27:35 -0700
commit9cf69e0fc110f17c28e988ed0f9bf91abfaf710d (patch)
treec5cb3fb67b26c852f8c7bea7e4eeb87952830842 /media/libmediaplayerservice
parent75c16dde986e16ac5fd4d34b06b0cc6a90679866 (diff)
downloadframeworks_av-9cf69e0fc110f17c28e988ed0f9bf91abfaf710d.zip
frameworks_av-9cf69e0fc110f17c28e988ed0f9bf91abfaf710d.tar.gz
frameworks_av-9cf69e0fc110f17c28e988ed0f9bf91abfaf710d.tar.bz2
Add ability to test supported content types to MediaDrm
bug: 10244066 Change-Id: I317f05b146db962c271893f6208890a5a6c396f1
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r--media/libmediaplayerservice/Drm.cpp13
-rw-r--r--media/libmediaplayerservice/Drm.h2
2 files changed, 9 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/Drm.cpp b/media/libmediaplayerservice/Drm.cpp
index f00f488..4b527d0 100644
--- a/media/libmediaplayerservice/Drm.cpp
+++ b/media/libmediaplayerservice/Drm.cpp
@@ -211,15 +211,18 @@ bool Drm::loadLibraryForScheme(const String8 &path, const uint8_t uuid[16]) {
return true;
}
-bool Drm::isCryptoSchemeSupported(const uint8_t uuid[16]) {
+bool Drm::isCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType) {
+
Mutex::Autolock autoLock(mLock);
- if (mFactory && mFactory->isCryptoSchemeSupported(uuid)) {
- return true;
+ if (!mFactory || !mFactory->isCryptoSchemeSupported(uuid)) {
+ findFactoryForScheme(uuid);
+ if (mInitCheck != OK) {
+ return false;
+ }
}
- findFactoryForScheme(uuid);
- return (mInitCheck == OK);
+ return mFactory->isContentTypeSupported(mimeType);
}
status_t Drm::createPlugin(const uint8_t uuid[16]) {
diff --git a/media/libmediaplayerservice/Drm.h b/media/libmediaplayerservice/Drm.h
index 3f460f1..119fd50 100644
--- a/media/libmediaplayerservice/Drm.h
+++ b/media/libmediaplayerservice/Drm.h
@@ -37,7 +37,7 @@ struct Drm : public BnDrm,
virtual status_t initCheck() const;
- virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]);
+ virtual bool isCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType);
virtual status_t createPlugin(const uint8_t uuid[16]);