summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/HDCP.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-09-18 10:36:32 -0700
committerAndreas Huber <andih@google.com>2012-09-19 09:28:08 -0700
commitefbb781c15abf8e085f5ab8d39710bd58ea0b6e4 (patch)
treea2f28698970fc1b62495cee5d617e1037a0a957d /media/libmediaplayerservice/HDCP.cpp
parent74e58c55bc5259b957a51f1bb44a5911ad1f8400 (diff)
downloadframeworks_av-efbb781c15abf8e085f5ab8d39710bd58ea0b6e4.zip
frameworks_av-efbb781c15abf8e085f5ab8d39710bd58ea0b6e4.tar.gz
frameworks_av-efbb781c15abf8e085f5ab8d39710bd58ea0b6e4.tar.bz2
HDCP module binderized
Change-Id: I866768b1e3f3b232f1934a35b65f66befc12f3f6
Diffstat (limited to 'media/libmediaplayerservice/HDCP.cpp')
-rw-r--r--media/libmediaplayerservice/HDCP.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/HDCP.cpp b/media/libmediaplayerservice/HDCP.cpp
index 6f8a465..e7dea6e 100644
--- a/media/libmediaplayerservice/HDCP.cpp
+++ b/media/libmediaplayerservice/HDCP.cpp
@@ -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.");
}
}
@@ -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