public class

ForwardingCameraInfo

extends java.lang.Object

implements CameraInfoInternal

 java.lang.Object

↳androidx.camera.core.impl.ForwardingCameraInfo

Subclasses:

VirtualCameraInfo, RestrictedCameraInfo

Gradle dependencies

compile group: 'androidx.camera', name: 'camera-core', version: '1.5.0-alpha01'

  • groupId: androidx.camera
  • artifactId: camera-core
  • version: 1.5.0-alpha01

Artifact androidx.camera:camera-core:1.5.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

A CameraInfoInternal that forwards all the calls into the given CameraInfoInternal.

Summary

Constructors
publicForwardingCameraInfo(CameraInfoInternal cameraInfoInternal)

Create an instance that will forward all calls to the supplied CameraInfoInternal instance.

Methods
public voidaddSessionCaptureCallback(java.util.concurrent.Executor executor, CameraCaptureCallback callback)

public java.lang.ObjectgetCameraCharacteristics()

public java.lang.StringgetCameraId()

public QuirksgetCameraQuirks()

public CameraSelectorgetCameraSelector()

public LiveData<CameraState>getCameraState()

public EncoderProfilesProvidergetEncoderProfilesProvider()

public ExposureStategetExposureState()

public CameraInfoInternalgetImplementation()

public java.lang.StringgetImplementationType()

public floatgetIntrinsicZoomRatio()

public intgetLensFacing()

public java.lang.ObjectgetPhysicalCameraCharacteristics(java.lang.String physicalCameraId)

public java.util.Set<CameraInfo>getPhysicalCameraInfos()

public intgetSensorRotationDegrees()

public intgetSensorRotationDegrees(int relativeRotation)

public java.util.Set<DynamicRange>getSupportedDynamicRanges()

public java.util.Set<>getSupportedFrameRateRanges()

public java.util.List<Size>getSupportedHighResolutions(int format)

public java.util.Set<java.lang.Integer>getSupportedOutputFormats()

public java.util.List<Size>getSupportedResolutions(int format)

public TimebasegetTimebase()

public LiveData<java.lang.Integer>getTorchState()

public LiveData<ZoomState>getZoomState()

public booleanhasFlashUnit()

public booleanisFocusMeteringSupported(FocusMeteringAction action)

public booleanisLogicalMultiCameraSupported()

public booleanisPreviewStabilizationSupported()

public booleanisPrivateReprocessingSupported()

public booleanisVideoStabilizationSupported()

public booleanisZslSupported()

public java.util.Set<DynamicRange>querySupportedDynamicRanges(java.util.Set<DynamicRange> candidateDynamicRanges)

public voidremoveSessionCaptureCallback(CameraCaptureCallback callback)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public ForwardingCameraInfo(CameraInfoInternal cameraInfoInternal)

Create an instance that will forward all calls to the supplied CameraInfoInternal instance.

Methods

public int getSensorRotationDegrees()

public int getSensorRotationDegrees(int relativeRotation)

public boolean hasFlashUnit()

public LiveData<java.lang.Integer> getTorchState()

public LiveData<ZoomState> getZoomState()

public ExposureState getExposureState()

public LiveData<CameraState> getCameraState()

public java.lang.String getImplementationType()

public int getLensFacing()

public float getIntrinsicZoomRatio()

public boolean isFocusMeteringSupported(FocusMeteringAction action)

public boolean isZslSupported()

public java.util.Set<> getSupportedFrameRateRanges()

public boolean isPrivateReprocessingSupported()

public boolean isLogicalMultiCameraSupported()

public java.lang.String getCameraId()

public void addSessionCaptureCallback(java.util.concurrent.Executor executor, CameraCaptureCallback callback)

public void removeSessionCaptureCallback(CameraCaptureCallback callback)

public Quirks getCameraQuirks()

public EncoderProfilesProvider getEncoderProfilesProvider()

public Timebase getTimebase()

public java.util.Set<java.lang.Integer> getSupportedOutputFormats()

public java.util.List<Size> getSupportedResolutions(int format)

public java.util.List<Size> getSupportedHighResolutions(int format)

public java.util.Set<DynamicRange> getSupportedDynamicRanges()

public java.util.Set<DynamicRange> querySupportedDynamicRanges(java.util.Set<DynamicRange> candidateDynamicRanges)

public CameraInfoInternal getImplementation()

public CameraSelector getCameraSelector()

public boolean isPreviewStabilizationSupported()

public boolean isVideoStabilizationSupported()

public java.lang.Object getCameraCharacteristics()

public java.lang.Object getPhysicalCameraCharacteristics(java.lang.String physicalCameraId)

public java.util.Set<CameraInfo> getPhysicalCameraInfos()

Source

/*
 * Copyright 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.camera.core.impl;

import android.util.Range;
import android.util.Size;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.camera.core.CameraInfo;
import androidx.camera.core.CameraSelector;
import androidx.camera.core.CameraState;
import androidx.camera.core.DynamicRange;
import androidx.camera.core.ExperimentalZeroShutterLag;
import androidx.camera.core.ExposureState;
import androidx.camera.core.FocusMeteringAction;
import androidx.camera.core.ZoomState;
import androidx.lifecycle.LiveData;

import java.util.List;
import java.util.Set;
import java.util.concurrent.Executor;

/**
 * A {@link CameraInfoInternal} that forwards all the calls into the given
 * {@link CameraInfoInternal}.
 */
public class ForwardingCameraInfo implements CameraInfoInternal {

    private final CameraInfoInternal mCameraInfoInternal;

    /**
     * Create an instance that will forward all calls to the supplied {@link CameraInfoInternal}
     * instance.
     */
    public ForwardingCameraInfo(@NonNull CameraInfoInternal cameraInfoInternal) {
        mCameraInfoInternal = cameraInfoInternal;
    }

    @Override
    public int getSensorRotationDegrees() {
        return mCameraInfoInternal.getSensorRotationDegrees();
    }

    @Override
    public int getSensorRotationDegrees(int relativeRotation) {
        return mCameraInfoInternal.getSensorRotationDegrees(relativeRotation);
    }

    @Override
    public boolean hasFlashUnit() {
        return mCameraInfoInternal.hasFlashUnit();
    }

    @NonNull
    @Override
    public LiveData<Integer> getTorchState() {
        return mCameraInfoInternal.getTorchState();
    }

    @NonNull
    @Override
    public LiveData<ZoomState> getZoomState() {
        return mCameraInfoInternal.getZoomState();
    }

    @NonNull
    @Override
    public ExposureState getExposureState() {
        return mCameraInfoInternal.getExposureState();
    }

    @NonNull
    @Override
    public LiveData<CameraState> getCameraState() {
        return mCameraInfoInternal.getCameraState();
    }

    @NonNull
    @Override
    public String getImplementationType() {
        return mCameraInfoInternal.getImplementationType();
    }

    @Override
    public int getLensFacing() {
        return mCameraInfoInternal.getLensFacing();
    }

    @Override
    public float getIntrinsicZoomRatio() {
        return mCameraInfoInternal.getIntrinsicZoomRatio();
    }

    @Override
    public boolean isFocusMeteringSupported(@NonNull FocusMeteringAction action) {
        return mCameraInfoInternal.isFocusMeteringSupported(action);
    }

    @Override
    @ExperimentalZeroShutterLag
    public boolean isZslSupported() {
        return mCameraInfoInternal.isZslSupported();
    }

    @NonNull
    @Override
    public Set<Range<Integer>> getSupportedFrameRateRanges() {
        return mCameraInfoInternal.getSupportedFrameRateRanges();
    }

    @Override
    public boolean isPrivateReprocessingSupported() {
        return mCameraInfoInternal.isPrivateReprocessingSupported();
    }

    @Override
    public boolean isLogicalMultiCameraSupported() {
        return mCameraInfoInternal.isLogicalMultiCameraSupported();
    }

    @NonNull
    @Override
    public String getCameraId() {
        return mCameraInfoInternal.getCameraId();
    }

    @Override
    public void addSessionCaptureCallback(@NonNull Executor executor,
            @NonNull CameraCaptureCallback callback) {
        mCameraInfoInternal.addSessionCaptureCallback(executor, callback);
    }

    @Override
    public void removeSessionCaptureCallback(@NonNull CameraCaptureCallback callback) {
        mCameraInfoInternal.removeSessionCaptureCallback(callback);
    }

    @NonNull
    @Override
    public Quirks getCameraQuirks() {
        return mCameraInfoInternal.getCameraQuirks();
    }

    @NonNull
    @Override
    public EncoderProfilesProvider getEncoderProfilesProvider() {
        return mCameraInfoInternal.getEncoderProfilesProvider();
    }

    @NonNull
    @Override
    public Timebase getTimebase() {
        return mCameraInfoInternal.getTimebase();
    }

    @NonNull
    @Override
    public Set<Integer> getSupportedOutputFormats() {
        return mCameraInfoInternal.getSupportedOutputFormats();
    }

    @NonNull
    @Override
    public List<Size> getSupportedResolutions(int format) {
        return mCameraInfoInternal.getSupportedResolutions(format);
    }

    @NonNull
    @Override
    public List<Size> getSupportedHighResolutions(int format) {
        return mCameraInfoInternal.getSupportedHighResolutions(format);
    }

    @NonNull
    @Override
    public Set<DynamicRange> getSupportedDynamicRanges() {
        return mCameraInfoInternal.getSupportedDynamicRanges();
    }

    @NonNull
    @Override
    public Set<DynamicRange> querySupportedDynamicRanges(
            @NonNull Set<DynamicRange> candidateDynamicRanges) {
        return mCameraInfoInternal.querySupportedDynamicRanges(candidateDynamicRanges);
    }

    @NonNull
    @Override
    public CameraInfoInternal getImplementation() {
        return mCameraInfoInternal.getImplementation();
    }

    @NonNull
    @Override
    public CameraSelector getCameraSelector() {
        return mCameraInfoInternal.getCameraSelector();
    }

    @Override
    public boolean isPreviewStabilizationSupported() {
        return mCameraInfoInternal.isPreviewStabilizationSupported();
    }

    @Override
    public boolean isVideoStabilizationSupported() {
        return mCameraInfoInternal.isVideoStabilizationSupported();
    }

    @NonNull
    @Override
    public Object getCameraCharacteristics() {
        return mCameraInfoInternal.getCameraCharacteristics();
    }

    @Nullable
    @Override
    public Object getPhysicalCameraCharacteristics(@NonNull String physicalCameraId) {
        return mCameraInfoInternal.getPhysicalCameraCharacteristics(physicalCameraId);
    }

    @NonNull
    @Override
    public Set<CameraInfo> getPhysicalCameraInfos() {
        return mCameraInfoInternal.getPhysicalCameraInfos();
    }
}