summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-01-09 08:11:02 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-01-26 18:17:07 +0100
commit5a71d9a26b8421903b3b468876cb6def5ddd9341 (patch)
treec2c00df1d2290bc9c28d65fba88bc682afd2d621
parentc78f741549ad28ef7ea639a8a35715d7f8f9417b (diff)
downloadandroid_device_samsung_sltexx-5a71d9a26b8421903b3b468876cb6def5ddd9341.tar.gz
android_device_samsung_sltexx-5a71d9a26b8421903b3b468876cb6def5ddd9341.tar.xz
android_device_samsung_sltexx-5a71d9a26b8421903b3b468876cb6def5ddd9341.zip
WIP: shim: Add missing functions for widevine
-rw-r--r--device.mk7
-rwxr-xr-xramdisk/init.universal5430.rc2
-rw-r--r--sepolicy/init.te1
-rw-r--r--shim/Android.mk10
-rw-r--r--shim/wvm.cpp63
5 files changed, 82 insertions, 1 deletions
diff --git a/device.mk b/device.mk
index 4df05f2..f33311e 100644
--- a/device.mk
+++ b/device.mk
@@ -211,6 +211,13 @@ PRODUCT_PACKAGES += \
memtrack.exynos5
###########################################################
+### WVM
+###########################################################
+
+PRODUCT_PACKAGES += \
+ libshim_wvm
+
+###########################################################
### GPS
###########################################################
diff --git a/ramdisk/init.universal5430.rc b/ramdisk/init.universal5430.rc
index 537be29..7697eea 100755
--- a/ramdisk/init.universal5430.rc
+++ b/ramdisk/init.universal5430.rc
@@ -7,7 +7,7 @@ on early-init
mount debugfs /sys/kernel/debug /sys/kernel/debug
on init
- export LD_SHIM_LIBS "/system/lib/libexynoscamera.so|libshim_camera.so:/system/bin/gpsd|libshim_gpsd.so"
+ export LD_SHIM_LIBS "/system/lib/libexynoscamera.so|libshim_camera.so:/system/bin/gpsd|libshim_gpsd.so:/system/vendor/lib/libwvm.so|libshim_wvm.so"
symlink /sdcard /storage/sdcard0
symlink /sdcard1 /storage/sdcard1
diff --git a/sepolicy/init.te b/sepolicy/init.te
index 3ffad1e..6fd89b4 100644
--- a/sepolicy/init.te
+++ b/sepolicy/init.te
@@ -17,3 +17,4 @@ allow init sdcardd_exec:file r_file_perms;
# LD_SHIM_LIBS
allow init gpsd:process { noatsecure };
allow init mediaserver:process { noatsecure };
+allow init mediadrmserver:process { noatsecure };
diff --git a/shim/Android.mk b/shim/Android.mk
index 37c0f30..015b7ba 100644
--- a/shim/Android.mk
+++ b/shim/Android.mk
@@ -34,3 +34,13 @@ LOCAL_MODULE := libshim_gpsd
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
+
+## WVM
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := wvm.cpp
+LOCAL_SHARED_LIBRARIES := libstagefright_foundation libmedia
+LOCAL_MODULE := libshim_wvm
+LOCAL_MODULE_TAGS := optional
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/shim/wvm.cpp b/shim/wvm.cpp
new file mode 100644
index 0000000..1003135
--- /dev/null
+++ b/shim/wvm.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2016 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+#include <signal.h>
+
+#include <media/stagefright/MediaBuffer.h>
+
+extern "C" {
+
+/* MediaBufferGroup::MediaBufferGroup */
+int _ZN7android16MediaBufferGroupC1Ej(size_t growthLimit);
+size_t _ZN7android16MediaBufferGroup14acquire_bufferEPPNS_11MediaBufferEbj(android::MediaBuffer **buffer, bool nonBlock, size_t reqSize);
+bool _ZNK7android12IMediaSource11ReadOptions9getSeekToEPxPNS1_8SeekModeE(int64_t *time_us, int32_t *mode);
+int64_t _ZNK7android12IMediaSource11ReadOptions9getLateByEv(void);
+bool _ZNK7android12IMediaSource11ReadOptions14getNonBlockingEv(void);
+
+/* libstatefright_foundation */
+int _ZN7android16MediaBufferGroupC1Ev(void)
+{
+ return _ZN7android16MediaBufferGroupC1Ej(0); /* default: growthLimit = 0 */
+}
+
+size_t _ZN7android16MediaBufferGroup14acquire_bufferEPPNS_11MediaBufferEb(android::MediaBuffer **buffer, bool nonBlock, size_t reqSize)
+{
+ return _ZN7android16MediaBufferGroup14acquire_bufferEPPNS_11MediaBufferEbj(buffer, nonBlock, reqSize);
+}
+
+/* libmedia */
+bool _ZNK7android11MediaSource11ReadOptions9getSeekToEPxPNS1_8SeekModeE(int64_t *time_us, int32_t *mode)
+{
+ return _ZNK7android12IMediaSource11ReadOptions9getSeekToEPxPNS1_8SeekModeE(time_us, mode);
+}
+
+int64_t _ZNK7android11MediaSource11ReadOptions9getLateByEv(void)
+{
+ return _ZNK7android12IMediaSource11ReadOptions9getLateByEv();
+}
+
+bool _ZNK7android11MediaSource11ReadOptions14getNonBlockingEv(void)
+{
+ return _ZNK7android12IMediaSource11ReadOptions14getNonBlockingEv();
+}
+
+sighandler_t bsd_signal(int signum, sighandler_t handler)
+{
+ return signal(signum, handler);
+}
+
+} /* extern */