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

Commit 828c526f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Add support for extension specific session types"

parents 4489239d 983c89e0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,4 +24,5 @@ parcelable CameraSessionConfig
    List<CameraOutputConfig> outputConfigs;
    CameraMetadataNative sessionParameter;
    int sessionTemplateId;
    int sessionType;
}
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ interface IImageCaptureExtenderImpl
    @nullable CaptureStageImpl onPresetSession();
    @nullable CaptureStageImpl onEnableSession();
    @nullable CaptureStageImpl onDisableSession();
    int getSessionType();

    boolean isExtensionAvailable(in String cameraId, in CameraMetadataNative chars);
    void init(in String cameraId, in CameraMetadataNative chars);
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ interface IPreviewExtenderImpl
    void init(in String cameraId, in CameraMetadataNative chars);
    boolean isExtensionAvailable(in String cameraId, in CameraMetadataNative chars);
    @nullable CaptureStageImpl getCaptureStage();
    int getSessionType();

    const int PROCESSOR_TYPE_REQUEST_UPDATE_ONLY = 0;
    const int PROCESSOR_TYPE_IMAGE_PROCESSOR = 1;
+10 −3
Original line number Diff line number Diff line
@@ -243,9 +243,16 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            mCameraConfigMap.put(cameraOutput.getSurface(), output);
        }

        SessionConfiguration sessionConfiguration = new SessionConfiguration(
                SessionConfiguration.SESSION_REGULAR, outputList,
                new CameraExtensionUtils.HandlerExecutor(mHandler), new SessionStateHandler());
        int sessionType = SessionConfiguration.SESSION_REGULAR;
        if (sessionConfig.sessionType != -1 &&
                (sessionConfig.sessionType != SessionConfiguration.SESSION_HIGH_SPEED)) {
            sessionType = sessionConfig.sessionType;
            Log.v(TAG, "Using session type: " + sessionType);
        }

        SessionConfiguration sessionConfiguration = new SessionConfiguration(sessionType,
                outputList, new CameraExtensionUtils.HandlerExecutor(mHandler),
                new SessionStateHandler());

        if ((sessionConfig.sessionParameter != null) &&
                (!sessionConfig.sessionParameter.isEmpty())) {
+13 −1
Original line number Diff line number Diff line
@@ -415,6 +415,18 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession {
                    "Session already initialized");
            return;
        }
        int previewSessionType = mPreviewExtender.getSessionType();
        int imageSessionType = mImageExtender.getSessionType();
        if (previewSessionType != imageSessionType) {
            throw new IllegalStateException("Preview extender session type: " + previewSessionType +
                "and image extender session type: " + imageSessionType + " mismatch!");
        }
        int sessionType = SessionConfiguration.SESSION_REGULAR;
        if ((previewSessionType != -1) &&
                (previewSessionType != SessionConfiguration.SESSION_HIGH_SPEED)) {
            sessionType = previewSessionType;
            Log.v(TAG, "Using session type: " + sessionType);
        }

        ArrayList<CaptureStageImpl> sessionParamsList = new ArrayList<>();
        ArrayList<OutputConfiguration> outputList = new ArrayList<>();
@@ -432,7 +444,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession {
        }

        SessionConfiguration sessionConfig = new SessionConfiguration(
                SessionConfiguration.SESSION_REGULAR,
                sessionType,
                outputList,
                new CameraExtensionUtils.HandlerExecutor(mHandler),
                new SessionStateHandler());
Loading