Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d41a61f8 authored by Alok Kediya's avatar Alok Kediya Committed by Steve Kondik
Browse files

Camera: Add support for QC camera features.

Added APIs and keys for all QC features. This
will enable application to get/set paramters.
(cherrypicked from commit d0c5a0ee7e9af41320fed00ff324c6d0f22eb697)
Change-Id: I68c23aaf7267645efeb4d4743b390a048292b7fd
(cherry picked from commit ad2fd19b7ed6a610cab4bd3ae261178bcafa66af)
(cherry picked from commit cfcebdf9c402bb5f1976f07ba5dc1e15f5811fc2)
(cherry picked from commit 4ef4a5e937b2ec7355c5893c80dbc103d163364d)
parent 06d66fbc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1803,6 +1803,17 @@ public class Camera {
    }
    private native final void native_sendMetaData();

    /** @hide
     * Configure longshot mode. Available only in ZSL.
     *
     * @param enable enable/disable this mode
     */
    public final void setLongshot(boolean enable)
    {
        native_setLongshot(enable);
    }
    private native final void native_setLongshot(boolean enable);

     /** @hide
     * Handles the Touch Co-ordinate.
     */
+24 −0
Original line number Diff line number Diff line
@@ -385,6 +385,27 @@ void JNICameraContext::setCallbackMode(JNIEnv *env, bool installed, bool manualM
    }
}

static void android_hardware_Camera_setLongshot(JNIEnv *env, jobject thiz, jboolean enable)
{
    ALOGV("setLongshot");
#ifdef QCOM_HARDWARE
    JNICameraContext* context;
    status_t rc;
    sp<Camera> camera = get_native_camera(env, thiz, &context);
    if (camera == 0) return;

    if ( enable ) {
        rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_ON, 0, 0);
    } else {
        rc = camera->sendCommand(CAMERA_CMD_LONGSHOT_OFF, 0, 0);
    }

    if (rc != NO_ERROR) {
       jniThrowException(env, "java/lang/RuntimeException", "enabling longshot mode failed");
    }
#endif
}

static void android_hardware_Camera_sendHistogramData(JNIEnv *env, jobject thiz)
 {
   ALOGV("sendHistogramData" );
@@ -1005,6 +1026,9 @@ static JNINativeMethod camMethods[] = {
  { "native_sendHistogramData",
    "()V",
     (void *)android_hardware_Camera_sendHistogramData },
 { "native_setLongshot",
     "(Z)V",
      (void *)android_hardware_Camera_setLongshot },
  { "native_setParameters",
    "(Ljava/lang/String;)V",
    (void *)android_hardware_Camera_setParameters },
+9 −8
Original line number Diff line number Diff line
@@ -90,25 +90,26 @@ public class CamcorderProfile
     */
    public static final int QUALITY_QVGA = 7;

    /**
     * {@hide}
    /** @hide
     * Quality level corresponding to the FWVGA resolution.
     */
    public static final int QUALITY_FWVGA = 8;
    /**
     * {@hide}
    /** @hide
     * Quality level corresponding to the WVGA resolution.
     */
    public static final int QUALITY_WVGA = 9;

    /**
     * {@hide}
    /** @hide
     * Quality level corresponding to the VGA resolution.
     */
    public static final int QUALITY_VGA = 10;

    /**
     * {@hide}
    /** @hide
     * Quality level corresponding to the WQVGA resolution.
     */
    public static final int QUALITY_WQVGA = 11;


    // Start and end of quality list
    private static final int QUALITY_LIST_START = QUALITY_LOW;
    private static final int QUALITY_LIST_END = QUALITY_WQVGA;