summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2010-01-27 09:20:19 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-01-27 09:20:19 -0800
commit89e02edf6f92c034942b697be4eccea46930cdfb (patch)
tree849781b00d72345d5fb9a5774f2ccb608a2a13d9 /core/jni
parent02735bc9b7686e56957cdec9c10660c4a6dd1090 (diff)
parentd1d7706fce19a9a0cf71ff9b65f3aba9b89eeb3b (diff)
downloadframeworks_base-89e02edf6f92c034942b697be4eccea46930cdfb.zip
frameworks_base-89e02edf6f92c034942b697be4eccea46930cdfb.tar.gz
frameworks_base-89e02edf6f92c034942b697be4eccea46930cdfb.tar.bz2
Merge "Add support for setting camera display orientation."
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 {