public interface CameraInfo

An interface for retrieving camera information.

Applications can retrieve an instance via getCameraInfo.

Summary

Constants

default static final int

The torch strength level when the device doesn't have a flash unit or doesn't support adjusting torch strength.

Public methods

default @Nullable CameraIdentifier

Returns the unique, stable CameraX identifier for this camera, if available.

abstract @NonNull CameraSelector

Returns a CameraSelector unique to this camera.

abstract @NonNull LiveData<CameraState>

Returns a LiveData of the camera's state.

abstract @NonNull ExposureState

Returns a ExposureState.

default @FloatRange(from = 0, fromInclusive = false) float

Returns the intrinsic zoom ratio of this camera.

default int

Returns the lens facing of this camera.

default @NonNull LiveData<Integer>

Returns a LiveData of current LowLightBoostState.

default @IntRange(from = 0) int

Returns the maximum torch strength level.

default @NonNull Set<CameraInfo>

Returns a set of physical camera CameraInfos.

abstract int

Returns the sensor rotation in degrees, relative to the device's "natural" (default) orientation.

abstract int

getSensorRotationDegrees(int relativeRotation)

Returns the sensor rotation, in degrees, relative to the given rotation value.

default @NonNull Set<Range<Integer>>

Returns an unordered set of the frame rate ranges, in frames per second, supported by this device's AE algorithm.

default @NonNull Set<Range<Integer>>

Returns an unordered set of the frame rate ranges, in frames per second, supported by this device's AE algorithm for a specific SessionConfig.

abstract @NonNull LiveData<Integer>

Returns a LiveData of current TorchState.

default @NonNull LiveData<Integer>

Returns the LiveData of the torch strength level.

abstract @NonNull LiveData<ZoomState>

Returns a LiveData of ZoomState.

abstract boolean

Returns if flash unit is available or not.

default boolean

Returns if the given FocusMeteringAction is supported on the devices.

default boolean

Returns if logical multi camera is supported on the device.

default boolean

Returns if low-light boost is supported on the device.

default boolean

Returns if the provided SessionConfig is supported by the camera.

default boolean

Returns if configuring torch strength is supported on the device.

default boolean

Returns if CAPTURE_MODE_ZERO_SHUTTER_LAG is supported on the current device.

default static boolean

Returns whether the shutter sound must be played in accordance to regional restrictions.

default @NonNull Set<DynamicRange>

querySupportedDynamicRanges(
    @NonNull Set<DynamicRange> candidateDynamicRanges
)

Returns the supported dynamic ranges of this camera from a set of candidate dynamic ranges.

Constants

TORCH_STRENGTH_LEVEL_UNSUPPORTED

default static final int TORCH_STRENGTH_LEVEL_UNSUPPORTED = 0

The torch strength level when the device doesn't have a flash unit or doesn't support adjusting torch strength.

Public methods

getCameraIdentifier

default @Nullable CameraIdentifier getCameraIdentifier()

Returns the unique, stable CameraX identifier for this camera, if available.

For most standard CameraX implementations, this will return a non-null identifier. However, some legacy or testing implementations may not have a valid identifier, in which case this method will return null.

getIntrinsicZoomRatio

default @FloatRange(from = 0, fromInclusive = false) float getIntrinsicZoomRatio()

Returns the intrinsic zoom ratio of this camera.

The intrinsic zoom ratio is defined as the ratio between the angle of view of the default camera and this camera. The default camera is the camera selected by DEFAULT_FRONT_CAMERA or DEFAULT_BACK_CAMERA depending on the lens facing of this camera. For example, if the default camera has angle of view 60 degrees and this camera has 30 degrees, this camera will have intrinsic zoom ratio 2.0.

The intrinsic zoom ratio is calculated approximately based on the focal length and the sensor size. It's considered an inexact attribute of the camera and might not be hundred percent accurate when compared with the output image. Especially for the case that the camera doesn't read the whole sensor area due to cropping being applied.

The default camera is guaranteed to have intrinsic zoom ratio 1.0. Other cameras that have intrinsic zoom ratio greater than 1.0 are considered telephoto cameras and cameras that have intrinsic zoom ratio less than 1.0 are considered ultra wide-angle cameras.

If the camera is unable to provide necessary information to resolve its intrinsic zoom ratio, it will be considered as a standard camera which has intrinsic zoom ratio 1.0.

Returns
@FloatRange(from = 0, fromInclusive = false) float

the intrinsic zoom ratio of this camera.

getLensFacing

default int getLensFacing()

Returns the lens facing of this camera.

getSensorRotationDegrees

abstract int getSensorRotationDegrees()

Returns the sensor rotation in degrees, relative to the device's "natural" (default) orientation.

See Sensor Coordinate System for more information.

Returns
int

the sensor rotation in degrees, relative to device's "natural" (default) orientation.

getSensorRotationDegrees

abstract int getSensorRotationDegrees(int relativeRotation)

Returns the sensor rotation, in degrees, relative to the given rotation value.

Valid values for the relative rotation are ROTATION_0 (natural), ROTATION_90, ROTATION_180, ROTATION_270.

Parameters
int relativeRotation

the rotation relative to which the output will be calculated.

Returns
int

the sensor rotation in degrees.

getSupportedFrameRateRanges

default @NonNull Set<Range<Integer>> getSupportedFrameRateRanges()

Returns an unordered set of the frame rate ranges, in frames per second, supported by this device's AE algorithm.

These are the frame rate ranges that the AE algorithm on the device can support. When CameraX is configured to run with the camera2 implementation, this list will be derived from #CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, though ranges may be added or removed for compatibility reasons.

There is no guarantee that these ranges can be used for every size surface or combination of use cases. If attempting to run the device using an unsupported range, there may be stability issues or the device may quietly choose another frame rate operating range. The returned set does not have any ordering guarantees. To get the guaranteed supported frame rate ranges under UseCase combination constraints, use getSupportedFrameRateRanges.

getSupportedFrameRateRanges

default @NonNull Set<Range<Integer>> getSupportedFrameRateRanges(@NonNull SessionConfig sessionConfig)

Returns an unordered set of the frame rate ranges, in frames per second, supported by this device's AE algorithm for a specific SessionConfig.

These are the frame rate ranges that the AE algorithm on the device can support when a particular SessionConfig is applied. This allows for querying supported frame rates based on the specific configuration of UseCases, which might influence the available ranges.

If the provided SessionConfig has a target frame rate range already set (e.g., set via setTargetFrameRate), this method will ignore that specific setting. The returned set represents all ranges the device can support under the given SessionConfig, irrespective of any pre-defined target frame rate within the config itself.

When CameraX is configured to run with the camera2 implementation, this list will be derived from CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES , though ranges may be added or removed for compatibility reasons or due to constraints imposed by the SessionConfig.

The returned set of frame rate ranges is guaranteed to be supported with the given SessionConfig. An empty set will be returned if the provided SessionConfig is invalid. The returned set does not have any ordering guarantees.

Returns
@NonNull Set<Range<Integer>>

The set of FPS ranges supported by the device's AE algorithm for the given session config.

hasFlashUnit

abstract boolean hasFlashUnit()

Returns if flash unit is available or not.

isLogicalMultiCameraSupported

default boolean isLogicalMultiCameraSupported()

Returns if logical multi camera is supported on the device.

A logical camera is a grouping of two or more of those physical cameras. See Multi-camera API

Returns
boolean

true if supported, otherwise false.

See also
CameraMetadata

#REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA

isSessionConfigSupported

default boolean isSessionConfigSupported(@NonNull SessionConfig sessionConfig)

Returns if the provided SessionConfig is supported by the camera.

This method checks if the camera can support the configuration contained within the given SessionConfig. This includes surfaces, features, and other parameters. It can also be used with subtypes of SessionConfig, such as androidx.camera.video.HighSpeedVideoSessionConfig or androidx.camera.extensions.ExtensionSessionConfig, to verify if those specific configurations are supported.

This API can be used before calling `bindToLifecycle` API to know if binding a SessionConfig with some given combination of feature groups will work or not.

The following pseudo-code shows an example of how to use this API:

// Disable the unsupported feature options in app feature menu UI once some features have
// already been selected and adding these features will lead to an unsupported configuration.
void disableUnsupportedFeatures(Set<GroupableFeature> selectedFeatures,
        Set<GroupableFeature> appFeatureOptions) {
    for (GroupableFeature featureOption : appFeatureOptions) {
        if (selectedFeatures.contains(featureOption)) { continue; }

        List<GroupableFeature> combinedFeatures = new ArrayList<>(selectedFeatures);
        combinedFeatures.add(featureOption);
        SessionConfig sessionConfig =
            new SessionConfig.Builder(useCases)
                .addRequiredFeatureGroup(combinedFeatures.toArray(new Feature[0]))
                .build();

        if (!cameraInfo.isSessionConfigSupported(sessionConfig)) {
            disableFeatureOptionInUi(featureOption); // e.g. app logic to disable a menu item
        }
    }
}
Returns
boolean

Whether the provided SessionConfig is supported or not.

Throws
java.lang.IllegalArgumentException

If some features conflict with each other by having different values for the same feature type and can thus never be supported together.

mustPlayShutterSound

default static boolean mustPlayShutterSound()

Returns whether the shutter sound must be played in accordance to regional restrictions.

This method provides the general rule of playing shutter sounds. The exact requirements of playing shutter sounds may vary among regions.

For image capture, the shutter sound is recommended to be played when receiving onCaptureStarted or onCaptureStarted. For video capture, it's recommended to play the start recording sound when receiving VideoRecordEvent.Start and the stop recording sound when receiving VideoRecordEvent.Finalize.

To play the system default sounds, it's recommended to use play. For image capture, play SHUTTER_CLICK. For video capture, play START_VIDEO_RECORDING and STOP_VIDEO_RECORDING.

This method and mustPlayShutterSound serve the same purpose, while this method is compatible on API level lower than TIRAMISU.

Returns
boolean

true if shutter sound must be played, otherwise false.

querySupportedDynamicRanges

default @NonNull Set<DynamicRangequerySupportedDynamicRanges(
    @NonNull Set<DynamicRange> candidateDynamicRanges
)

Returns the supported dynamic ranges of this camera from a set of candidate dynamic ranges.

Dynamic range specifies how the range of colors, highlights and shadows captured by the frame producer are represented on a display. Some dynamic ranges allow the preview surface to make full use of the extended range of brightness of the display.

The returned dynamic ranges are those which the camera can produce. However, because care usually needs to be taken to ensure the frames produced can be displayed correctly, the returned dynamic ranges will be limited to those passed in to candidateDynamicRanges. For example, if the device display supports HLG, HDR10 and HDR10+, and you're attempting to use a UI component to receive frames from those dynamic ranges that you know will be display correctly, you would use a candidateDynamicRanges set consisting of {DynamicRange.HLG_10_BIT, DynamicRange.HDR10_10_BIT, DynamicRange.HDR10_PLUS_10_BIT}. If the only 10-bit/HDR DynamicRange the camera can produce is HLG_10_BIT, then that will be the only dynamic range returned by this method given the above candidate list.

Consult the documentation of each use case to determine whether using the dynamic ranges published here are appropriate. Some use cases may have complex requirements that prohibit them from publishing a candidate list for use with this method, such as Recorder. For those cases, alternative APIs may be present for querying the supported dynamic ranges that can be set on the use case.

The dynamic ranges published as return values by this method are fully-defined. That is, the resulting set will not contain dynamic ranges such as UNSPECIFIED or HDR_UNSPECIFIED_10_BIT. However, non-fully-defined dynamic ranges can be used in candidateDynamicRanges, and will resolve to fully-defined dynamic ranges in the resulting set. To query all dynamic ranges the camera can produce, Collections.singleton(DynamicRange.UNSPECIFIED} can be used as the candidate set.

Because SDR is always supported, including SDR in candidateDynamicRanges will always result in SDR being present in the result set. If an empty candidate set is provided, an IllegalArgumentException will be thrown.

Parameters
@NonNull Set<DynamicRange> candidateDynamicRanges

a set of dynamic ranges representing the dynamic ranges the consumer of frames can support. Note that each use case may have its own requirements on which dynamic ranges it can consume based on how it is configured, and those dynamic ranges may not be published as a set of candidate dynamic ranges. In that case, this API may not be appropriate. An example of this is VideoCapture's Recorder class, which must also take into account the dynamic ranges supported by the media codecs on the device, and the quality of the video being recorded. For that class, it is recommended to use RecorderVideoCapabilities.getSupportedDynamicRanges() instead.

Returns
@NonNull Set<DynamicRange>

a set of dynamic ranges supported by the camera based on the candidate dynamic ranges

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-02-25 UTC.