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

Commit d8da01a0 authored by Apurva Rajguru's avatar Apurva Rajguru 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.

Change-Id: I58a53c7b9133a3acddc34b268dac086c9562d533
parent ef7e964c
Loading
Loading
Loading
Loading
+1112 −0

File changed.

Preview size limit exceeded, changes collapsed.

+41 −0
Original line number Diff line number Diff line
@@ -385,6 +385,41 @@ void JNICameraContext::setCallbackMode(JNIEnv *env, bool installed, bool manualM
    }
}

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

   rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_SEND_DATA, 0, 0);

   if (rc != NO_ERROR) {
      jniThrowException(env, "java/lang/RuntimeException", "send histogram data failed");
    }
#endif
 }
 static void android_hardware_Camera_setHistogramMode(JNIEnv *env, jobject thiz, jboolean mode)
 {
   ALOGV("setHistogramMode: mode:%d", (int)mode);
#ifdef QCOM_HARDWARE
   JNICameraContext* context;
   status_t rc;
   sp<Camera> camera = get_native_camera(env, thiz, &context);
   if (camera == 0) return;

   if(mode == true)
      rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_ON, 0, 0);
   else
      rc = camera->sendCommand(CAMERA_CMD_HISTOGRAM_OFF, 0, 0);

   if (rc != NO_ERROR) {
      jniThrowException(env, "java/lang/RuntimeException", "set histogram mode failed");
     }
#endif
 }
void JNICameraContext::addCallbackBuffer(
        JNIEnv *env, jbyteArray cbb, int msgType)
{
@@ -920,6 +955,12 @@ static JNINativeMethod camMethods[] = {
  { "native_takePicture",
    "(I)V",
    (void *)android_hardware_Camera_takePicture },
  { "native_setHistogramMode",
    "(Z)V",
     (void *)android_hardware_Camera_setHistogramMode },
  { "native_sendHistogramData",
    "()V",
     (void *)android_hardware_Camera_sendHistogramData },
  { "native_setParameters",
    "(Ljava/lang/String;)V",
    (void *)android_hardware_Camera_setParameters },
+41 −2
Original line number Diff line number Diff line
@@ -90,9 +90,28 @@ public class CamcorderProfile
     */
    public static final int QUALITY_QVGA = 7;

    /**
     * {@hide}
     */
    public static final int QUALITY_FWVGA = 8;
    /**
     * {@hide}
     */
    public static final int QUALITY_WVGA = 9;

    /**
     * {@hide}
     */
    public static final int QUALITY_VGA = 10;

    /**
     * {@hide}
     */
    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_QVGA;
    private static final int QUALITY_LIST_END = QUALITY_WQVGA;

    /**
     * Time lapse quality level corresponding to the lowest available resolution.
@@ -134,9 +153,29 @@ public class CamcorderProfile
     */
    public static final int QUALITY_TIME_LAPSE_QVGA = 1007;

    /** @hide
     * Time lapse quality level corresponding to the FWVGA (864 x 480) resolution.
     */
    public static final int QUALITY_TIME_LAPSE_FWVGA = 1008;

    /** @hide
     * Time lapse quality level corresponding to the WVGA (800 x 480) resolution.
     */
    public static final int QUALITY_TIME_LAPSE_WVGA = 1009;

    /** @hide
     * Time lapse quality level corresponding to the VGA (640 x 480) resolution.
     */
    public static final int QUALITY_TIME_LAPSE_VGA = 1010;

    /** @hide
     * Time lapse quality level corresponding to the WQVGA (432 x 240) resolution.
     */
    public static final int QUALITY_TIME_LAPSE_WQVGA = 1011;

    // Start and end of timelapse quality list
    private static final int QUALITY_TIME_LAPSE_LIST_START = QUALITY_TIME_LAPSE_LOW;
    private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_QVGA;
    private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_WQVGA;

    /**
     * Default recording duration in seconds before the session is terminated.