1 /* 2 * Copyright 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package androidx.camera.core.impl; 18 19 import com.google.auto.value.AutoValue; 20 21 import org.jspecify.annotations.NonNull; 22 import org.jspecify.annotations.Nullable; 23 24 /** 25 * The configuration for all the output surfaces of the SessionProcessor. 26 */ 27 @AutoValue 28 public abstract class OutputSurfaceConfiguration { 29 /** 30 * Creates an OutputSurface instance. 31 */ create( @onNull OutputSurface previewOutputSurface, @NonNull OutputSurface imageCaptureOutputSurface, @Nullable OutputSurface imageAnalysisOutputSurface, @Nullable OutputSurface postviewOutputSurface)32 public static @NonNull OutputSurfaceConfiguration create( 33 @NonNull OutputSurface previewOutputSurface, 34 @NonNull OutputSurface imageCaptureOutputSurface, 35 @Nullable OutputSurface imageAnalysisOutputSurface, 36 @Nullable OutputSurface postviewOutputSurface) { 37 return new AutoValue_OutputSurfaceConfiguration( 38 previewOutputSurface, imageCaptureOutputSurface, 39 imageAnalysisOutputSurface, postviewOutputSurface); 40 } 41 /** 42 * gets the preview {@link OutputSurface}. 43 */ getPreviewOutputSurface()44 public abstract @NonNull OutputSurface getPreviewOutputSurface(); 45 46 /** 47 * gets the still capture {@link OutputSurface}. 48 */ getImageCaptureOutputSurface()49 public abstract @NonNull OutputSurface getImageCaptureOutputSurface(); 50 51 /** 52 * gets the image analysis {@link OutputSurface}. 53 */ getImageAnalysisOutputSurface()54 public abstract @Nullable OutputSurface getImageAnalysisOutputSurface(); 55 56 /** 57 * gets the postview {@link OutputSurface}. 58 */ getPostviewOutputSurface()59 public abstract @Nullable OutputSurface getPostviewOutputSurface(); 60 } 61