am 0ca25191: Add some comments for zoom methods.
Merge commit '0ca25191c663ef229f1f475b17899f2017ed6980' into kraken * commit '0ca25191c663ef229f1f475b17899f2017ed6980': Add some comments for zoom methods.
This commit is contained in:
@@ -532,11 +532,15 @@ public class Camera {
|
|||||||
* called with value 3. Three ZoomCallback will be generated with zoom value
|
* called with value 3. Three ZoomCallback will be generated with zoom value
|
||||||
* 1, 2, and 3. The applications can call {@link #stopSmoothZoom} to stop
|
* 1, 2, and 3. The applications can call {@link #stopSmoothZoom} to stop
|
||||||
* the zoom earlier. The applications should not call startSmoothZoom again
|
* the zoom earlier. The applications should not call startSmoothZoom again
|
||||||
* or change the zoom value before zoom stops. This method is supported if
|
* or change the zoom value before zoom stops. If the passing zoom value
|
||||||
* {@link android.hardware.Camera.Parameters#isSmoothZoomSupported} is true.
|
* equals to the current zoom value, no zoom callback will be generated.
|
||||||
|
* This method is supported if {@link
|
||||||
|
* android.hardware.Camera.Parameters#isSmoothZoomSupported} is true.
|
||||||
*
|
*
|
||||||
* @param value zoom value. The valid range is 0 to {@link
|
* @param value zoom value. The valid range is 0 to {@link
|
||||||
* android.hardware.Camera.Parameters#getMaxZoom}.
|
* android.hardware.Camera.Parameters#getMaxZoom}.
|
||||||
|
* @throws IllegalArgumentException if the zoom value is invalid.
|
||||||
|
* @throws RuntimeException if the method fails.
|
||||||
*/
|
*/
|
||||||
public native final void startSmoothZoom(int value);
|
public native final void startSmoothZoom(int value);
|
||||||
|
|
||||||
@@ -545,6 +549,8 @@ public class Camera {
|
|||||||
* ZoomCallback} to know when the zoom is actually stopped. This method is
|
* ZoomCallback} to know when the zoom is actually stopped. This method is
|
||||||
* supported if {@link
|
* supported if {@link
|
||||||
* android.hardware.Camera.Parameters#isSmoothZoomSupported} is true.
|
* android.hardware.Camera.Parameters#isSmoothZoomSupported} is true.
|
||||||
|
*
|
||||||
|
* @throws RuntimeException if the method fails.
|
||||||
*/
|
*/
|
||||||
public native final void stopSmoothZoom();
|
public native final void stopSmoothZoom();
|
||||||
|
|
||||||
|
|||||||
@@ -530,7 +530,12 @@ static void android_hardware_Camera_startSmoothZoom(JNIEnv *env, jobject thiz, j
|
|||||||
sp<Camera> camera = get_native_camera(env, thiz, NULL);
|
sp<Camera> camera = get_native_camera(env, thiz, NULL);
|
||||||
if (camera == 0) return;
|
if (camera == 0) return;
|
||||||
|
|
||||||
if (camera->sendCommand(CAMERA_CMD_START_SMOOTH_ZOOM, value, 0) != NO_ERROR) {
|
status_t rc = camera->sendCommand(CAMERA_CMD_START_SMOOTH_ZOOM, value, 0);
|
||||||
|
if (rc == BAD_VALUE) {
|
||||||
|
char msg[64];
|
||||||
|
sprintf(msg, "invalid zoom value=%d", value);
|
||||||
|
jniThrowException(env, "java/lang/IllegalArgumentException", msg);
|
||||||
|
} else if (rc != NO_ERROR) {
|
||||||
jniThrowException(env, "java/lang/RuntimeException", "start smooth zoom failed");
|
jniThrowException(env, "java/lang/RuntimeException", "start smooth zoom failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
|
virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2)
|
||||||
{
|
{
|
||||||
LOGD("sendCommand");
|
LOGV("sendCommand");
|
||||||
Parcel data, reply;
|
Parcel data, reply;
|
||||||
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
|
data.writeInterfaceToken(ICamera::getInterfaceDescriptor());
|
||||||
data.writeInt32(cmd);
|
data.writeInt32(cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user