Loading include/media/IMediaPlayerService.h +2 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ namespace android { struct ICrypto; struct IHDCP; class IMediaRecorder; class IOMX; class IRemoteDisplay; Loading @@ -51,6 +52,7 @@ public: virtual sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0; virtual sp<IOMX> getOMX() = 0; virtual sp<ICrypto> makeCrypto() = 0; virtual sp<IHDCP> makeHDCP() = 0; // Connects to a remote display. // 'iface' specifies the address of the local interface on which to listen for Loading media/libmedia/IMediaPlayerService.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <binder/Parcel.h> #include <binder/IMemory.h> #include <media/ICrypto.h> #include <media/IHDCP.h> #include <media/IMediaPlayerService.h> #include <media/IMediaRecorder.h> #include <media/IOMX.h> Loading @@ -41,6 +42,7 @@ enum { CREATE_METADATA_RETRIEVER, GET_OMX, MAKE_CRYPTO, MAKE_HDCP, ENABLE_REMOTE_DISPLAY, ADD_BATTERY_DATA, PULL_BATTERY_DATA, Loading Loading @@ -125,6 +127,13 @@ public: return interface_cast<ICrypto>(reply.readStrongBinder()); } virtual sp<IHDCP> makeHDCP() { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); remote()->transact(MAKE_HDCP, data, &reply); return interface_cast<IHDCP>(reply.readStrongBinder()); } virtual status_t enableRemoteDisplay(const char *iface) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); Loading Loading @@ -237,6 +246,12 @@ status_t BnMediaPlayerService::onTransact( reply->writeStrongBinder(crypto->asBinder()); return NO_ERROR; } break; case MAKE_HDCP: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IHDCP> hdcp = makeHDCP(); reply->writeStrongBinder(hdcp->asBinder()); return NO_ERROR; } break; case ENABLE_REMOTE_DISPLAY: { CHECK_INTERFACE(IMediaPlayerService, data, reply); const char *iface = NULL; Loading media/libmediaplayerservice/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ ActivityManager.cpp \ Crypto.cpp \ HDCP.cpp \ MediaPlayerFactory.cpp \ MediaPlayerService.cpp \ MediaRecorderClient.cpp \ Loading media/libmediaplayerservice/HDCP.cpp +16 −2 Original line number Diff line number Diff line Loading @@ -36,13 +36,16 @@ HDCP::HDCP() return; } typedef HDCPModule *(*CreateHDCPModuleFunc)(); typedef HDCPModule *(*CreateHDCPModuleFunc)( void *, HDCPModule::ObserverFunc); CreateHDCPModuleFunc createHDCPModule = (CreateHDCPModuleFunc)dlsym(mLibHandle, "createHDCPModule"); if (createHDCPModule == NULL) { ALOGE("Unable to find symbol 'createHDCPModule'."); } else if ((mHDCPModule = createHDCPModule()) == NULL) { } else if ((mHDCPModule = createHDCPModule( this, &HDCP::ObserveWrapper)) == NULL) { ALOGE("createHDCPModule failed."); } } Loading Loading @@ -97,5 +100,16 @@ status_t HDCP::encrypt( return mHDCPModule->encrypt(inData, size, streamCTR, outInputCTR, outData); } // static void HDCP::ObserveWrapper(void *me, int msg, int ext1, int ext2) { static_cast<HDCP *>(me)->observe(msg, ext1, ext2); } void HDCP::observe(int msg, int ext1, int ext2) { if (mObserver != NULL) { mObserver->notify(msg, ext1, ext2, NULL /* obj */); } } } // namespace android media/libmediaplayerservice/HDCP.h +3 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,9 @@ private: HDCPModule *mHDCPModule; sp<IHDCPObserver> mObserver; static void ObserveWrapper(void *me, int msg, int ext1, int ext2); void observe(int msg, int ext1, int ext2); DISALLOW_EVIL_CONSTRUCTORS(HDCP); }; Loading Loading
include/media/IMediaPlayerService.h +2 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ namespace android { struct ICrypto; struct IHDCP; class IMediaRecorder; class IOMX; class IRemoteDisplay; Loading @@ -51,6 +52,7 @@ public: virtual sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0; virtual sp<IOMX> getOMX() = 0; virtual sp<ICrypto> makeCrypto() = 0; virtual sp<IHDCP> makeHDCP() = 0; // Connects to a remote display. // 'iface' specifies the address of the local interface on which to listen for Loading
media/libmedia/IMediaPlayerService.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <binder/Parcel.h> #include <binder/IMemory.h> #include <media/ICrypto.h> #include <media/IHDCP.h> #include <media/IMediaPlayerService.h> #include <media/IMediaRecorder.h> #include <media/IOMX.h> Loading @@ -41,6 +42,7 @@ enum { CREATE_METADATA_RETRIEVER, GET_OMX, MAKE_CRYPTO, MAKE_HDCP, ENABLE_REMOTE_DISPLAY, ADD_BATTERY_DATA, PULL_BATTERY_DATA, Loading Loading @@ -125,6 +127,13 @@ public: return interface_cast<ICrypto>(reply.readStrongBinder()); } virtual sp<IHDCP> makeHDCP() { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); remote()->transact(MAKE_HDCP, data, &reply); return interface_cast<IHDCP>(reply.readStrongBinder()); } virtual status_t enableRemoteDisplay(const char *iface) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); Loading Loading @@ -237,6 +246,12 @@ status_t BnMediaPlayerService::onTransact( reply->writeStrongBinder(crypto->asBinder()); return NO_ERROR; } break; case MAKE_HDCP: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IHDCP> hdcp = makeHDCP(); reply->writeStrongBinder(hdcp->asBinder()); return NO_ERROR; } break; case ENABLE_REMOTE_DISPLAY: { CHECK_INTERFACE(IMediaPlayerService, data, reply); const char *iface = NULL; Loading
media/libmediaplayerservice/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ ActivityManager.cpp \ Crypto.cpp \ HDCP.cpp \ MediaPlayerFactory.cpp \ MediaPlayerService.cpp \ MediaRecorderClient.cpp \ Loading
media/libmediaplayerservice/HDCP.cpp +16 −2 Original line number Diff line number Diff line Loading @@ -36,13 +36,16 @@ HDCP::HDCP() return; } typedef HDCPModule *(*CreateHDCPModuleFunc)(); typedef HDCPModule *(*CreateHDCPModuleFunc)( void *, HDCPModule::ObserverFunc); CreateHDCPModuleFunc createHDCPModule = (CreateHDCPModuleFunc)dlsym(mLibHandle, "createHDCPModule"); if (createHDCPModule == NULL) { ALOGE("Unable to find symbol 'createHDCPModule'."); } else if ((mHDCPModule = createHDCPModule()) == NULL) { } else if ((mHDCPModule = createHDCPModule( this, &HDCP::ObserveWrapper)) == NULL) { ALOGE("createHDCPModule failed."); } } Loading Loading @@ -97,5 +100,16 @@ status_t HDCP::encrypt( return mHDCPModule->encrypt(inData, size, streamCTR, outInputCTR, outData); } // static void HDCP::ObserveWrapper(void *me, int msg, int ext1, int ext2) { static_cast<HDCP *>(me)->observe(msg, ext1, ext2); } void HDCP::observe(int msg, int ext1, int ext2) { if (mObserver != NULL) { mObserver->notify(msg, ext1, ext2, NULL /* obj */); } } } // namespace android
media/libmediaplayerservice/HDCP.h +3 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,9 @@ private: HDCPModule *mHDCPModule; sp<IHDCPObserver> mObserver; static void ObserveWrapper(void *me, int msg, int ext1, int ext2); void observe(int msg, int ext1, int ext2); DISALLOW_EVIL_CONSTRUCTORS(HDCP); }; Loading