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

Commit 3e4fed20 authored by Ruben Brunk's avatar Ruben Brunk
Browse files

camera2: Add shim frame duration and stall characteristics.

Bug: 15116722
Change-Id: Ief8b05d46fa12f63cf6a5d41e312c94d5a033553
parent 19f01ebe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12822,6 +12822,7 @@ package android.hardware.camera2.params {
    method public boolean isOutputSupportedFor(int);
    method public static boolean isOutputSupportedFor(java.lang.Class<T>);
    method public boolean isOutputSupportedFor(android.view.Surface);
    field public static final long NO_MIN_FRAME_DURATION = 0L; // 0x0L
  }
  public final class TonemapCurve {
+3 −1
Original line number Diff line number Diff line
@@ -248,7 +248,6 @@ public abstract class CameraMetadata<TKey> {
     * <li>Manual frame duration control<ul>
     * <li>{@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}</li>
     * <li>{@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}</li>
     * <li>{@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}</li>
     * </ul>
     * </li>
     * <li>Manual exposure control<ul>
@@ -279,6 +278,9 @@ public abstract class CameraMetadata<TKey> {
     * result.</p>
     * <p>A given camera device may also support additional manual sensor controls,
     * but this capability only covers the above list of controls.</p>
     * <p>If this is supported, {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} will
     * additionally return a min frame duration that is greater than
     * zero for each supported size-format combination.</p>
     *
     * @see CaptureRequest#BLACK_LEVEL_LOCK
     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
+0 −1
Original line number Diff line number Diff line
@@ -169,7 +169,6 @@ public class CameraDeviceUserShim implements ICameraDeviceUser {
            }
            int numSurfaces = mSurfaces.size();
            if (numSurfaces > 0) {
                surfaces = new ArrayList<Surface>();
                for (int i = 0; i < numSurfaces; ++i) {
                    surfaces.add(mSurfaces.valueAt(i));
                }
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ public class GLThreadManager {
                    break;
                case MSG_ALLOW_FRAMES:
                    mDroppingFrames = false;
                    break;
                default:
                    Log.e(TAG, "Unhandled message " + msg.what + " on GLThread.");
                    break;
+16 −3
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ public class LegacyCameraDevice implements AutoCloseable {
    public static final String DEBUG_PROP = "HAL1ShimLogging";
    private final String TAG;

    private static final boolean DEBUG = false;
    private final int mCameraId;
    private final ICameraDeviceCallbacks mDeviceCallbacks;
    private final CameraDeviceState mDeviceState = new CameraDeviceState();
@@ -84,6 +85,9 @@ public class LegacyCameraDevice implements AutoCloseable {
            mResultHandler.post(new Runnable() {
                @Override
                public void run() {
                    if (DEBUG) {
                        Log.d(TAG, "doing onError callback.");
                    }
                    try {
                        mDeviceCallbacks.onCameraError(errorCode, extras);
                    } catch (RemoteException e) {
@@ -92,13 +96,14 @@ public class LegacyCameraDevice implements AutoCloseable {
                    }
                }
            });


        }

        @Override
        public void onConfiguring() {
            // Do nothing
            if (DEBUG) {
                Log.d(TAG, "doing onConfiguring callback.");
            }
        }

        @Override
@@ -108,6 +113,9 @@ public class LegacyCameraDevice implements AutoCloseable {
            mResultHandler.post(new Runnable() {
                @Override
                public void run() {
                    if (DEBUG) {
                        Log.d(TAG, "doing onIdle callback.");
                    }
                    try {
                        mDeviceCallbacks.onCameraIdle();
                    } catch (RemoteException e) {
@@ -126,6 +134,9 @@ public class LegacyCameraDevice implements AutoCloseable {
            mResultHandler.post(new Runnable() {
                @Override
                public void run() {
                    if (DEBUG) {
                        Log.d(TAG, "doing onCaptureStarted callback.");
                    }
                    try {
                        // TODO: Don't fake timestamp
                        mDeviceCallbacks.onCaptureStarted(extras, timestamp);
@@ -135,7 +146,6 @@ public class LegacyCameraDevice implements AutoCloseable {
                    }
                }
            });

        }

        @Override
@@ -145,6 +155,9 @@ public class LegacyCameraDevice implements AutoCloseable {
            mResultHandler.post(new Runnable() {
                @Override
                public void run() {
                    if (DEBUG) {
                        Log.d(TAG, "doing onCaptureResult callback.");
                    }
                    try {
                        // TODO: Don't fake metadata
                        mDeviceCallbacks.onResultReceived(result, extras);
Loading