summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_hardware_Camera.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 64ee4f0..1a5987c 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -546,6 +546,18 @@ static void android_hardware_Camera_stopSmoothZoom(JNIEnv *env, jobject thiz)
}
}
+static void android_hardware_Camera_setDisplayOrientation(JNIEnv *env, jobject thiz,
+ jint value)
+{
+ LOGV("setDisplayOrientation");
+ sp<Camera> camera = get_native_camera(env, thiz, NULL);
+ if (camera == 0) return;
+
+ if (camera->sendCommand(CAMERA_CMD_SET_DISPLAY_ORIENTATION, value, 0) != NO_ERROR) {
+ jniThrowException(env, "java/lang/RuntimeException", "set display orientation failed");
+ }
+}
+
//-------------------------------------------------
static JNINativeMethod camMethods[] = {
@@ -603,6 +615,9 @@ static JNINativeMethod camMethods[] = {
{ "stopSmoothZoom",
"()V",
(void *)android_hardware_Camera_stopSmoothZoom },
+ { "setDisplayOrientation",
+ "(I)V",
+ (void *)android_hardware_Camera_setDisplayOrientation },
};
struct field {