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

Commit 88f1af24 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera2: Add onCaptureQueueEmpty callback

onCaptureQueueEmpty indicates that the non-repeating
capture request queue of camera device is empty, and
is ready to process a new request.

Test: testMultipleCapture in PerformanceTest.java

Bug: 29006447
Change-Id: If245ff6abf352548ca13a10fcfbd1550b92c1224
parent ee53f0d4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13899,6 +13899,7 @@ package android.hardware.camera2 {
  public static abstract class CameraCaptureSession.StateCallback {
    ctor public CameraCaptureSession.StateCallback();
    method public void onActive(android.hardware.camera2.CameraCaptureSession);
    method public void onCaptureQueueEmpty(android.hardware.camera2.CameraCaptureSession);
    method public void onClosed(android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigureFailed(android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigured(android.hardware.camera2.CameraCaptureSession);
+1 −0
Original line number Diff line number Diff line
@@ -14355,6 +14355,7 @@ package android.hardware.camera2 {
  public static abstract class CameraCaptureSession.StateCallback {
    ctor public CameraCaptureSession.StateCallback();
    method public void onActive(android.hardware.camera2.CameraCaptureSession);
    method public void onCaptureQueueEmpty(android.hardware.camera2.CameraCaptureSession);
    method public void onClosed(android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigureFailed(android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigured(android.hardware.camera2.CameraCaptureSession);
+1 −0
Original line number Diff line number Diff line
@@ -13916,6 +13916,7 @@ package android.hardware.camera2 {
  public static abstract class CameraCaptureSession.StateCallback {
    ctor public CameraCaptureSession.StateCallback();
    method public void onActive(android.hardware.camera2.CameraCaptureSession);
    method public void onCaptureQueueEmpty(android.hardware.camera2.CameraCaptureSession);
    method public void onClosed(android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigureFailed(android.hardware.camera2.CameraCaptureSession);
    method public abstract void onConfigured(android.hardware.camera2.CameraCaptureSession);
+30 −0
Original line number Diff line number Diff line
@@ -721,6 +721,36 @@ public abstract class CameraCaptureSession implements AutoCloseable {
            // default empty implementation
        }

        /**
         * This method is called when camera device's input capture queue becomes empty,
         * and is ready to accept the next request.
         *
         * <p>Pending capture requests exist in one of two queues: the in-flight queue where requests
         * are already in different stages of processing pipeline, and an input queue where requests
         * wait to enter the in-flight queue. The input queue is needed because more requests may be
         * submitted than the current camera device pipeline depth.</p>
         *
         * <p>This callback is fired when the input queue becomes empty, and the camera device may
         * have to fall back to the repeating request if set, or completely skip the next frame from
         * the sensor. This can cause glitches to camera preview output, for example. This callback
         * will only fire after requests queued by capture() or captureBurst(), not after a
         * repeating request or burst enters the in-flight queue. For example, in the common case
         * of a repeating request and a single-shot JPEG capture, this callback only fires when the
         * JPEG request has entered the in-flight queue for capture.</p>
         *
         * <p>By only sending a new {@link #capture} or {@link #captureBurst} when the input
         * queue is empty, pipeline latency can be minimized.</p>
         *
         * <p>This callback is not fired when the session is first created. It is different from
         * {@link #onReady}, which is fired when all requests in both queues have been processed.</p>
         *
         * @param session
         *            The session returned by {@link CameraDevice#createCaptureSession}
         */
        public void onCaptureQueueEmpty(@NonNull CameraCaptureSession session) {
            // default empty implementation
        }

        /**
         * This method is called when the session is closed.
         *
+5 −0
Original line number Diff line number Diff line
@@ -172,6 +172,11 @@ public class CallbackProxies {
            mProxy.invoke("onActive", session);
        }

        @Override
        public void onCaptureQueueEmpty(CameraCaptureSession session) {
            mProxy.invoke("onCaptureQueueEmpty", session);
        }

        @Override
        public void onClosed(CameraCaptureSession session) {
            mProxy.invoke("onClosed", session);
Loading