Språk

CameraCaptureSession.CaptureCallback.OnReadoutStarted Method

Definition

This method is called when the camera device has started reading out the output image for the request, at the beginning of the sensor image readout.

[Android.Runtime.Register("onReadoutStarted", "(Landroid/hardware/camera2/CameraCaptureSession;Landroid/hardware/camera2/CaptureRequest;JJ)V", "GetOnReadoutStarted_Landroid_hardware_camera2_CameraCaptureSession_Landroid_hardware_camera2_CaptureRequest_JJHandler", ApiSince=34)]
public virtual void OnReadoutStarted(Android.Hardware.Camera2.CameraCaptureSession session, Android.Hardware.Camera2.CaptureRequest request, long timestamp, long frameNumber);
[<Android.Runtime.Register("onReadoutStarted", "(Landroid/hardware/camera2/CameraCaptureSession;Landroid/hardware/camera2/CaptureRequest;JJ)V", "GetOnReadoutStarted_Landroid_hardware_camera2_CameraCaptureSession_Landroid_hardware_camera2_CaptureRequest_JJHandler", ApiSince=34)>]
abstract member OnReadoutStarted : Android.Hardware.Camera2.CameraCaptureSession * Android.Hardware.Camera2.CaptureRequest * int64 * int64 -> unit
override this.OnReadoutStarted : Android.Hardware.Camera2.CameraCaptureSession * Android.Hardware.Camera2.CaptureRequest * int64 * int64 -> unit

Parameters

session
CameraCaptureSession

the session returned by CameraDevice#createCaptureSession

request
CaptureRequest

the request for the readout that just began

timestamp
Int64

the timestamp at start of readout for a regular request, or the timestamp at the input image's start of readout for a reprocess request, in nanoseconds.

frameNumber
Int64

the frame number for this capture

Attributes

Remarks

This method is called when the camera device has started reading out the output image for the request, at the beginning of the sensor image readout.

For a capture request, this callback is invoked right after OnCaptureStarted(CameraCaptureSession, CaptureRequest, Int64, Int64). Unlike OnCaptureStarted(CameraCaptureSession, CaptureRequest, Int64, Int64), instead of passing a timestamp of start of exposure, this callback passes a timestamp of start of camera data readout. This is useful because for a camera running at fixed frame rate, the start of readout is at fixed interval, which is not necessarily true for the start of exposure, particularly when autoexposure is changing exposure duration between frames.

The timestamps match the timestamps of the output surfaces with readout timestamp enabled (via OutputConfiguration#setReadoutTimestampEnabled) if:

<ul> <li> Timestamp base is Default and the output <ul> <li> is not a SurfaceView surface, and </li> <li> is not a MediaRecoder, MediaCodec, or ImageReader surface with UsageVideoEncode usage flag or the device's SensorInfoTimestampSource is UNKNOWN</li> </ul> </li> <li> Timestamp base is Sensor,</li> <li> Timestamp base is Monotonic and the device's SensorInfoTimestampSource is UNKNOWN,</li> <li> Timestamp base is Realtime and the device's SensorInfoTimestampSource is REALTIME</li> </ul>

Otherwise, the timestamps won't match the timestamp of the output surfaces. See the possible parameters for TimestampBase for details.

This callback will be called only if SensorReadoutTimestamp is Hardware, and it's called right after OnCaptureStarted(CameraCaptureSession, CaptureRequest, Int64, Int64).

Java documentation for android.hardware.camera2.CameraCaptureSession.CaptureCallback.onReadoutStarted(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, long, long).

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