summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/Android.mk1
-rw-r--r--core/jni/android_hardware_camera2_CameraMetadata.cpp26
2 files changed, 27 insertions, 0 deletions
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index 0ad2ab2..99bbe39 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -228,6 +228,7 @@ LOCAL_SHARED_LIBRARIES := \
libz \
libaudioutils \
libpdfrenderer \
+ libimg_utils \
ifeq ($(USE_OPENGL_RENDERER),true)
LOCAL_SHARED_LIBRARIES += libhwui
diff --git a/core/jni/android_hardware_camera2_CameraMetadata.cpp b/core/jni/android_hardware_camera2_CameraMetadata.cpp
index fa2cfe3..3312109 100644
--- a/core/jni/android_hardware_camera2_CameraMetadata.cpp
+++ b/core/jni/android_hardware_camera2_CameraMetadata.cpp
@@ -30,6 +30,7 @@
#include "JNIHelp.h"
#include "android_os_Parcel.h"
#include "android_runtime/AndroidRuntime.h"
+#include "android_runtime/android_hardware_camera2_CameraMetadata.h"
#include <binder/IServiceManager.h>
#include <camera/CameraMetadata.h>
@@ -57,6 +58,31 @@ struct fields_t {
static fields_t fields;
+namespace android {
+
+status_t CameraMetadata_getNativeMetadata(JNIEnv* env, jobject thiz,
+ /*out*/CameraMetadata* metadata) {
+ if (!thiz) {
+ ALOGE("%s: Invalid java metadata object.", __FUNCTION__);
+ return BAD_VALUE;
+ }
+
+ if (!metadata) {
+ ALOGE("%s: Invalid output metadata object.", __FUNCTION__);
+ return BAD_VALUE;
+ }
+ CameraMetadata* nativePtr = reinterpret_cast<CameraMetadata*>(env->GetLongField(thiz,
+ fields.metadata_ptr));
+ if (nativePtr == NULL) {
+ ALOGE("%s: Invalid native pointer in java metadata object.", __FUNCTION__);
+ return BAD_VALUE;
+ }
+ *metadata = *nativePtr;
+ return OK;
+}
+
+} /*namespace android*/
+
namespace {
struct Helpers {
static size_t getTypeSize(uint8_t type) {