Sdílet prostřednictvím


CameraDevice.CreateCaptureSession Method

Definition

Overloads

CreateCaptureSession(SessionConfiguration)

Create a new CameraCaptureSession using a SessionConfiguration helper object that aggregates all supported parameters.

CreateCaptureSession(IList<Surface>, CameraCaptureSession+StateCallback, Handler)

CreateCaptureSession(SessionConfiguration)

Create a new CameraCaptureSession using a SessionConfiguration helper object that aggregates all supported parameters.

[Android.Runtime.Register("createCaptureSession", "(Landroid/hardware/camera2/params/SessionConfiguration;)V", "GetCreateCaptureSession_Landroid_hardware_camera2_params_SessionConfiguration_Handler", ApiSince=28)]
public virtual void CreateCaptureSession (Android.Hardware.Camera2.Params.SessionConfiguration? config);
[<Android.Runtime.Register("createCaptureSession", "(Landroid/hardware/camera2/params/SessionConfiguration;)V", "GetCreateCaptureSession_Landroid_hardware_camera2_params_SessionConfiguration_Handler", ApiSince=28)>]
abstract member CreateCaptureSession : Android.Hardware.Camera2.Params.SessionConfiguration -> unit
override this.CreateCaptureSession : Android.Hardware.Camera2.Params.SessionConfiguration -> unit

Parameters

config
SessionConfiguration

A session configuration (see SessionConfiguration).

Attributes

Remarks

Create a new CameraCaptureSession using a SessionConfiguration helper object that aggregates all supported parameters.

The active capture session determines the set of potential output Surfaces for the camera device for each capture request. A given request may use all or only some of the outputs. Once the CameraCaptureSession is created, requests can be submitted with CameraCaptureSession#capture capture, CameraCaptureSession#captureBurst captureBurst, CameraCaptureSession#setRepeatingRequest setRepeatingRequest, or CameraCaptureSession#setRepeatingBurst setRepeatingBurst.

Surfaces suitable for inclusion as a camera output can be created for various use cases and targets:

<ul>

<li>For drawing to a android.view.SurfaceView SurfaceView: Once the SurfaceView's Surface is android.view.SurfaceHolder.Callback#surfaceCreated created, set the size of the Surface with android.view.SurfaceHolder#setFixedSize to be one of the sizes returned by StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(SurfaceHolder.class) and then obtain the Surface by calling android.view.SurfaceHolder#getSurface. If the size is not set by the application, it will be rounded to the nearest supported size less than 1080p, by the camera device.</li>

<li>For accessing through an OpenGL texture via a android.graphics.SurfaceTexture SurfaceTexture: Set the size of the SurfaceTexture with android.graphics.SurfaceTexture#setDefaultBufferSize to be one of the sizes returned by StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(SurfaceTexture.class) before creating a Surface from the SurfaceTexture with Surface#Surface. If the size is not set by the application, it will be set to be the smallest supported size less than 1080p, by the camera device.</li>

<li>For recording with android.media.MediaCodec: Call android.media.MediaCodec#createInputSurface after configuring the media codec to use one of the sizes returned by StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(MediaCodec.class)</li>

<li>For recording with android.media.MediaRecorder: Call android.media.MediaRecorder#getSurface after configuring the media recorder to use one of the sizes returned by StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(MediaRecorder.class), or configuring it to use one of the supported android.media.CamcorderProfile CamcorderProfiles.</li>

<li>For efficient YUV processing with android.renderscript: Create a RenderScript android.renderscript.Allocation Allocation with a supported YUV type, the IO_INPUT flag, and one of the sizes returned by StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(Allocation.class), Then obtain the Surface with android.renderscript.Allocation#getSurface.</li>

<li>For access to RAW, uncompressed YUV, or compressed JPEG data in the application: Create an android.media.ImageReader object with one of the supported output formats given by StreamConfigurationMap#getOutputFormats(), setting its size to one of the corresponding supported sizes by passing the chosen output format into StreamConfigurationMap#getOutputSizes(int). Then obtain a android.view.Surface from it with android.media.ImageReader#getSurface(). If the ImageReader size is not set to a supported size, it will be rounded to a supported size less than 1080p by the camera device. </li>

</ul>

The camera device will query each Surface's size and formats upon this call, so they must be set to a valid setting at this time.

It can take several hundred milliseconds for the session's configuration to complete, since camera hardware may need to be powered on or reconfigured. Once the configuration is complete and the session is ready to actually capture data, the provided CameraCaptureSession.StateCallback's CameraCaptureSession.StateCallback#onConfigured callback will be called.

If a prior CameraCaptureSession already exists when this method is called, the previous session will no longer be able to accept new capture requests and will be closed. Any in-progress capture requests made on the prior session will be completed before it's closed. CameraCaptureSession.StateCallback#onConfigured for the new session may be invoked before CameraCaptureSession.StateCallback#onClosed is invoked for the prior session. Once the new session is CameraCaptureSession.StateCallback#onConfigured configured, it is able to start capturing its own requests. To minimize the transition time, the CameraCaptureSession#abortCaptures call can be used to discard the remaining requests for the prior capture session before a new one is created. Note that once the new session is created, the old one can no longer have its captures aborted.

Using larger resolution outputs, or more outputs, can result in slower output rate from the device.

Configuring a session with an empty or null list will close the current session, if any. This can be used to release the current session's target surfaces for another use.

<h3>Regular capture</h3>

While any of the sizes from StreamConfigurationMap#getOutputSizes can be used when a single output stream is configured, a given camera device may not be able to support all combination of sizes, formats, and targets when multiple outputs are configured at once. The tables below list the maximum guaranteed resolutions for combinations of streams and targets, given the capabilities of the camera device. These are valid for when the android.hardware.camera2.params.SessionConfiguration#setInputConfiguration input configuration is not set and therefore no reprocessing is active.

If an application tries to create a session using a set of targets that exceed the limits described in the below tables, one of three possibilities may occur. First, the session may be successfully created and work normally. Second, the session may be successfully created, but the camera device won't meet the frame rate guarantees as described in StreamConfigurationMap#getOutputMinFrameDuration. Or third, if the output set cannot be used at all, session creation will fail entirely, with CameraCaptureSession.StateCallback#onConfigureFailed being invoked.

For the type column, PRIV refers to any target whose available sizes are found using StreamConfigurationMap#getOutputSizes(Class) with no direct application-visible format, YUV refers to a target Surface using the android.graphics.ImageFormat#YUV_420_888 format, JPEG refers to the android.graphics.ImageFormat#JPEG format, and RAW refers to the android.graphics.ImageFormat#RAW_SENSOR format.

For the maximum size column, PREVIEW refers to the best size match to the device's screen resolution, or to 1080p (1920x1080), whichever is smaller. RECORD refers to the camera device's maximum supported recording resolution, as determined by android.media.CamcorderProfile. And MAXIMUM refers to the camera device's maximum output resolution for that format or target from StreamConfigurationMap#getOutputSizes.

To use these tables, determine the number and the formats/targets of outputs needed, and find the row(s) of the table with those targets. The sizes indicate the maximum set of sizes that can be used; it is guaranteed that for those targets, the listed sizes and anything smaller from the list given by StreamConfigurationMap#getOutputSizes can be successfully used to create a session. For example, if a row indicates that a 8 megapixel (MP) YUV_420_888 output can be used together with a 2 MP PRIV output, then a session can be created with targets [8 MP YUV, 2 MP PRIV] or targets [2 MP YUV, 2 MP PRIV]; but a session with targets [8 MP YUV, 4 MP PRIV], targets [4 MP YUV, 4 MP PRIV], or targets [8 MP PRIV, 2 MP YUV] would not be guaranteed to work, unless some other row of the table lists such a combination.

<style scoped> #rb { border-right-width: thick; }</style>

Legacy devices (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY) support at least the following stream combinations:

<table> <tr><th colspan="7">LEGACY-level guaranteed configurations</th></tr> <tr> <th colspan="2" id="rb">Target 1</th> <th colspan="2" id="rb">Target 2</th> <th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr> <th>Type</th><th id="rb">Max size</th> <th>Type</th><th id="rb">Max size</th> <th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>Simple preview, GPU video processing, or no-preview video recording.</td> </tr> <tr> <td>JPEG</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>No-viewfinder still image capture.</td> </tr> <tr> <td>YUV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>In-application video/image processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Standard still imaging.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>In-app processing plus still capture.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td colspan="2" id="rb"></td> <td>Standard recording.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td colspan="2" id="rb"></td> <td>Preview plus in-app processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>Still capture plus in-app processing.</td> </tr> </table><br>

Limited-level (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED) devices support at least the following stream combinations in addition to those for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY devices:

<table> <tr><th colspan="7">LIMITED-level additional guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">RECORD</td> <td colspan="2" id="rb"></td> <td>High-resolution video recording with preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">RECORD</td> <td colspan="2" id="rb"></td> <td>High-resolution in-app video processing with preview.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">RECORD</td> <td colspan="2" id="rb"></td> <td>Two-input in-app video processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">RECORD</td> <td>JPEG</td><td id="rb">RECORD</td> <td>High-resolution recording with video snapshot.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">RECORD</td> <td>JPEG</td><td id="rb">RECORD</td> <td>High-resolution in-app processing with video snapshot.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>Two-input in-app processing with still capture.</td> </tr> </table><br>

FULL-level (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL) devices support at least the following stream combinations in addition to those for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED devices:

<table> <tr><th colspan="7">FULL-level additional guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution GPU processing with preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution in-app processing with preview.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution two-input in-app processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>Video recording with maximum-size video snapshot</td> </tr> <tr> <td>YUV</td><td id="rb">640x480</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>Standard video recording plus maximum-resolution in-app processing.</td> </tr> <tr> <td>YUV</td><td id="rb">640x480</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>Preview plus two-input maximum-resolution in-app processing.</td> </tr> </table><br>

RAW-capability (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES includes CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW) devices additionally support at least the following stream combinations on both CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL and CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED devices:

<table> <tr><th colspan="7">RAW-capability additional guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr> <tr> <td>RAW</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>No-preview DNG capture.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Standard DNG capture.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>In-app processing plus DNG capture.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Video recording with DNG capture.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Preview with in-app processing and DNG capture.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Two-input in-app processing plus DNG capture.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Still capture with simultaneous JPEG and DNG.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>In-app processing with simultaneous JPEG and DNG.</td> </tr> </table><br>

BURST-capability (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES includes CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE) devices support at least the below stream combinations in addition to those for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED devices. Note that all FULL-level devices support the BURST capability, and the below list is a strict subset of the list for FULL-level devices, so this table is only relevant for LIMITED-level devices that support the BURST_CAPTURE capability.

<table> <tr><th colspan="5">BURST-capability additional guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">MAXIMUM</td> <td>Maximum-resolution GPU processing with preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>Maximum-resolution in-app processing with preview.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>Maximum-resolution two-input in-app processing.</td> </tr> </table><br>

LEVEL-3 (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3 LEVEL_3) support at least the following stream combinations in addition to the combinations for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL and for RAW capability (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES includes CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW):

<table> <tr><th colspan="11">LEVEL-3 additional guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">640x480</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>In-app viewfinder analysis with dynamic selection of output format.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">640x480</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>In-app viewfinder analysis with dynamic selection of output format.</td> </tr> </table><br>

BACKWARD_COMPATIBLE devices capable of streaming concurrently with other devices as described by android.hardware.camera2.CameraManager#getConcurrentCameraIds have the following guaranteed streams (when streaming concurrently with other devices)

Note: The sizes mentioned for these concurrent streams are the maximum sizes guaranteed to be supported. Sizes smaller than these, obtained by StreamConfigurationMap#getOutputSizes for a particular format, are supported as well.

<table> <tr><th colspan="5">Concurrent stream guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th> </tr> <tr> <td>YUV</td><td id="rb">s1440p</td> <td colspan="2" id="rb"></td> <td>In-app video / image processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">s1440p</td> <td colspan="2" id="rb"></td> <td>In-app viewfinder analysis.</td> </tr> <tr> <td>JPEG</td><td id="rb">s1440p</td> <td colspan="2" id="rb"></td> <td>No viewfinder still image capture.</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">s720p</td> <td>JPEG</td><td id="rb">s1440p</td> <td> Standard still imaging.</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">s720p</td> <td>YUV / PRIV</td><td id="rb">s1440p</td> <td>In-app video / processing with preview.</td> </tr> </table><br> </p>

Devices which are not backwards-compatible, support a mandatory single stream of size sVGA with image format DEPTH16 during concurrent operation.

For guaranteed concurrent stream configurations:

sVGA refers to the camera device's maximum resolution for that format from StreamConfigurationMap#getOutputSizes or VGA resolution (640X480) whichever is lower.

s720p refers to the camera device's maximum resolution for that format from StreamConfigurationMap#getOutputSizes or 720p(1280X720) whichever is lower.

s1440p refers to the camera device's maximum resolution for that format from StreamConfigurationMap#getOutputSizes or 1440p(1920X1440) whichever is lower.

MONOCHROME-capability (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES includes CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME) devices supporting android.graphics.ImageFormat#Y8 Y8 support substituting YUV streams with Y8 in all guaranteed stream combinations for the device's hardware level and capabilities.

Clients can access the above mandatory stream combination tables via android.hardware.camera2.params.MandatoryStreamCombination.

Devices capable of outputting HEIC formats (StreamConfigurationMap#getOutputFormats contains android.graphics.ImageFormat#HEIC) will support substituting JPEG streams with HEIC in all guaranteed stream combinations for the device's hardware level and capabilities. Calling createCaptureSession with both JPEG and HEIC outputs is not supported.

Devices capable of multi-resolution output for a particular format ( android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getOutputInfo returns a non-empty list) support using MultiResolutionImageReader for MAXIMUM resolution streams of that format for all mandatory stream combinations. For example, if a LIMITED camera device supports multi-resolution output streams for both JPEG and PRIVATE, in addition to the stream configurations in the LIMITED and Legacy table above, the camera device supports the following guaranteed stream combinations (MULTI_RES in the Max size column refers to a MultiResolutionImageReader created based on the variable max resolutions supported):

<table> <tr><th colspan="7">LEGACY-level additional guaranteed combinations with MultiResolutionoutputs</th></tr> <tr> <th colspan="2" id="rb">Target 1</th> <th colspan="2" id="rb">Target 2</th> <th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr> <th>Type</th><th id="rb">Max size</th> <th>Type</th><th id="rb">Max size</th> <th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV</td><td id="rb">MULTI_RES</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>Simple preview, GPU video processing, or no-preview video recording.</td> </tr> <tr> <td>JPEG</td><td id="rb">MULTI_RES</td> <td colspan="2" id="rb"></td> <td colspan="2" id="rb"></td> <td>No-viewfinder still image capture.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td colspan="2" id="rb"></td> <td>Standard still imaging.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td>Still capture plus in-app processing.</td> </tr> </table><br> <table> <tr><th colspan="7">LIMITED-level additional guaranteed configurations with MultiResolutionoutputs</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td>Two-input in-app processing with still capture.</td> </tr> </table><br> The same logic applies to other hardware levels and capabilities.

Devices with the ULTRA_HIGH_RESOLUTION_SENSOR capability have some additional guarantees which clients can take advantage of :

<table> <tr><th colspan="10">Additional guaranteed combinations for ULTRA_HIGH_RESOLUTION sensors</th></tr> <tr> <th colspan="3" id="rb">Target 1</th> <th colspan="3" id="rb">Target 2</th> <th colspan="3" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr> <th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th> <th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th> <th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th></tr> <tr> <td>YUV / JPEG / RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td id="rb">PRIV / YUV</td><td id="rb">DEFAULT</td><td id="rb">PREVIEW</td><td colspan="3" id="rb"></td> <td>Ultra high res still image capture with preview</td> </tr> <tr> <td>YUV / JPEG / RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td id="rb">PRIV</td><td id="rb">DEFAULT</td><td id="rb">PREVIEW</td><td id="rb">PRIV / YUV</td><td id="rb">DEFAULT</td><td id="rb">RECORD</td> <td>Ultra high res still capture with preview + app based RECORD size analysis</td> </tr> <tr> <td>YUV / JPEG / RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td id="rb">PRIV</td><td id="rb">DEFAULT</td><td id="rb">PREVIEW</td><td id="rb">JPEG / YUV / RAW</td><td id="rb">DEFAULT</td><td id="rb">MAX</td> <td>Ultra high res still image capture with preview + default sensor pixel mode analysis stream</td> </tr> </table><br>

Here, SC Map, refers to the StreamConfigurationMap, the target stream sizes must be chosen from. DEFAULT refers to the default sensor pixel mode StreamConfigurationMap and MAX_RES refers to the maximum resolution StreamConfigurationMap. For MAX_RES streams, MAX in the Max size column refers to the maximum size from StreamConfigurationMap#getOutputSizes and StreamConfigurationMap#getHighResolutionOutputSizes. Note: The same capture request must not mix targets from StreamConfigurationMaps corresponding to different sensor pixel modes.

10-bit output capable CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT devices support at least the following stream combinations:

<table> <tr><th colspan="7">10-bit output additional guaranteed configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV</td><td id="rb">MAXIMUM</td> }</td> <td colspan="4" id="rb"></td> <td>Simple preview, GPU video processing, or no-preview video recording.</td> </tr> <tr> <td>YUV</td><td id="rb">MAXIMUM</td> }</td> <td colspan="4" id="rb"></td> <td>In-application video/image processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Standard still imaging.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution in-app processing with preview.</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td colspan="2" id="rb"></td> <td>Maximum-resolution two-input in-app processing.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">RECORD</td> <td colspan="2" id="rb"></td> <td>High-resolution video recording with preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">RECORD</td> <td>YUV</td><td id="rb">RECORD</td> <td>High-resolution recording with in-app snapshot.</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">RECORD</td> <td>JPEG</td><td id="rb">RECORD</td> <td>High-resolution recording with video snapshot.</td> </tr> </table><br>

Here PRIV can be either 8 or 10-bit android.graphics.ImageFormat#PRIVATE pixel format. YUV can be either android.graphics.ImageFormat#YUV_420_888 or android.graphics.ImageFormat#YCBCR_P010. For the maximum size column, PREVIEW refers to the best size match to the device's screen resolution, or to 1080p (1920x1080), whichever is smaller. RECORD refers to the camera device's maximum supported recording resolution, as determined by android.media.CamcorderProfile. MAXIMUM refers to the camera device's maximum output resolution for that format or target from StreamConfigurationMap#getOutputSizes(int). Do note that invalid combinations such as having a camera surface configured to use pixel format android.graphics.ImageFormat#YUV_420_888 with a 10-bit profile will cause a capture session initialization failure.

android.graphics.ImageFormat#JPEG_R may also be supported if advertised by android.hardware.camera2.params.StreamConfigurationMap. When initializing a capture session that includes a Jpeg/R camera output clients must consider the following items w.r.t. the 10-bit mandatory stream combination table:

<ul> <li>To generate the compressed Jpeg/R image a single android.graphics.ImageFormat#YCBCR_P010 output will be used internally by the camera device.</li> <li>On camera devices that are able to support concurrent 10 and 8-bit capture requests see android.hardware.camera2.params.DynamicRangeProfiles#getProfileCaptureRequestConstraints an extra android.graphics.ImageFormat#JPEG will also be configured internally to help speed up the encoding process.</li> </ul>

Jpeg/R camera outputs will typically be able to support the MAXIMUM device resolution. Clients can also call StreamConfigurationMap#getOutputSizes(int) for a complete list supported sizes. Camera clients that register a Jpeg/R output within a stream combination that doesn't fit in the mandatory stream table above can call CameraDevice#isSessionConfigurationSupported to ensure that this particular configuration is supported.

Devices with the STREAM_USE_CASE capability (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES includes CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE) support below additional stream combinations:

<table> <tr><th colspan="10">STREAM_USE_CASE capability additional guaranteed configurations</th></tr> <tr><th colspan="3" id="rb">Target 1</th><th colspan="3" id="rb">Target 2</th><th colspan="3" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Usecase</th><th>Type</th><th id="rb">Max size</th><th>Usecase</th><th>Type</th><th id="rb">Max size</th><th>Usecase</th> </tr> <tr> <td>YUV / PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td colspan="3" id="rb"></td> <td colspan="3" id="rb"></td> <td>Simple preview or in-app image processing</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">RECORD</td><td id="rb">VIDEO_RECORD</td> <td colspan="3" id="rb"></td> <td colspan="3" id="rb"></td> <td>Simple video recording or in-app video processing</td> </tr> <tr> <td>YUV / JPEG</td><td id="rb">MAXIMUM</td><td id="rb">STILL_CAPTURE</td> <td colspan="3" id="rb"></td> <td colspan="3" id="rb"></td> <td>Simple JPEG or YUV still image capture</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">s1440p</td><td id="rb">PREVIEW_VIDEO_STILL</td> <td colspan="3" id="rb"></td> <td colspan="3" id="rb"></td> <td>Multi-purpose stream for preview, video and still image capture</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">s1440p</td><td id="rb">VIDEO_CALL</td> <td colspan="3" id="rb"></td> <td colspan="3" id="rb"></td> <td>Simple video call</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV / JPEG</td><td id="rb">MAXIMUM</td><td id="rb">STILL_CAPTURE</td> <td colspan="3" id="rb"></td> <td>Preview with JPEG or YUV still image capture</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV / PRIV</td><td id="rb">RECORD</td><td id="rb">VIDEO_RECORD</td> <td colspan="3" id="rb"></td> <td>Preview with video recording or in-app video processing</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td colspan="3" id="rb"></td> <td>Preview with in-application image processing</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV / PRIV</td><td id="rb">s1440p</td><td id="rb">VIDEO_CALL</td> <td colspan="3" id="rb"></td> <td>Preview with video call</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">s1440p</td><td id="rb">PREVIEW_VIDEO_STILL</td> <td>YUV / JPEG</td><td id="rb">MAXIMUM</td><td id="rb">STILL_CAPTURE</td> <td colspan="3" id="rb"></td> <td>MultI-purpose stream with JPEG or YUV still capture</td> </tr> <tr> <td>YUV</td><td id="rb">PREVIEW</td><td id="rb">STILL_CAPTURE</td> <td>JPEG</td><td id="rb">MAXIMUM</td><td id="rb">STILL_CAPTURE</td> <td colspan="3" id="rb"></td> <td>YUV and JPEG concurrent still image capture (for testing)</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV / PRIV</td><td id="rb">RECORD</td><td id="rb">VIDEO_RECORD</td> <td>JPEG</td><td id="rb">RECORD</td><td id="rb">STILL_CAPTURE</td> <td>Preview, video record and JPEG video snapshot</td> </tr> <tr> <td>PRIV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td><td id="rb">STILL_CAPTURE</td> <td>Preview, in-application image processing, and JPEG still image capture</td> </tr> </table><br>

Devices that include the CameraMetadata#SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW stream use-case in CameraCharacteristics#SCALER_AVAILABLE_STREAM_USE_CASES, support the additional stream combinations below:

<table> <tr><th colspan="10">STREAM_USE_CASE_CROPPED_RAW capability additional guaranteed configurations</th></tr> <tr><th colspan="3" id="rb">Target 1</th><th colspan="3" id="rb">Target 2</th><th colspan="3" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Usecase</th><th>Type</th><th id="rb">Max size</th><th>Usecase</th><th>Type</th><th id="rb">Max size</th><th>Usecase</th> </tr> <tr> <td>RAW</td><td id="rb">MAXIMUM</td><td id="rb">CROPPED_RAW</td> <td colspan="3" id="rb"></td> <td colspan="3" id="rb"></td> <td>Cropped RAW still capture without preview</td> </tr> <tr> <td>PRIV / YUV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td><td id="rb">CROPPED_RAW</td> <td colspan="3" id="rb"></td> <td>Preview with cropped RAW still capture</td> </tr> <tr> <td>PRIV / YUV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>YUV / JPEG</td><td id="rb">MAXIMUM</td><td id="rb">STILL_CAPTURE</td> <td>RAW</td><td id="rb">MAXIMUM</td><td id="rb">CROPPED_RAW</td> <td>Preview with YUV / JPEG and cropped RAW still capture</td> </tr> <tr> <td>PRIV / YUV</td><td id="rb">PREVIEW</td><td id="rb">PREVIEW</td> <td>PRIV / YUV</td><td id="rb">PREVIEW</td><td id="rb">VIDEO_RECORD / PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td><td id="rb">CROPPED_RAW</td> <td>Video recording with preview and cropped RAW still capture</td> </tr>

For devices where CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES includes CameraMetadata#CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION, the following stream combinations are guaranteed, for CaptureRequests where CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE is set to CameraMetadata#CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION

<table> <tr><th colspan="7">Preview stabilization guaranteed stream configurations</th></tr> <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV / YUV</td><td id="rb">s1440p</td><td colspan="2" id="rb"></td> <td>Stabilized preview, GPU video processing, or no-preview stabilized video recording.</td> </tr> <tr> <td>PRIV / YUV</td><td id="rb">s1440p</td> <td>JPEG / YUV</td><td id="rb">MAXIMUM</td><td>Standard still imaging with stabilized preview.</td> </tr> <tr> <td>PRIV / YUV</td><td id="rb">PREVIEW</td> <td>PRIV / YUV</td><td id="rb">s1440p</td><td>High-resolution recording with stabilized preview and recording stream.</td> </tr> </table><br>

For the maximum size column, PREVIEW refers to the best size match to the device's screen resolution, or to 1080p (1920x1080), whichever is smaller. RECORD refers to the camera device's maximum supported recording resolution, as determined by android.media.CamcorderProfile. MAXIMUM refers to the camera device's maximum output resolution for that format or target from StreamConfigurationMap#getOutputSizes(int).

Since the capabilities of camera devices vary greatly, a given camera device may support target combinations with sizes outside of these guarantees, but this can only be tested for by calling #isSessionConfigurationSupported or attempting to create a session with such targets.

Exception on 176x144 (QCIF) resolution: Camera devices usually have a fixed capability for downscaling from larger resolution to smaller, and the QCIF resolution sometimes is not fully supported due to this limitation on devices with high-resolution image sensors. Therefore, trying to configure a QCIF resolution stream together with any other stream larger than 1920x1080 resolution (either width or height) might not be supported, and capture session creation will fail if it is not.

<h3>Reprocessing</h3>

If a camera device supports YUV reprocessing (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING) or PRIVATE reprocessing (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING), the application can also create a reprocessable capture session to submit reprocess capture requests in addition to regular capture requests, by setting an android.hardware.camera2.params.SessionConfiguration#setInputConfiguration input configuration for the session. A reprocess capture request takes the next available buffer from the session's input Surface, and sends it through the camera device's processing pipeline again, to produce buffers for the request's target output Surfaces. No new image data is captured for a reprocess request. However the input buffer provided by the application must be captured previously by the same camera device in the same session directly (e.g. for Zero-Shutter-Lag use case) or indirectly (e.g. combining multiple output images).

The active reprocessable capture session determines an input Surface and the set of potential output Surfaces for the camera devices for each capture request. The application can use #createCaptureRequest createCaptureRequest to create regular capture requests to capture new images from the camera device, and use #createReprocessCaptureRequest createReprocessCaptureRequest to create reprocess capture requests to process buffers from the input Surface. Some combinations of output Surfaces in a session may not be used in a request simultaneously. The guaranteed combinations of output Surfaces that can be used in a request simultaneously are listed in the tables under #createCaptureSession createCaptureSession. All the output Surfaces in one capture request will come from the same source, either from a new capture by the camera device, or from the input Surface depending on if the request is a reprocess capture request.

Input formats and sizes supported by the camera device can be queried via StreamConfigurationMap#getInputFormats and StreamConfigurationMap#getInputSizes. For each supported input format, the camera device supports a set of output formats and sizes for reprocessing that can be queried via StreamConfigurationMap#getValidOutputFormatsForInput and StreamConfigurationMap#getOutputSizes. While output Surfaces with formats that aren't valid reprocess output targets for the input configuration can be part of a session, they cannot be used as targets for a reprocessing request.

Since the application cannot access android.graphics.ImageFormat#PRIVATE images directly, an output Surface created by android.media.ImageReader#newInstance with android.graphics.ImageFormat#PRIVATE as the format will be considered as intended to be used for reprocessing input and thus the android.media.ImageReader size must match one of the supported input sizes for android.graphics.ImageFormat#PRIVATE format. Otherwise, creating a reprocessable capture session will fail.

Starting from API level 30, recreating a reprocessable capture session will flush all the queued but not yet processed buffers from the input surface.

The configurations in the tables below are guaranteed for creating a reprocessable capture session if the camera device supports YUV reprocessing or PRIVATE reprocessing. However, not all output targets used to create a reprocessable session may be used in a CaptureRequest simultaneously. For devices that support only 1 output target in a reprocess CaptureRequest, submitting a reprocess CaptureRequest with multiple output targets will result in a CaptureFailure. For devices that support multiple output targets in a reprocess CaptureRequest, the guaranteed output targets that can be included in a CaptureRequest simultaneously are listed in the tables under #createCaptureSession createCaptureSession. For example, with a FULL-capability (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL) device that supports PRIVATE reprocessing, an application can create a reprocessable capture session with 1 input, (PRIV, MAXIMUM), and 3 outputs, (PRIV, MAXIMUM), (PRIV, PREVIEW), and (YUV, MAXIMUM). However, it's not guaranteed that an application can submit a regular or reprocess capture with (PRIV, MAXIMUM) and (YUV, MAXIMUM) outputs based on the table listed under #createCaptureSession createCaptureSession. In other words, use the tables below to determine the guaranteed stream configurations for creating a reprocessable capture session, and use the tables under #createCaptureSession createCaptureSession to determine the guaranteed output targets that can be submitted in a regular or reprocess CaptureRequest simultaneously.

Reprocessing with 10-bit output targets on 10-bit capable CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT devices is not supported. Trying to initialize a repreocessable capture session with one ore more output configurations set OutputConfiguration#setDynamicRangeProfile to use a 10-bit dynamic range profile android.hardware.camera2.params.DynamicRangeProfiles will trigger IllegalArgumentException.

<style scoped> #rb { border-right-width: thick; }</style>

LIMITED-level (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED) devices support at least the following stream combinations for creating a reprocessable capture session in addition to those listed earlier for regular captures for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED devices:

<table> <tr><th colspan="11">LIMITED-level additional guaranteed configurations for creating a reprocessable capture session<br>(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)</th></tr> <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td></td><td id="rb"></td> <td>No-viewfinder still image reprocessing.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td>ZSL(Zero-Shutter-Lag) still imaging.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td>ZSL still and in-app processing imaging.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>ZSL in-app processing with still capture.</td> </tr> </table><br>

FULL-level (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL) devices support at least the following stream combinations for creating a reprocessable capture session in addition to those for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED devices:

<table> <tr><th colspan="11">FULL-level additional guaranteed configurations for creating a reprocessable capture session<br>(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)</th></tr> <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>YUV</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td></td><td id="rb"></td> <td></td><td id="rb"></td> <td>Maximum-resolution multi-frame image fusion in-app processing with regular preview.</td> </tr> <tr> <td>YUV</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td></td><td id="rb"></td> <td></td><td id="rb"></td> <td>Maximum-resolution multi-frame image fusion two-input in-app processing.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">RECORD</td> <td></td><td id="rb"></td> <td>High-resolution ZSL in-app video processing with regular preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td>Maximum-resolution ZSL in-app processing with regular preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td>Maximum-resolution two-input ZSL in-app processing.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>ZSL still capture and in-app processing.</td> </tr> </table><br>

RAW-capability (CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES includes CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW) devices additionally support at least the following stream combinations for creating a reprocessable capture session on both CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL and CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED devices

<table> <tr><th colspan="11">RAW-capability additional guaranteed configurations for creating a reprocessable capture session<br>(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)</th></tr> <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td>Mutually exclusive ZSL in-app processing and DNG capture.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Mutually exclusive ZSL in-app processing and preview with DNG capture.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Mutually exclusive ZSL two-input in-app processing and DNG capture.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Mutually exclusive ZSL still capture and preview with DNG capture.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MAXIMUM</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>Mutually exclusive ZSL in-app processing with still capture and DNG capture.</td> </tr> </table><br>

LEVEL-3 (CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL==CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3 LEVEL_3) devices support at least the following stream combinations for creating a reprocessable capture session in addition to those for CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL devices. Note that while the second configuration allows for configuring MAXIMUMYUV and JPEG outputs at the same time, that configuration is not listed for regular capture sessions, and therefore simultaneous output to both targets is not allowed.

<table> <tr><th colspan="13">LEVEL-3 additional guaranteed configurations for creating a reprocessable capture session<br>(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is always guaranteed.</th></tr> <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th colspan="2" id="rb">Target 5</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>YUV</td><td id="rb">MAXIMUM</td> <td>YUV</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">640x480</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td></td><td id="rb"></td> <td>In-app viewfinder analysis with ZSL and RAW.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MAXIMUM</td> <td>Same as input</td><td id="rb">MAXIMUM</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>PRIV</td><td id="rb">640x480</td> <td>RAW</td><td id="rb">MAXIMUM</td> <td>JPEG</td><td id="rb">MAXIMUM</td><td>In-app viewfinder analysis with ZSL, RAW, and JPEG reprocessing output.</td> </tr> </table><br>

If a camera device supports multi-resolution YUV input and multi-resolution YUV output or supports multi-resolution PRIVATE input and multi-resolution PRIVATE output, the additional mandatory stream combinations for LIMITED and FULL devices are listed below (MULTI_RES in the Max size column refers to a MultiResolutionImageReader for output, and a multi-resolution InputConfiguration for input): <table> <tr><th colspan="11">LIMITED-level additional guaranteed configurations for creating a reprocessable capture session with multi-resolution input and multi-resolution outputs<br>(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)</th></tr> <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV/YUV</td><td id="rb">MULTI_RES</td> <td>Same as input</td><td id="rb">MULTI_RES</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td></td><td id="rb"></td> <td></td><td id="rb"></td> <td>No-viewfinder still image reprocessing.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MULTI_RES</td> <td>Same as input</td><td id="rb">MULTI_RES</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td></td><td id="rb"></td> <td>ZSL(Zero-Shutter-Lag) still imaging.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MULTI_RES</td> <td>Same as input</td><td id="rb">MULTI_RES</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td></td><td id="rb"></td> <td>ZSL still and in-app processing imaging.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MULTI_RES</td> <td>Same as input</td><td id="rb">MULTI_RES</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td>ZSL in-app processing with still capture.</td> </tr> </table><br> <table> <tr><th colspan="11">FULL-level additional guaranteed configurations for creating a reprocessable capture session with multi-resolution input and multi-resolution outputs<br>(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)</th></tr> <tr><th colspan="2" id="rb">Input</th><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th colspan="2" id="rb">Target 4</th><th rowspan="2">Sample use case(s)</th> </tr> <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr> <tr> <td>PRIV</td><td id="rb">MULTI_RES</td> <td>PRIV</td><td id="rb">MULTI_RES</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MULTI_RES</td> <td></td><td id="rb"></td> <td>Maximum-resolution ZSL in-app processing with regular preview.</td> </tr> <tr> <td>PRIV</td><td id="rb">MULTI_RES</td> <td>PRIV</td><td id="rb">MULTI_RES</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">MULTI_RES</td> <td></td><td id="rb"></td> <td>Maximum-resolution two-input ZSL in-app processing.</td> </tr> <tr> <td>PRIV/YUV</td><td id="rb">MULTI_RES</td> <td>Same as input</td><td id="rb">MULTI_RES</td> <td>PRIV</td><td id="rb">PREVIEW</td> <td>YUV</td><td id="rb">PREVIEW</td> <td>JPEG</td><td id="rb">MULTI_RES</td> <td>ZSL still capture and in-app processing.</td> </tr> </table><br>

Devices with the ULTRA_HIGH_RESOLUTION_SENSOR capability have some additional guarantees which clients can take advantage of :

<table> <tr><th colspan="13">Additional guaranteed combinations for ULTRA_HIGH_RESOLUTION sensors (YUV / PRIV inputs are guaranteed only if YUV / PRIVATE reprocessing are supported)</th></tr> <tr> <th colspan="3" id="rb">Input</th> <th colspan="3" id="rb">Target 1</th> <th colspan="3" id="rb">Target 2</th> <th colspan="3" id="rb">Target 3</th> <th rowspan="2">Sample use case(s)</th> </tr> <tr> <th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th><th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th> <th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th> <th>Type</th><th id="rb"> SC Map</th><th id="rb">Max size</th></tr> <tr> <td>RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td>RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td id="rb">PRIV / YUV</td><td id="rb">DEFAULT</td><td id="rb">PREVIEW</td><td colspan="3" id="rb"></td> <td>RAW remosaic reprocessing with separate preview</td> </tr> <tr> <td>RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td>RAW</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td id="rb">PRIV / YUV</td><td id="rb">DEFAULT</td><td id="rb">PREVIEW</td><td id="rb">JPEG / YUV</td><td id="rb">MAX_RES</td><td id="rb">MAX</td> <td>Ultra high res RAW -> JPEG / YUV with seperate preview</td> </tr> <tr> <td>YUV / PRIV</td><td id="rb">MAX_RES</td><td id="rb">MAX</td> <td>YUV / PRIV</td><td id="rb">MAX_RES</td><td id="rb">MAX</td><td id="rb">YUV / PRIV</td><td id="rb">DEFAULT</td><td id="rb">PREVIEW</td><td id="rb">JPEG</td><td id="rb">MAX_RES</td><td id="rb">MAX</td> <td> Ultra high res PRIV / YUV -> YUV / JPEG reprocessing with seperate preview</td> </tr> </table><br> No additional mandatory stream combinations for RAW capability and LEVEL-3 hardware level. </p>

<h3>Constrained high-speed recording</h3>

The application can use a android.hardware.camera2.params.SessionConfiguration#SESSION_REGULAR normal capture session for high speed capture if the desired high speed FPS ranges are advertised by CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, in which case all API semantics associated with normal capture sessions applies.

A android.hardware.camera2.params.SessionConfiguration#SESSION_HIGH_SPEED high-speed capture session can be use for high speed video recording (>=120fps) when the camera device supports high speed video capability (i.e., CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES contains CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO). A constrained high-speed capture session has special limitations compared with a normal capture session:

<ul>

<li>In addition to the output target Surface requirements specified above for regular captures, a high speed capture session will only support up to 2 output Surfaces, though the application might choose to configure just one Surface (e.g., preview only). All Surfaces must be either video encoder surfaces (acquired by android.media.MediaRecorder#getSurface or android.media.MediaCodec#createInputSurface) or preview surfaces (obtained from android.view.SurfaceView, android.graphics.SurfaceTexture via android.view.Surface#Surface(android.graphics.SurfaceTexture)). The Surface sizes must be one of the sizes reported by StreamConfigurationMap#getHighSpeedVideoSizes. When multiple Surfaces are configured, their size must be same.</li>

<li>An active high speed capture session only accepts request lists created via CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList, and the request list can only be submitted to this session via CameraCaptureSession#captureBurst captureBurst, or CameraCaptureSession#setRepeatingBurst setRepeatingBurst.</li>

<li>The FPS ranges being requested to this session must be selected from StreamConfigurationMap#getHighSpeedVideoFpsRangesFor. The application can still use CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE to control the desired FPS range. Switching to an FPS range that has different android.util.Range#getUpper() maximum FPS may trigger some camera device reconfigurations, which may introduce extra latency. It is recommended that the application avoids unnecessary maximum target FPS changes as much as possible during high speed streaming.</li>

<li>For the request lists submitted to this session, the camera device will override the CaptureRequest#CONTROL_MODE control mode, auto-exposure (AE), auto-white balance (AWB) and auto-focus (AF) to CameraMetadata#CONTROL_MODE_AUTO, CameraMetadata#CONTROL_AE_MODE_ON, CameraMetadata#CONTROL_AWB_MODE_AUTO and CameraMetadata#CONTROL_AF_MODE_CONTINUOUS_VIDEO, respectively. All post-processing block mode controls will be overridden to be FAST. Therefore, no manual control of capture and post-processing parameters is possible. Beside these, only a subset of controls will work, see CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO for more details.</li>

</ul>

Java documentation for android.hardware.camera2.CameraDevice.createCaptureSession(android.hardware.camera2.params.SessionConfiguration).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

CreateCaptureSession(IList<Surface>, CameraCaptureSession+StateCallback, Handler)

[Android.Runtime.Register("createCaptureSession", "(Ljava/util/List;Landroid/hardware/camera2/CameraCaptureSession$StateCallback;Landroid/os/Handler;)V", "GetCreateCaptureSession_Ljava_util_List_Landroid_hardware_camera2_CameraCaptureSession_StateCallback_Landroid_os_Handler_Handler")]
public abstract void CreateCaptureSession (System.Collections.Generic.IList<Android.Views.Surface> outputs, Android.Hardware.Camera2.CameraCaptureSession.StateCallback callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("createCaptureSession", "(Ljava/util/List;Landroid/hardware/camera2/CameraCaptureSession$StateCallback;Landroid/os/Handler;)V", "GetCreateCaptureSession_Ljava_util_List_Landroid_hardware_camera2_CameraCaptureSession_StateCallback_Landroid_os_Handler_Handler")>]
abstract member CreateCaptureSession : System.Collections.Generic.IList<Android.Views.Surface> * Android.Hardware.Camera2.CameraCaptureSession.StateCallback * Android.OS.Handler -> unit

Parameters

outputs
IList<Surface>
handler
Handler
Attributes

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to