Loading include/media/IHDCP.h +11 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,17 @@ struct IHDCP : public IInterface { // Request to shutdown the active HDCP session. virtual status_t shutdownAsync() = 0; // Returns the capability bitmask of this HDCP session. // Possible return values (please refer to HDCAPAPI.h): // HDCP_CAPS_ENCRYPT: mandatory, meaning the HDCP module can encrypt // from an input byte-array buffer to an output byte-array buffer // HDCP_CAPS_ENCRYPT_NATIVE: the HDCP module supports encryption from // a native buffer to an output byte-array buffer. The format of the // input native buffer is specific to vendor's encoder implementation. // It is the same format as that used by the encoder when // "storeMetaDataInBuffers" extension is enabled on its output port. virtual uint32_t getCaps() = 0; // ENCRYPTION only: // Encrypt data according to the HDCP spec. "size" bytes of data are // available at "inData" (virtual address), "size" may not be a multiple Loading media/libmedia/IHDCP.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ enum { HDCP_SET_OBSERVER, HDCP_INIT_ASYNC, HDCP_SHUTDOWN_ASYNC, HDCP_GET_CAPS, HDCP_ENCRYPT, HDCP_ENCRYPT_NATIVE, HDCP_DECRYPT, Loading Loading @@ -85,6 +86,13 @@ struct BpHDCP : public BpInterface<IHDCP> { return reply.readInt32(); } virtual uint32_t getCaps() { Parcel data, reply; data.writeInterfaceToken(IHDCP::getInterfaceDescriptor()); remote()->transact(HDCP_GET_CAPS, data, &reply); return reply.readInt32(); } virtual status_t encrypt( const void *inData, size_t size, uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { Loading Loading @@ -222,6 +230,14 @@ status_t BnHDCP::onTransact( return OK; } case HDCP_GET_CAPS: { CHECK_INTERFACE(IHDCP, data, reply); reply->writeInt32(getCaps()); return OK; } case HDCP_ENCRYPT: { size_t size = data.readInt32(); Loading media/libmediaplayerservice/HDCP.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,20 @@ status_t HDCP::shutdownAsync() { return mHDCPModule->shutdownAsync(); } uint32_t HDCP::getCaps() { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } // TO-DO: // Only support HDCP_CAPS_ENCRYPT (byte-array to byte-array) for now. // use mHDCPModule->getCaps() when the HDCP libraries get updated. //return mHDCPModule->getCaps(); return HDCPModule::HDCP_CAPS_ENCRYPT; } status_t HDCP::encrypt( const void *inData, size_t size, uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { Loading media/libmediaplayerservice/HDCP.h +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ struct HDCP : public BnHDCP { virtual status_t setObserver(const sp<IHDCPObserver> &observer); virtual status_t initAsync(const char *host, unsigned port); virtual status_t shutdownAsync(); virtual uint32_t getCaps(); virtual status_t encrypt( const void *inData, size_t size, uint32_t streamCTR, Loading media/libstagefright/wifi-display/source/PlaybackSession.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -939,7 +939,8 @@ status_t WifiDisplaySource::PlaybackSession::addSource( if (isVideo) { format->setString("mime", MEDIA_MIMETYPE_VIDEO_AVC); format->setInt32("store-metadata-in-buffers", true); format->setInt32("store-metadata-in-buffers-output", (mHDCP != NULL)); format->setInt32("store-metadata-in-buffers-output", (mHDCP != NULL) && (mHDCP->getCaps() & HDCPModule::HDCP_CAPS_ENCRYPT_NATIVE)); format->setInt32( "color-format", OMX_COLOR_FormatAndroidOpaque); format->setInt32("profile-idc", profileIdc); Loading Loading
include/media/IHDCP.h +11 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,17 @@ struct IHDCP : public IInterface { // Request to shutdown the active HDCP session. virtual status_t shutdownAsync() = 0; // Returns the capability bitmask of this HDCP session. // Possible return values (please refer to HDCAPAPI.h): // HDCP_CAPS_ENCRYPT: mandatory, meaning the HDCP module can encrypt // from an input byte-array buffer to an output byte-array buffer // HDCP_CAPS_ENCRYPT_NATIVE: the HDCP module supports encryption from // a native buffer to an output byte-array buffer. The format of the // input native buffer is specific to vendor's encoder implementation. // It is the same format as that used by the encoder when // "storeMetaDataInBuffers" extension is enabled on its output port. virtual uint32_t getCaps() = 0; // ENCRYPTION only: // Encrypt data according to the HDCP spec. "size" bytes of data are // available at "inData" (virtual address), "size" may not be a multiple Loading
media/libmedia/IHDCP.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ enum { HDCP_SET_OBSERVER, HDCP_INIT_ASYNC, HDCP_SHUTDOWN_ASYNC, HDCP_GET_CAPS, HDCP_ENCRYPT, HDCP_ENCRYPT_NATIVE, HDCP_DECRYPT, Loading Loading @@ -85,6 +86,13 @@ struct BpHDCP : public BpInterface<IHDCP> { return reply.readInt32(); } virtual uint32_t getCaps() { Parcel data, reply; data.writeInterfaceToken(IHDCP::getInterfaceDescriptor()); remote()->transact(HDCP_GET_CAPS, data, &reply); return reply.readInt32(); } virtual status_t encrypt( const void *inData, size_t size, uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { Loading Loading @@ -222,6 +230,14 @@ status_t BnHDCP::onTransact( return OK; } case HDCP_GET_CAPS: { CHECK_INTERFACE(IHDCP, data, reply); reply->writeInt32(getCaps()); return OK; } case HDCP_ENCRYPT: { size_t size = data.readInt32(); Loading
media/libmediaplayerservice/HDCP.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,20 @@ status_t HDCP::shutdownAsync() { return mHDCPModule->shutdownAsync(); } uint32_t HDCP::getCaps() { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } // TO-DO: // Only support HDCP_CAPS_ENCRYPT (byte-array to byte-array) for now. // use mHDCPModule->getCaps() when the HDCP libraries get updated. //return mHDCPModule->getCaps(); return HDCPModule::HDCP_CAPS_ENCRYPT; } status_t HDCP::encrypt( const void *inData, size_t size, uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { Loading
media/libmediaplayerservice/HDCP.h +1 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ struct HDCP : public BnHDCP { virtual status_t setObserver(const sp<IHDCPObserver> &observer); virtual status_t initAsync(const char *host, unsigned port); virtual status_t shutdownAsync(); virtual uint32_t getCaps(); virtual status_t encrypt( const void *inData, size_t size, uint32_t streamCTR, Loading
media/libstagefright/wifi-display/source/PlaybackSession.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -939,7 +939,8 @@ status_t WifiDisplaySource::PlaybackSession::addSource( if (isVideo) { format->setString("mime", MEDIA_MIMETYPE_VIDEO_AVC); format->setInt32("store-metadata-in-buffers", true); format->setInt32("store-metadata-in-buffers-output", (mHDCP != NULL)); format->setInt32("store-metadata-in-buffers-output", (mHDCP != NULL) && (mHDCP->getCaps() & HDCPModule::HDCP_CAPS_ENCRYPT_NATIVE)); format->setInt32( "color-format", OMX_COLOR_FormatAndroidOpaque); format->setInt32("profile-idc", profileIdc); Loading