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

Commit 61015262 authored by Steve Kondik's avatar Steve Kondik
Browse files

Add support for sending raw commands



 * Certain camera drivers need magic commands to select special modes
   such as ZSL or HDR. Add support for sending raw commands from
   applications.

Change-Id: I512a765c7a67ffd2877e465cf6493ffc2b3b54ac
Signed-off-by: default avatarChet Kener <Cl3Kener@gmail.com>
parent 866b1945
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1390,6 +1390,12 @@ public class Camera {

    private native void enableFocusMoveCallback(int enable);

    /**
     * Send a raw command to the camera driver
     * @hide
     */
    public native void sendRawCommand(int arg1, int arg2, int arg3);

    /**
     * Callback interface used to signal the moment of actual image capture.
     *
+14 −0
Original line number Diff line number Diff line
@@ -1111,6 +1111,7 @@ static void android_hardware_Camera_enableFocusMoveCallback(JNIEnv *env, jobject
    }
}

<<<<<<< HEAD
static void android_hardware_Camera_sendVendorCommand(JNIEnv *env, jobject thiz,
        jint cmd, jint arg1, jint arg2)
{
@@ -1120,6 +1121,16 @@ static void android_hardware_Camera_sendVendorCommand(JNIEnv *env, jobject thiz,

    if (camera->sendCommand(cmd, arg1, arg2) != NO_ERROR) {
        jniThrowRuntimeException(env, "sending vendor command failed");
=======
static void android_hardware_Camera_sendRawCommand(JNIEnv *env, jobject thiz, jint arg1, jint arg2, jint arg3)
{
    ALOGV("sendRawCommand %d, %d, %d", arg1, arg2, arg3);
    sp<Camera> camera = get_native_camera(env, thiz, NULL);
    if (camera == 0) return;

    if (camera->sendCommand(arg1, arg2, arg3) != NO_ERROR) {
        jniThrowRuntimeException(env, "send raw command failed");
>>>>>>> 9d8d87f... Add support for sending raw commands
    }
}

@@ -1225,6 +1236,9 @@ static const JNINativeMethod camMethods[] = {
  { "_sendVendorCommand",
    "(III)V",
    (void *)android_hardware_Camera_sendVendorCommand },
  { "sendRawCommand",
    "(III)V",
    (void *)android_hardware_Camera_sendRawCommand},
};

struct field {