diff options
| author | Wu-cheng Li <wuchengli@google.com> | 2009-09-28 16:14:58 -0700 |
|---|---|---|
| committer | Wu-cheng Li <wuchengli@google.com> | 2009-10-06 13:25:10 -0700 |
| commit | 36f68b8f24df906c969581b0b8e1a47f95dc03cb (patch) | |
| tree | b1c8987ccd5b30c5527fc9abcfe275f163d8d8c5 /core/jni | |
| parent | 5bba632d877c2878384ff21566c8eb6a1a22f37b (diff) | |
| download | frameworks_base-36f68b8f24df906c969581b0b8e1a47f95dc03cb.zip frameworks_base-36f68b8f24df906c969581b0b8e1a47f95dc03cb.tar.gz frameworks_base-36f68b8f24df906c969581b0b8e1a47f95dc03cb.tar.bz2 | |
Add zoom functions and sendCommand.
b2060030
Diffstat (limited to 'core/jni')
| -rw-r--r-- | core/jni/android_hardware_Camera.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp index e944654..5b6bd35 100644 --- a/core/jni/android_hardware_Camera.cpp +++ b/core/jni/android_hardware_Camera.cpp @@ -413,6 +413,28 @@ static void android_hardware_Camera_unlock(JNIEnv *env, jobject thiz) } } +static void android_hardware_Camera_startSmoothZoom(JNIEnv *env, jobject thiz, jint value) +{ + LOGD("startSmoothZoom"); + sp<Camera> camera = get_native_camera(env, thiz, NULL); + if (camera == 0) return; + + if (camera->sendCommand(CAMERA_CMD_START_SMOOTH_ZOOM, value, 0) != NO_ERROR) { + jniThrowException(env, "java/lang/RuntimeException", "start smooth zoom failed"); + } +} + +static void android_hardware_Camera_stopSmoothZoom(JNIEnv *env, jobject thiz) +{ + LOGD("stopSmoothZoom"); + sp<Camera> camera = get_native_camera(env, thiz, NULL); + if (camera == 0) return; + + if (camera->sendCommand(CAMERA_CMD_STOP_SMOOTH_ZOOM, 0, 0) != NO_ERROR) { + jniThrowException(env, "java/lang/RuntimeException", "stop smooth zoom failed"); + } +} + //------------------------------------------------- static JNINativeMethod camMethods[] = { @@ -461,6 +483,12 @@ static JNINativeMethod camMethods[] = { { "unlock", "()V", (void*)android_hardware_Camera_unlock }, + { "startSmoothZoom", + "(I)V", + (void *)android_hardware_Camera_startSmoothZoom }, + { "stopSmoothZoom", + "()V", + (void *)android_hardware_Camera_stopSmoothZoom }, }; struct field { |
