aboutsummaryrefslogtreecommitdiff
path: root/mtk/libshims
diff options
context:
space:
mode:
authorMister Oyster <oysterized@gmail.com>2017-02-18 12:09:20 +0100
committerMister Oyster <oysterized@gmail.com>2017-02-18 19:03:20 +0100
commit51682badf56bba0e713c356e266942e9a604f6be (patch)
treedfdba77bb25029a73e71ec831687ea4c3c37f89e /mtk/libshims
parent40d100f243b36f25d25d5a1fde904b2ce7101107 (diff)
libshim: reorganize
* add xlog * add GraphicBufferC1Ejjij
Diffstat (limited to 'mtk/libshims')
-rw-r--r--mtk/libshims/Android.mk20
-rw-r--r--mtk/libshims/agps/icu53.c (renamed from mtk/libshims/icu53.c)0
-rw-r--r--mtk/libshims/agps/ssl.c (renamed from mtk/libshims/ssl.c)0
-rw-r--r--mtk/libshims/camera/mtk_cam.cpp21
-rw-r--r--mtk/libshims/camera/mtk_omx.cpp5
-rw-r--r--mtk/libshims/mtk_cam.cpp14
-rw-r--r--mtk/libshims/xlog.c38
7 files changed, 80 insertions, 18 deletions
diff --git a/mtk/libshims/Android.mk b/mtk/libshims/Android.mk
index 01b99e4..c199451 100644
--- a/mtk/libshims/Android.mk
+++ b/mtk/libshims/Android.mk
@@ -4,8 +4,8 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
- icu53.c \
- ssl.c
+ agps/icu53.c \
+ agps/ssl.c
LOCAL_SHARED_LIBRARIES := liblog libicuuc libicui18n libcrypto
LOCAL_MODULE := libshim_agps
@@ -36,14 +36,16 @@ include $(BUILD_SHARED_LIBRARY)
## libshim_cam
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := mtk_cam.cpp
+LOCAL_SRC_FILES := \
+ camera/mtk_cam.cpp \
+ camera/mtk_omx.cpp
LOCAL_SHARED_LIBRARIES := libbinder libgui libui
LOCAL_MODULE := libshim_cam
include $(BUILD_SHARED_LIBRARY)
-### libshim_snd
+## libshim_snd
include $(CLEAR_VARS)
LOCAL_SRC_FILES := mtk_audio.cpp
@@ -52,3 +54,13 @@ LOCAL_SHARED_LIBRARIES := libbinder
LOCAL_MODULE := libshim_snd
include $(BUILD_SHARED_LIBRARY)
+
+## libshim_xlog
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := xlog.c
+
+LOCAL_SHARED_LIBRARIES := liblog
+LOCAL_MODULE := libshim_xlog
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/mtk/libshims/icu53.c b/mtk/libshims/agps/icu53.c
index a7752fd..a7752fd 100644
--- a/mtk/libshims/icu53.c
+++ b/mtk/libshims/agps/icu53.c
diff --git a/mtk/libshims/ssl.c b/mtk/libshims/agps/ssl.c
index 894c51e..894c51e 100644
--- a/mtk/libshims/ssl.c
+++ b/mtk/libshims/agps/ssl.c
diff --git a/mtk/libshims/camera/mtk_cam.cpp b/mtk/libshims/camera/mtk_cam.cpp
new file mode 100644
index 0000000..8895113
--- /dev/null
+++ b/mtk/libshims/camera/mtk_cam.cpp
@@ -0,0 +1,21 @@
+#include <ui/GraphicBufferMapper.h>
+#include <ui/PixelFormat.h>
+#include <ui/Rect.h>
+
+extern "C" {
+ void _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPv(buffer_handle_t, uint32_t, const android::Rect&, void**);
+
+ void _ZN7android19GraphicBufferMapper4lockEPK13native_handleiRKNS_4RectEPPv(buffer_handle_t handle, int usage, const android::Rect& bounds, void** vaddr) {
+ _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPv(handle, static_cast<uint32_t>(usage), bounds, vaddr);
+ }
+
+ void _ZN7android13GraphicBufferC1EjjijNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE(
+ uint32_t inWidth, uint32_t inHeight, android::PixelFormat inFormat,
+ uint32_t inUsage, std::string requestorName);
+
+ void _ZN7android13GraphicBufferC1Ejjij(uint32_t inWidth, uint32_t inHeight, int32_t inFormat, uint32_t inUsage) {
+ _ZN7android13GraphicBufferC1EjjijNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE(
+ inWidth, inHeight, inFormat, inUsage, "<Unknown>");
+ }
+
+}
diff --git a/mtk/libshims/camera/mtk_omx.cpp b/mtk/libshims/camera/mtk_omx.cpp
new file mode 100644
index 0000000..5145e46
--- /dev/null
+++ b/mtk/libshims/camera/mtk_omx.cpp
@@ -0,0 +1,5 @@
+extern "C" {
+ void _ZN7android13AwesomePlayer24mtk_omx_get_current_timeEPx(long long* time){
+ time = (long long*)-1;
+ }
+} \ No newline at end of file
diff --git a/mtk/libshims/mtk_cam.cpp b/mtk/libshims/mtk_cam.cpp
deleted file mode 100644
index 799f987..0000000
--- a/mtk/libshims/mtk_cam.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <ui/GraphicBufferMapper.h>
-#include <ui/Rect.h>
-
-extern "C" {
- void _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPv(buffer_handle_t, uint32_t, const android::Rect&, void**);
-
- void _ZN7android19GraphicBufferMapper4lockEPK13native_handleiRKNS_4RectEPPv(buffer_handle_t handle, int usage, const android::Rect& bounds, void** vaddr) {
- _ZN7android19GraphicBufferMapper4lockEPK13native_handlejRKNS_4RectEPPv(handle, static_cast<uint32_t>(usage), bounds, vaddr);
- }
-
- void _ZN7android13AwesomePlayer24mtk_omx_get_current_timeEPx(long long* time){
- time = (long long*)-1;
- }
-}
diff --git a/mtk/libshims/xlog.c b/mtk/libshims/xlog.c
new file mode 100644
index 0000000..d0c1547
--- /dev/null
+++ b/mtk/libshims/xlog.c
@@ -0,0 +1,38 @@
+#include <cutils/log.h>
+
+struct xlog_record {
+ const char *tag_str;
+ const char *fmt_str;
+ int prio;
+};
+
+void __attribute__((weak)) __xlog_buf_printf(__unused int bufid, const struct xlog_record *xlog_record, ...) {
+ va_list args;
+ va_start(args, xlog_record);
+#if HAVE_LIBC_SYSTEM_PROPERTIES
+ int len = 0;
+ int do_xlog = 0;
+ char results[PROP_VALUE_MAX];
+
+
+ // MobileLog
+ len = __system_property_get ("debug.MB.running", results);
+ if (len && atoi(results))
+ do_xlog = 1;
+
+ // ModemLog
+ len = __system_property_get ("debug.mdlogger.Running", results);
+ if (len && atoi(results))
+ do_xlog = 1;
+
+ // Manual
+ len = __system_property_get ("persist.debug.xlog.enable", results);
+ if (len && atoi(results))
+ do_xlog = 1;
+
+ if (do_xlog > 0)
+#endif
+ __android_log_vprint(xlog_record->prio, xlog_record->tag_str, xlog_record->fmt_str, args);
+
+ return;
+}