diff options
author | Chih-Chung Chang <chihchung@google.com> | 2010-01-22 17:49:48 -0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2010-01-26 11:07:07 -0800 |
commit | d1d7706fce19a9a0cf71ff9b65f3aba9b89eeb3b (patch) | |
tree | e4945abf24f406374fcc51fec3935fe3aeb57195 /core/jni | |
parent | 09ac3c3cbc6278af127cffedb9d534449e63b683 (diff) | |
download | frameworks_base-d1d7706fce19a9a0cf71ff9b65f3aba9b89eeb3b.zip frameworks_base-d1d7706fce19a9a0cf71ff9b65f3aba9b89eeb3b.tar.gz frameworks_base-d1d7706fce19a9a0cf71ff9b65f3aba9b89eeb3b.tar.bz2 |
Add support for setting camera display orientation.
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_hardware_Camera.cpp | 15 |
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 { |