CameraDevice  |  API reference  |  Android Developers

createCaptureSession

public void createCaptureSession (SessionConfiguration config)

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 capture, captureBurst, setRepeatingRequest, or setRepeatingBurst.

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

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 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.

This function throws an IllegalArgumentException if called with a SessionConfiguration lacking state callbacks or valid output surfaces. The only exceptions are deferred SurfaceView or SurfaceTexture outputs. See OutputConfiguration.OutputConfiguration(Size,Class) for details.

Regular capture

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 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 ImageFormat.YUV_420_888 format, JPEG refers to the ImageFormat.JPEG format, and RAW refers to the 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 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.

LEGACY-level guaranteed configurations

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

Target 1 Target 2 Target 3 Sample use case(s)
TypeMax size TypeMax size TypeMax size
PRIVMAXIMUM Simple preview, GPU video processing, or no-preview video recording.
JPEGMAXIMUM No-viewfinder still image capture.
YUV MAXIMUM In-application video/image processing.
PRIVPREVIEW JPEGMAXIMUM Standard still imaging.
YUV PREVIEW JPEGMAXIMUM In-app processing plus still capture.
PRIVPREVIEW PRIVPREVIEW Standard recording.
PRIVPREVIEW YUV PREVIEW Preview plus in-app processing.
PRIVPREVIEW YUV PREVIEW JPEGMAXIMUM Still capture plus in-app processing.

LIMITED-level additional guaranteed configurations

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

Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax size
PRIVPREVIEW PRIVRECORD High-resolution video recording with preview.
PRIVPREVIEW YUV RECORD High-resolution in-app video processing with preview.
YUV PREVIEW YUV RECORD Two-input in-app video processing.
PRIVPREVIEW PRIVRECORD JPEGRECORD High-resolution recording with video snapshot.
PRIVPREVIEW YUV RECORD JPEGRECORD High-resolution in-app processing with video snapshot.
YUV PREVIEW YUV PREVIEW JPEGMAXIMUM Two-input in-app processing with still capture.

FULL-level additional guaranteed configurations

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

Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax size
PRIVPREVIEW PRIVMAXIMUM Maximum-resolution GPU processing with preview.
PRIVPREVIEW YUV MAXIMUM Maximum-resolution in-app processing with preview.
YUV PREVIEW YUV MAXIMUM Maximum-resolution two-input in-app processing.
PRIVPREVIEW PRIVPREVIEW JPEGMAXIMUM Video recording with maximum-size video snapshot
YUV 640x480 PRIVPREVIEW YUV MAXIMUM Standard video recording plus maximum-resolution in-app processing.
YUV 640x480 YUV PREVIEW YUV MAXIMUM Preview plus two-input maximum-resolution in-app processing.

RAW-capability additional guaranteed configurations

RAW-capability (CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES includes RAW) devices additionally support at least the following stream combinations on both FULL and LIMITED devices:

Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax size
RAW MAXIMUM No-preview DNG capture.
PRIVPREVIEW RAW MAXIMUM Standard DNG capture.
YUV PREVIEW RAW MAXIMUM In-app processing plus DNG capture.
PRIVPREVIEW PRIVPREVIEW RAW MAXIMUM Video recording with DNG capture.
PRIVPREVIEW YUV PREVIEW RAW MAXIMUM Preview with in-app processing and DNG capture.
YUV PREVIEW YUV PREVIEW RAW MAXIMUM Two-input in-app processing plus DNG capture.
PRIVPREVIEW JPEGMAXIMUM RAW MAXIMUM Still capture with simultaneous JPEG and DNG.
YUV PREVIEW JPEGMAXIMUM RAW MAXIMUM In-app processing with simultaneous JPEG and DNG.

BURST-capability additional guaranteed configurations

BURST-capability (CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES includes BURST_CAPTURE) devices support at least the below stream combinations in addition to those for 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.

Target 1Target 2Sample use case(s)
TypeMax sizeTypeMax size
PRIVPREVIEW PRIVMAXIMUM Maximum-resolution GPU processing with preview.
PRIVPREVIEW YUV MAXIMUM Maximum-resolution in-app processing with preview.
YUV PREVIEW YUV MAXIMUM Maximum-resolution two-input in-app processing.

LEVEL-3 additional guaranteed configurations

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

Target 1Target 2Target 3Target 4Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
PRIVPREVIEW PRIV640x480 YUVMAXIMUM RAWMAXIMUM In-app viewfinder analysis with dynamic selection of output format.
PRIVPREVIEW PRIV640x480 JPEGMAXIMUM RAWMAXIMUM In-app viewfinder analysis with dynamic selection of output format.

Concurrent stream guaranteed configurations

BACKWARD_COMPATIBLE devices capable of streaming concurrently with other devices as described by 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.

Target 1Target 2Sample use case(s)
TypeMax sizeTypeMax size
YUVs1440p In-app video / image processing.
PRIVs1440p In-app viewfinder analysis.
JPEGs1440p No viewfinder still image capture.
YUV / PRIVs720p JPEGs1440p Standard still imaging.
YUV / PRIVs720p YUV / PRIV s1440p In-app video / processing with preview.

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 MONOCHROME) devices supporting 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 MandatoryStreamCombination.

Devices capable of outputting HEIC formats (StreamConfigurationMap.getOutputFormats contains 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.

LEGACY-level additional guaranteed combinations with multi-resolution outputs

Devices capable of multi-resolution output for a particular format ( MultiResolutionStreamConfigurationMap.getOutputInfo(int) 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):

Target 1 Target 2 Target 3 Sample use case(s)
TypeMax size TypeMax size TypeMax size
PRIVMULTI_RES Simple preview, GPU video processing, or no-preview video recording.
JPEGMULTI_RES No-viewfinder still image capture.
PRIVPREVIEW JPEGMULTI_RES Standard still imaging.
PRIVPREVIEW YUV PREVIEW JPEGMULTI_RES Still capture plus in-app processing.

LIMITED-level additional guaranteed configurations with multi-resolution outputs
Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax size
YUV PREVIEW YUV PREVIEW JPEGMULTI_RES Two-input in-app processing with still capture.

The same logic applies to other hardware levels and capabilities.

Additional guaranteed combinations for ULTRA_HIGH_RESOLUTION sensors

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

Target 1 Target 2 Target 3 Sample use case(s)
Type SC MapMax size Type SC MapMax size Type SC MapMax size
YUV / JPEG / RAWMAX_RESMAXPRIV / YUVDEFAULTPREVIEW Ultra high res still image capture with preview
YUV / JPEG / RAWMAX_RESMAXPRIVDEFAULTPREVIEWPRIV / YUVDEFAULTRECORD Ultra high res still capture with preview + app based RECORD size analysis
YUV / JPEG / RAWMAX_RESMAXPRIVDEFAULTPREVIEWJPEG / YUV / RAWDEFAULTMAX Ultra high res still image capture with preview + default sensor pixel mode analysis stream

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 additional guaranteed configurations

10-bit output capable CameraMetadata.REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT devices support at least the following stream combinations:

Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax size
PRIVMAXIMUM Simple preview, GPU video processing, or no-preview video recording.
YUVMAXIMUM In-application video/image processing.
PRIVPREVIEW JPEGMAXIMUM Standard still imaging.
PRIVPREVIEW YUV MAXIMUM Maximum-resolution in-app processing with preview.
YUVPREVIEW YUVMAXIMUM Maximum-resolution two-input in-app processing.
PRIVPREVIEW PRIVRECORD High-resolution video recording with preview.
PRIVPREVIEW PRIVRECORD YUVRECORD High-resolution recording with in-app snapshot.
PRIVPREVIEW PRIV RECORD JPEGRECORD High-resolution recording with video snapshot.

Here PRIV can be either 8 or 10-bit ImageFormat.PRIVATE pixel format. YUV can be either ImageFormat.YUV_420_888 or 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 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 ImageFormat.YUV_420_888 with a 10-bit profile will cause a capture session initialization failure.

ImageFormat.JPEG_R may also be supported if advertised by 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:

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 isSessionConfigurationSupported(SessionConfiguration) to ensure that this particular configuration is supported.

STREAM_USE_CASE capability additional guaranteed configurations

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

Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeUsecaseTypeMax sizeUsecaseTypeMax sizeUsecase
YUV / PRIVPREVIEWPREVIEW Simple preview or in-app image processing
YUV / PRIVRECORDVIDEO_RECORD Simple video recording or in-app video processing
YUV / JPEGMAXIMUMSTILL_CAPTURE Simple JPEG or YUV still image capture
YUV / PRIVs1440pPREVIEW_VIDEO_STILL Multi-purpose stream for preview, video and still image capture
YUV / PRIVs1440pVIDEO_CALL Simple video call
PRIVPREVIEWPREVIEW YUV / JPEGMAXIMUMSTILL_CAPTURE Preview with JPEG or YUV still image capture
PRIVPREVIEWPREVIEW YUV / PRIVRECORDVIDEO_RECORD Preview with video recording or in-app video processing
PRIVPREVIEWPREVIEW YUVPREVIEWPREVIEW Preview with in-application image processing
PRIVPREVIEWPREVIEW YUV / PRIVs1440pVIDEO_CALL Preview with video call
YUV / PRIVs1440pPREVIEW_VIDEO_STILL YUV / JPEGMAXIMUMSTILL_CAPTURE MultI-purpose stream with JPEG or YUV still capture
YUVPREVIEWSTILL_CAPTURE JPEGMAXIMUMSTILL_CAPTURE YUV and JPEG concurrent still image capture (for testing)
PRIVPREVIEWPREVIEW YUV / PRIVRECORDVIDEO_RECORD JPEGRECORDSTILL_CAPTURE Preview, video record and JPEG video snapshot
PRIVPREVIEWPREVIEW YUVPREVIEWPREVIEW JPEGMAXIMUMSTILL_CAPTURE Preview, in-application image processing, and JPEG still image capture

STREAM_USE_CASE_CROPPED_RAW capability additional guaranteed configurations

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:

Target 1Target 2Target 3 Sample use case(s)
TypeMax sizeUsecaseTypeMax sizeUsecaseTypeMax sizeUsecase
RAWMAXIMUMCROPPED_RAW Cropped RAW still capture without preview
PRIV / YUVPREVIEWPREVIEW RAWMAXIMUMCROPPED_RAW Preview with cropped RAW still capture
PRIV / YUVPREVIEWPREVIEW YUV / JPEGMAXIMUMSTILL_CAPTURE RAWMAXIMUMCROPPED_RAW Preview with YUV / JPEG and cropped RAW still capture
PRIV / YUVPREVIEWPREVIEW PRIV / YUVPREVIEWVIDEO_RECORD / PREVIEW RAWMAXIMUMCROPPED_RAW Video recording with preview and cropped RAW still capture

Preview stabilization guaranteed stream configurations

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

Target 1Target 2Sample use case(s)
TypeMax sizeTypeMax size
PRIV / YUVs1440p Stabilized preview, GPU video processing, or no-preview stabilized video recording.
PRIV / YUVs1440p JPEG / YUVMAXIMUM Standard still imaging with stabilized preview.
PRIV / YUVPREVIEW PRIV / YUVs1440p High-resolution recording with stabilized preview and recording stream.

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 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(SessionConfiguration) 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.

Reprocessing

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 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 to create regular capture requests to capture new images from the camera device, and use 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. 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 ImageFormat.PRIVATE images directly, an output Surface created by ImageReader.newInstance(int, int, int, int) with ImageFormat.PRIVATE as the format will be considered as intended to be used for reprocessing input and thus the ImageReader size must match one of the supported input sizes for 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. For example, with a FULL-capability (CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL == 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. 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 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 DynamicRangeProfiles will trigger IllegalArgumentException.

LIMITED-level (CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL == 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 LIMITED devices:

LIMITED-level additional guaranteed configurations for creating a reprocessable capture session
(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)
InputTarget 1Target 2Target 3Target 4Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
PRIV/YUVMAXIMUM Same as inputMAXIMUM JPEGMAXIMUM No-viewfinder still image reprocessing.
PRIV/YUVMAXIMUM Same as inputMAXIMUM PRIVPREVIEW JPEGMAXIMUM ZSL(Zero-Shutter-Lag) still imaging.
PRIV/YUVMAXIMUM Same as inputMAXIMUM YUVPREVIEW JPEGMAXIMUM ZSL still and in-app processing imaging.
PRIV/YUVMAXIMUM Same as inputMAXIMUM YUVPREVIEW YUVPREVIEW JPEGMAXIMUM ZSL in-app processing with still capture.

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

FULL-level additional guaranteed configurations for creating a reprocessable capture session
(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)
InputTarget 1Target 2Target 3Target 4Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
YUVMAXIMUM YUVMAXIMUM PRIVPREVIEW Maximum-resolution multi-frame image fusion in-app processing with regular preview.
YUVMAXIMUM YUVMAXIMUM YUVPREVIEW Maximum-resolution multi-frame image fusion two-input in-app processing.
PRIV/YUVMAXIMUM Same as inputMAXIMUM PRIVPREVIEW YUVRECORD High-resolution ZSL in-app video processing with regular preview.
PRIVMAXIMUM PRIVMAXIMUM PRIVPREVIEW YUVMAXIMUM Maximum-resolution ZSL in-app processing with regular preview.
PRIVMAXIMUM PRIVMAXIMUM YUVPREVIEW YUVMAXIMUM Maximum-resolution two-input ZSL in-app processing.
PRIV/YUVMAXIMUM Same as inputMAXIMUM PRIVPREVIEW YUVPREVIEW JPEGMAXIMUM ZSL still capture and in-app processing.

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

RAW-capability additional guaranteed configurations for creating a reprocessable capture session
(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)
InputTarget 1Target 2Target 3Target 4Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
PRIV/YUVMAXIMUM Same as inputMAXIMUM YUVPREVIEW RAWMAXIMUM Mutually exclusive ZSL in-app processing and DNG capture.
PRIV/YUVMAXIMUM Same as inputMAXIMUM PRIVPREVIEW YUVPREVIEW RAWMAXIMUM Mutually exclusive ZSL in-app processing and preview with DNG capture.
PRIV/YUVMAXIMUM Same as inputMAXIMUM YUVPREVIEW YUVPREVIEW RAWMAXIMUM Mutually exclusive ZSL two-input in-app processing and DNG capture.
PRIV/YUVMAXIMUM Same as inputMAXIMUM PRIVPREVIEW JPEGMAXIMUM RAWMAXIMUM Mutually exclusive ZSL still capture and preview with DNG capture.
PRIV/YUVMAXIMUM Same as inputMAXIMUM YUVPREVIEW JPEGMAXIMUM RAWMAXIMUM Mutually exclusive ZSL in-app processing with still capture and DNG capture.

LEVEL-3 (CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL == LEVEL_3) devices support at least the following stream combinations for creating a reprocessable capture session in addition to those for FULL devices. Note that while the second configuration allows for configuring MAXIMUM YUV 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.

LEVEL-3 additional guaranteed configurations for creating a reprocessable capture session
(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is always guaranteed.
InputTarget 1Target 2Target 3Target 4Target 5Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
YUVMAXIMUM YUVMAXIMUM PRIVPREVIEW PRIV640x480 RAWMAXIMUM In-app viewfinder analysis with ZSL and RAW.
PRIV/YUVMAXIMUM Same as inputMAXIMUM PRIVPREVIEW PRIV640x480 RAWMAXIMUM JPEGMAXIMUMIn-app viewfinder analysis with ZSL, RAW, and JPEG reprocessing output.

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):

LIMITED-level additional guaranteed configurations for creating a reprocessable capture session with multi-resolution input and multi-resolution outputs
(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)
InputTarget 1Target 2Target 3Target 4Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
PRIV/YUVMULTI_RES Same as inputMULTI_RES JPEGMULTI_RES No-viewfinder still image reprocessing.
PRIV/YUVMULTI_RES Same as inputMULTI_RES PRIVPREVIEW JPEGMULTI_RES ZSL(Zero-Shutter-Lag) still imaging.
PRIV/YUVMULTI_RES Same as inputMULTI_RES YUVPREVIEW JPEGMULTI_RES ZSL still and in-app processing imaging.
PRIV/YUVMULTI_RES Same as inputMULTI_RES YUVPREVIEW YUVPREVIEW JPEGMULTI_RES ZSL in-app processing with still capture.

FULL-level additional guaranteed configurations for creating a reprocessable capture session with multi-resolution input and multi-resolution outputs
(PRIV input is guaranteed only if PRIVATE reprocessing is supported. YUV input is guaranteed only if YUV reprocessing is supported)
InputTarget 1Target 2Target 3Target 4Sample use case(s)
TypeMax sizeTypeMax sizeTypeMax sizeTypeMax sizeTypeMax size
PRIVMULTI_RES PRIVMULTI_RES PRIVPREVIEW YUVMULTI_RES Maximum-resolution ZSL in-app processing with regular preview.
PRIVMULTI_RES PRIVMULTI_RES YUVPREVIEW YUVMULTI_RES Maximum-resolution two-input ZSL in-app processing.
PRIV/YUVMULTI_RES Same as inputMULTI_RES PRIVPREVIEW YUVPREVIEW JPEGMULTI_RES ZSL still capture and in-app processing.

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

Additional guaranteed combinations for ULTRA_HIGH_RESOLUTION sensors (YUV / PRIV inputs are guaranteed only if YUV / PRIVATE reprocessing are supported)
Input Target 1 Target 2 Target 3 Sample use case(s)
Type SC MapMax sizeType SC MapMax size Type SC MapMax size Type SC MapMax size
RAWMAX_RESMAXRAWMAX_RESMAXPRIV / YUVDEFAULTPREVIEW RAW remosaic reprocessing with separate preview
RAWMAX_RESMAXRAWMAX_RESMAXPRIV / YUVDEFAULTPREVIEWJPEG / YUVMAX_RESMAX Ultra high res RAW -> JPEG / YUV with seperate preview
YUV / PRIVMAX_RESMAX YUV / PRIVMAX_RESMAXYUV / PRIVDEFAULTPREVIEWJPEG MAX_RESMAX Ultra high res PRIV / YUV -> YUV / JPEG reprocessing with seperate preview

No additional mandatory stream combinations for RAW capability and LEVEL-3 hardware level.

Constrained high-speed recording

The application can use a 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 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:

Parameters
config SessionConfiguration: A session configuration (see SessionConfiguration).
Throws
CameraAccessException In case the camera device is no longer connected or has encountered a fatal error.
IllegalArgumentException In case the session configuration is invalid; or the output configurations are empty; or the session configuration executor is invalid; or the output dynamic range combination is invalid/unsupported; or the session type is not shared when camera has been opened in shared mode.

See also: