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

Commit 7d4356e7 authored by Sunid Wilson's avatar Sunid Wilson Committed by Linux Build Service Account
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
parent ba35a77c
Loading
Loading
Loading
Loading
+1255 −0

File changed.

Preview size limit exceeded, changes collapsed.

+37 −1
Original line number Diff line number Diff line
@@ -390,7 +390,37 @@ void JNICameraContext::setCallbackMode(JNIEnv *env, bool installed, bool manualM
        clearCallbackBuffers_l(env, &mCallbackBuffers);
    }
}
static void android_hardware_Camera_sendHistogramData(JNIEnv *env, jobject thiz)
 {
   ALOGV("sendHistogramData" );
   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");
    }
 }
 static void android_hardware_Camera_setHistogramMode(JNIEnv *env, jobject thiz, jboolean mode)
 {
   ALOGV("setHistogramMode: mode:%d", (int)mode);
   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");
     }
 }
void JNICameraContext::addCallbackBuffer(
        JNIEnv *env, jbyteArray cbb, int msgType)
{
@@ -943,6 +973,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 },
+42 −2
Original line number Diff line number Diff line
@@ -95,9 +95,29 @@ public class CamcorderProfile
     */
    public static final int QUALITY_2160P = 8;

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

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

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


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

    /**
     * Time lapse quality level corresponding to the lowest available resolution.
@@ -144,9 +164,29 @@ public class CamcorderProfile
     */
    public static final int QUALITY_TIME_LAPSE_2160P = 1008;

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

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

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

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

    // 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_2160P;
    private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_WQVGA;

    /**
     * High speed ( >= 100fps) quality level corresponding to the lowest available resolution.