Loading drm/mediadrm/plugins/clearkey/aidl/DrmFactory.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -72,7 +72,8 @@ using ::aidl::android::hardware::drm::Uuid; // This should match the in_mimeTypes handed by InitDataParser. // This should match the in_mimeTypes handed by InitDataParser. *_aidl_return = in_mimeType == kIsoBmffVideoMimeType || in_mimeType == kIsoBmffAudioMimeType || *_aidl_return = in_mimeType == kIsoBmffVideoMimeType || in_mimeType == kIsoBmffAudioMimeType || in_mimeType == kCencInitDataFormat || in_mimeType == kWebmVideoMimeType || in_mimeType == kCencInitDataFormat || in_mimeType == kWebmVideoMimeType || in_mimeType == kWebmAudioMimeType || in_mimeType == kWebmInitDataFormat; in_mimeType == kWebmAudioMimeType || in_mimeType == kWebmInitDataFormat || in_mimeType.empty(); return ::ndk::ScopedAStatus::ok(); return ::ndk::ScopedAStatus::ok(); } } Loading @@ -85,7 +86,9 @@ using ::aidl::android::hardware::drm::Uuid; ALOGD("%s mime type is not supported by crypto scheme", in_mimeType.c_str()); ALOGD("%s mime type is not supported by crypto scheme", in_mimeType.c_str()); } } *_aidl_return = isClearKeyUUID(in_uuid.uuid.data()) && isSupportedMimeType && *_aidl_return = isClearKeyUUID(in_uuid.uuid.data()) && isSupportedMimeType && in_securityLevel == SecurityLevel::SW_SECURE_CRYPTO; (in_securityLevel == SecurityLevel::SW_SECURE_CRYPTO || in_securityLevel == SecurityLevel::DEFAULT || in_securityLevel == SecurityLevel::UNKNOWN); return ::ndk::ScopedAStatus::ok(); return ::ndk::ScopedAStatus::ok(); } } Loading drm/mediadrm/plugins/clearkey/aidl/DrmPlugin.cpp +9 −7 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <inttypes.h> #include <inttypes.h> #include <stdio.h> #include <stdio.h> #include <chrono> #include <chrono> #include <set> #include "AidlUtils.h" #include "AidlUtils.h" #include "ClearKeyDrmProperties.h" #include "ClearKeyDrmProperties.h" Loading Loading @@ -188,7 +189,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { const std::vector<uint8_t> scopeId = in_scope; const std::vector<uint8_t> scopeId = in_scope; ::android::sp<Session> session; ::android::sp<Session> session; if (in_keyType == KeyType::STREAMING || in_keyType == KeyType::OFFLINE) { std::set<KeyType> init_types{KeyType::STREAMING, KeyType::OFFLINE}; if (init_types.count(in_keyType)) { std::vector<uint8_t> sessionId(scopeId.begin(), scopeId.end()); std::vector<uint8_t> sessionId(scopeId.begin(), scopeId.end()); session = mSessionLibrary->findSession(sessionId); session = mSessionLibrary->findSession(sessionId); if (!session.get()) { if (!session.get()) { Loading Loading @@ -402,8 +404,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { auto itr = mSecureStops.find(in_secureStopId.secureStopId); auto itr = mSecureStops.find(in_secureStopId.secureStopId); if (itr != mSecureStops.end()) { if (itr != mSecureStops.end()) { ClearkeySecureStop clearkeyStop = itr->second; ClearkeySecureStop clearkeyStop = itr->second; stop.assign(clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.insert(stop.end(), clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.assign(clearkeyStop.data.begin(), clearkeyStop.data.end()); stop.insert(stop.end(), clearkeyStop.data.begin(), clearkeyStop.data.end()); } } mSecureStopLock.unlock(); mSecureStopLock.unlock(); Loading Loading @@ -439,9 +441,9 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { std::vector<::aidl::android::hardware::drm::SecureStop> stops; std::vector<::aidl::android::hardware::drm::SecureStop> stops; for (auto itr = mSecureStops.begin(); itr != mSecureStops.end(); ++itr) { for (auto itr = mSecureStops.begin(); itr != mSecureStops.end(); ++itr) { ClearkeySecureStop clearkeyStop = itr->second; ClearkeySecureStop clearkeyStop = itr->second; std::vector<uint8_t> stop = {}; std::vector<uint8_t> stop{}; stop.assign(clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.insert(stop.end(), clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.assign(clearkeyStop.data.begin(), clearkeyStop.data.end()); stop.insert(stop.end(), clearkeyStop.data.begin(), clearkeyStop.data.end()); SecureStop secureStop; SecureStop secureStop; secureStop.opaqueData = stop; secureStop.opaqueData = stop; Loading Loading @@ -476,7 +478,7 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { return toNdkScopedAStatus(Status::ERROR_DRM_INVALID_STATE); return toNdkScopedAStatus(Status::ERROR_DRM_INVALID_STATE); } } *_aidl_return = itr->second; *_aidl_return = SecurityLevel::SW_SECURE_CRYPTO; return toNdkScopedAStatus(Status::OK); return toNdkScopedAStatus(Status::OK); } } Loading drm/mediadrm/plugins/clearkey/common/include/clearkeydrm/SessionLibrary.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ namespace clearkeydrm { namespace clearkeydrm { class SessionLibrary : public ::android::RefBase { class SessionLibrary { public: public: static SessionLibrary* get(); static SessionLibrary* get(); Loading Loading
drm/mediadrm/plugins/clearkey/aidl/DrmFactory.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -72,7 +72,8 @@ using ::aidl::android::hardware::drm::Uuid; // This should match the in_mimeTypes handed by InitDataParser. // This should match the in_mimeTypes handed by InitDataParser. *_aidl_return = in_mimeType == kIsoBmffVideoMimeType || in_mimeType == kIsoBmffAudioMimeType || *_aidl_return = in_mimeType == kIsoBmffVideoMimeType || in_mimeType == kIsoBmffAudioMimeType || in_mimeType == kCencInitDataFormat || in_mimeType == kWebmVideoMimeType || in_mimeType == kCencInitDataFormat || in_mimeType == kWebmVideoMimeType || in_mimeType == kWebmAudioMimeType || in_mimeType == kWebmInitDataFormat; in_mimeType == kWebmAudioMimeType || in_mimeType == kWebmInitDataFormat || in_mimeType.empty(); return ::ndk::ScopedAStatus::ok(); return ::ndk::ScopedAStatus::ok(); } } Loading @@ -85,7 +86,9 @@ using ::aidl::android::hardware::drm::Uuid; ALOGD("%s mime type is not supported by crypto scheme", in_mimeType.c_str()); ALOGD("%s mime type is not supported by crypto scheme", in_mimeType.c_str()); } } *_aidl_return = isClearKeyUUID(in_uuid.uuid.data()) && isSupportedMimeType && *_aidl_return = isClearKeyUUID(in_uuid.uuid.data()) && isSupportedMimeType && in_securityLevel == SecurityLevel::SW_SECURE_CRYPTO; (in_securityLevel == SecurityLevel::SW_SECURE_CRYPTO || in_securityLevel == SecurityLevel::DEFAULT || in_securityLevel == SecurityLevel::UNKNOWN); return ::ndk::ScopedAStatus::ok(); return ::ndk::ScopedAStatus::ok(); } } Loading
drm/mediadrm/plugins/clearkey/aidl/DrmPlugin.cpp +9 −7 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <inttypes.h> #include <inttypes.h> #include <stdio.h> #include <stdio.h> #include <chrono> #include <chrono> #include <set> #include "AidlUtils.h" #include "AidlUtils.h" #include "ClearKeyDrmProperties.h" #include "ClearKeyDrmProperties.h" Loading Loading @@ -188,7 +189,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { const std::vector<uint8_t> scopeId = in_scope; const std::vector<uint8_t> scopeId = in_scope; ::android::sp<Session> session; ::android::sp<Session> session; if (in_keyType == KeyType::STREAMING || in_keyType == KeyType::OFFLINE) { std::set<KeyType> init_types{KeyType::STREAMING, KeyType::OFFLINE}; if (init_types.count(in_keyType)) { std::vector<uint8_t> sessionId(scopeId.begin(), scopeId.end()); std::vector<uint8_t> sessionId(scopeId.begin(), scopeId.end()); session = mSessionLibrary->findSession(sessionId); session = mSessionLibrary->findSession(sessionId); if (!session.get()) { if (!session.get()) { Loading Loading @@ -402,8 +404,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { auto itr = mSecureStops.find(in_secureStopId.secureStopId); auto itr = mSecureStops.find(in_secureStopId.secureStopId); if (itr != mSecureStops.end()) { if (itr != mSecureStops.end()) { ClearkeySecureStop clearkeyStop = itr->second; ClearkeySecureStop clearkeyStop = itr->second; stop.assign(clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.insert(stop.end(), clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.assign(clearkeyStop.data.begin(), clearkeyStop.data.end()); stop.insert(stop.end(), clearkeyStop.data.begin(), clearkeyStop.data.end()); } } mSecureStopLock.unlock(); mSecureStopLock.unlock(); Loading Loading @@ -439,9 +441,9 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { std::vector<::aidl::android::hardware::drm::SecureStop> stops; std::vector<::aidl::android::hardware::drm::SecureStop> stops; for (auto itr = mSecureStops.begin(); itr != mSecureStops.end(); ++itr) { for (auto itr = mSecureStops.begin(); itr != mSecureStops.end(); ++itr) { ClearkeySecureStop clearkeyStop = itr->second; ClearkeySecureStop clearkeyStop = itr->second; std::vector<uint8_t> stop = {}; std::vector<uint8_t> stop{}; stop.assign(clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.insert(stop.end(), clearkeyStop.id.begin(), clearkeyStop.id.end()); stop.assign(clearkeyStop.data.begin(), clearkeyStop.data.end()); stop.insert(stop.end(), clearkeyStop.data.begin(), clearkeyStop.data.end()); SecureStop secureStop; SecureStop secureStop; secureStop.opaqueData = stop; secureStop.opaqueData = stop; Loading Loading @@ -476,7 +478,7 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) { return toNdkScopedAStatus(Status::ERROR_DRM_INVALID_STATE); return toNdkScopedAStatus(Status::ERROR_DRM_INVALID_STATE); } } *_aidl_return = itr->second; *_aidl_return = SecurityLevel::SW_SECURE_CRYPTO; return toNdkScopedAStatus(Status::OK); return toNdkScopedAStatus(Status::OK); } } Loading
drm/mediadrm/plugins/clearkey/common/include/clearkeydrm/SessionLibrary.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,7 @@ namespace clearkeydrm { namespace clearkeydrm { class SessionLibrary : public ::android::RefBase { class SessionLibrary { public: public: static SessionLibrary* get(); static SessionLibrary* get(); Loading