Compartilhar via


StreamConfigurationMap.GetOutputStallDuration Method

Definition

Overloads

GetOutputStallDuration(Class, Size)

Get the stall duration for the class/size combination (in nanoseconds).

GetOutputStallDuration(Int32, Size)

Get the stall duration for the format/size combination (in nanoseconds).

GetOutputStallDuration(Class, Size)

Get the stall duration for the class/size combination (in nanoseconds).

[Android.Runtime.Register("getOutputStallDuration", "(Ljava/lang/Class;Landroid/util/Size;)J", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public long GetOutputStallDuration (Java.Lang.Class? klass, Android.Util.Size? size);
[<Android.Runtime.Register("getOutputStallDuration", "(Ljava/lang/Class;Landroid/util/Size;)J", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
member this.GetOutputStallDuration : Java.Lang.Class * Android.Util.Size -> int64

Parameters

klass
Class

a class which is supported by #isOutputSupportedFor(Class) and has a non-empty array returned by #getOutputSizes(Class)

size
Size

an output-compatible size

Returns

a minimum frame duration >= 0 in nanoseconds

Attributes

Remarks

Get the stall duration for the class/size combination (in nanoseconds).

This assumes that the klass is set up to use ImageFormat#PRIVATE. For user-defined formats, use #getOutputMinFrameDuration(int, Size).

klass should be one of the ones with a non-empty array returned by #getOutputSizes(Class).

size should be one of the ones returned by #getOutputSizes(Class).

See #getOutputStallDuration(int, Size) for a definition of a <em>stall duration</em>.

Java documentation for android.hardware.camera2.params.StreamConfigurationMap.getOutputStallDuration(java.lang.Class<T>, android.util.Size).

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

GetOutputStallDuration(Int32, Size)

Get the stall duration for the format/size combination (in nanoseconds).

[Android.Runtime.Register("getOutputStallDuration", "(ILandroid/util/Size;)J", "")]
public long GetOutputStallDuration (int format, Android.Util.Size? size);
[<Android.Runtime.Register("getOutputStallDuration", "(ILandroid/util/Size;)J", "")>]
member this.GetOutputStallDuration : int * Android.Util.Size -> int64

Parameters

format
Int32

an image format from ImageFormat or PixelFormat

size
Size

an output-compatible size

Returns

a stall duration >= 0 in nanoseconds

Attributes

Exceptions

if format or size was not supported

if size was null

Remarks

Get the stall duration for the format/size combination (in nanoseconds).

format should be one of the ones returned by #getOutputFormats().

size should be one of the ones returned by #getOutputSizes(int).

A stall duration is how much extra time would get added to the normal minimum frame duration for a repeating request that has streams with non-zero stall.

For example, consider JPEG captures which have the following characteristics:

<ul> <li>JPEG streams act like processed YUV streams in requests for which they are not included; in requests in which they are directly referenced, they act as JPEG streams. This is because supporting a JPEG stream requires the underlying YUV data to always be ready for use by a JPEG encoder, but the encoder will only be used (and impact frame duration) on requests that actually reference a JPEG stream. <li>The JPEG processor can run concurrently to the rest of the camera pipeline, but cannot process more than 1 capture at a time. </ul>

In other words, using a repeating YUV request would result in a steady frame rate (let's say it's 30 FPS). If a single JPEG request is submitted periodically, the frame rate will stay at 30 FPS (as long as we wait for the previous JPEG to return each time). If we try to submit a repeating YUV + JPEG request, then the frame rate will drop from 30 FPS.

In general, submitting a new request with a non-0 stall time stream will <em>not</em> cause a frame rate drop unless there are still outstanding buffers for that stream from previous requests.

Submitting a repeating request with streams (call this S) is the same as setting the minimum frame duration from the normal minimum frame duration corresponding to S, added with the maximum stall duration for S.

If interleaving requests with and without a stall duration, a request will stall by the maximum of the remaining times for each can-stall stream with outstanding buffers.

This means that a stalling request will not have an exposure start until the stall has completed.

This should correspond to the stall duration when only that stream is active, with all processing (typically in android.*.mode) set to FAST or OFF. Setting any of the processing modes to HIGH_QUALITY effectively results in an indeterminate stall duration for all streams in a request (the regular stall calculation rules are ignored).

The following formats may always have a stall duration: <ul> <li>ImageFormat#JPEG JPEG<li>ImageFormat#RAW_SENSOR RAW16<li>ImageFormat#RAW_PRIVATE RAW_PRIVATE</ul>

The following formats will never have a stall duration: <ul> <li>ImageFormat#YUV_420_888 YUV_420_888<li>ImageFormat#PRIVATE PRIVATE</ul>

All other formats may or may not have an allowed stall duration on a per-capability basis; refer to CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities for more details.

</p>

See CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration for more information about calculating the max frame rate (absent stalls).

Java documentation for android.hardware.camera2.params.StreamConfigurationMap.getOutputStallDuration(int, android.util.Size).

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.

See also

Applies to