Loading include/media/drm/DrmAPI.h +59 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,9 @@ namespace android { kDrmPluginEventKeyNeeded, kDrmPluginEventKeyExpired, kDrmPluginEventVendorDefined, kDrmPluginEventSessionReclaimed kDrmPluginEventSessionReclaimed, kDrmPluginEventExpirationUpdate, kDrmPluginEventKeysChange, }; // Drm keys can be for offline content or for online streaming. Loading @@ -103,6 +105,24 @@ namespace android { kKeyRequestType_Release }; // Enumerate KeyStatusTypes which indicate the state of a key enum KeyStatusType { kKeyStatusType_Usable, kKeyStatusType_Expired, kKeyStatusType_OutputNotAllowed, kKeyStatusType_StatusPending, kKeyStatusType_InternalError }; // Used by sendKeysChange to report the usability status of each // key to the app. struct KeyStatus { Vector<uint8_t> mKeyId; KeyStatusType mType; }; DrmPlugin() {} virtual ~DrmPlugin() {} Loading Loading @@ -326,11 +346,18 @@ namespace android { } protected: // Plugins call sendEvent to deliver events to the java app // Plugins call these methods to deliver events to the java app void sendEvent(EventType eventType, int extra, Vector<uint8_t> const *sessionId, Vector<uint8_t> const *data); void sendExpirationUpdate(Vector<uint8_t> const *sessionId, int64_t expiryTimeInMS); void sendKeysChange(Vector<uint8_t> const *sessionId, Vector<DrmPlugin::KeyStatus> const *keyStatusList, bool hasNewUsableKey); private: Mutex mEventLock; sp<DrmPluginListener> mListener; Loading @@ -342,14 +369,20 @@ namespace android { { public: virtual void sendEvent(DrmPlugin::EventType eventType, int extra, Vector<uint8_t> const *sesionId, Vector<uint8_t> const *sessionId, Vector<uint8_t> const *data) = 0; virtual void sendExpirationUpdate(Vector<uint8_t> const *sessionId, int64_t expiryTimeInMS) = 0; virtual void sendKeysChange(Vector<uint8_t> const *sessionId, Vector<DrmPlugin::KeyStatus> const *keyStatusList, bool hasNewUsableKey) = 0; }; inline void DrmPlugin::sendEvent(EventType eventType, int extra, Vector<uint8_t> const *sessionId, Vector<uint8_t> const *data) { mEventLock.lock(); sp<DrmPluginListener> listener = mListener; mEventLock.unlock(); Loading @@ -359,6 +392,28 @@ namespace android { } } inline void DrmPlugin::sendExpirationUpdate(Vector<uint8_t> const *sessionId, int64_t expiryTimeInMS) { mEventLock.lock(); sp<DrmPluginListener> listener = mListener; mEventLock.unlock(); if (listener != NULL) { listener->sendExpirationUpdate(sessionId, expiryTimeInMS); } } inline void DrmPlugin::sendKeysChange(Vector<uint8_t> const *sessionId, Vector<DrmPlugin::KeyStatus> const *keyStatusList, bool hasNewUsableKey) { mEventLock.lock(); sp<DrmPluginListener> listener = mListener; mEventLock.unlock(); if (listener != NULL) { listener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey); } } } // namespace android #endif // DRM_API_H_ include/media/hardware/CryptoAPI.h +2 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,8 @@ struct CryptoPlugin { // the resolution of the video being decrypted. The media player should // call this method when the resolution is determined and any time it // is subsequently changed. virtual void notifyResolution(uint32_t width, uint32_t height) {} virtual void notifyResolution(uint32_t /* width */, uint32_t /* height */) {} // If the error returned falls into the range // ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX, errorDetailMsg should be Loading Loading
include/media/drm/DrmAPI.h +59 −4 Original line number Diff line number Diff line Loading @@ -81,7 +81,9 @@ namespace android { kDrmPluginEventKeyNeeded, kDrmPluginEventKeyExpired, kDrmPluginEventVendorDefined, kDrmPluginEventSessionReclaimed kDrmPluginEventSessionReclaimed, kDrmPluginEventExpirationUpdate, kDrmPluginEventKeysChange, }; // Drm keys can be for offline content or for online streaming. Loading @@ -103,6 +105,24 @@ namespace android { kKeyRequestType_Release }; // Enumerate KeyStatusTypes which indicate the state of a key enum KeyStatusType { kKeyStatusType_Usable, kKeyStatusType_Expired, kKeyStatusType_OutputNotAllowed, kKeyStatusType_StatusPending, kKeyStatusType_InternalError }; // Used by sendKeysChange to report the usability status of each // key to the app. struct KeyStatus { Vector<uint8_t> mKeyId; KeyStatusType mType; }; DrmPlugin() {} virtual ~DrmPlugin() {} Loading Loading @@ -326,11 +346,18 @@ namespace android { } protected: // Plugins call sendEvent to deliver events to the java app // Plugins call these methods to deliver events to the java app void sendEvent(EventType eventType, int extra, Vector<uint8_t> const *sessionId, Vector<uint8_t> const *data); void sendExpirationUpdate(Vector<uint8_t> const *sessionId, int64_t expiryTimeInMS); void sendKeysChange(Vector<uint8_t> const *sessionId, Vector<DrmPlugin::KeyStatus> const *keyStatusList, bool hasNewUsableKey); private: Mutex mEventLock; sp<DrmPluginListener> mListener; Loading @@ -342,14 +369,20 @@ namespace android { { public: virtual void sendEvent(DrmPlugin::EventType eventType, int extra, Vector<uint8_t> const *sesionId, Vector<uint8_t> const *sessionId, Vector<uint8_t> const *data) = 0; virtual void sendExpirationUpdate(Vector<uint8_t> const *sessionId, int64_t expiryTimeInMS) = 0; virtual void sendKeysChange(Vector<uint8_t> const *sessionId, Vector<DrmPlugin::KeyStatus> const *keyStatusList, bool hasNewUsableKey) = 0; }; inline void DrmPlugin::sendEvent(EventType eventType, int extra, Vector<uint8_t> const *sessionId, Vector<uint8_t> const *data) { mEventLock.lock(); sp<DrmPluginListener> listener = mListener; mEventLock.unlock(); Loading @@ -359,6 +392,28 @@ namespace android { } } inline void DrmPlugin::sendExpirationUpdate(Vector<uint8_t> const *sessionId, int64_t expiryTimeInMS) { mEventLock.lock(); sp<DrmPluginListener> listener = mListener; mEventLock.unlock(); if (listener != NULL) { listener->sendExpirationUpdate(sessionId, expiryTimeInMS); } } inline void DrmPlugin::sendKeysChange(Vector<uint8_t> const *sessionId, Vector<DrmPlugin::KeyStatus> const *keyStatusList, bool hasNewUsableKey) { mEventLock.lock(); sp<DrmPluginListener> listener = mListener; mEventLock.unlock(); if (listener != NULL) { listener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey); } } } // namespace android #endif // DRM_API_H_
include/media/hardware/CryptoAPI.h +2 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,8 @@ struct CryptoPlugin { // the resolution of the video being decrypted. The media player should // call this method when the resolution is determined and any time it // is subsequently changed. virtual void notifyResolution(uint32_t width, uint32_t height) {} virtual void notifyResolution(uint32_t /* width */, uint32_t /* height */) {} // If the error returned falls into the range // ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX, errorDetailMsg should be Loading