Dil

TimestampBase Enum

Definition

public enum TimestampBase
type TimestampBase = 
Inheritance
TimestampBase

Fields

Name Value Description
Default 0

Default timestamp base.

The camera device decides the timestamp based on the properties of the output surface.

Note that the reduction of frame jitter for SurfaceView and SurfaceTexture comes with slight increase in photon-to-photon latency, which is the time from when photons hit the scene to when the corresponding pixels show up on the screen. If the photon-to-photon latency is more important than the smoothness of viewfinder, TIMESTAMP_BASE_SENSOR should be used instead.

Android reference for android.hardware.camera2.params.OutputConfiguration.TIMESTAMP_BASE_DEFAULT.

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.

Sensor 1

Timestamp base of CameraCharacteristics.SENSOR_INFO_TIMESTAMP_SOURCE.

The timestamps of the output images are in the time base as specified by CameraCharacteristics.SENSOR_INFO_TIMESTAMP_SOURCE. The application can look up the corresponding result metadata by matching the timestamp with a CameraCaptureSession.CaptureCallback.onCaptureStarted, or with a CameraCaptureSession.CaptureCallback.onReadoutStarted if readout timestamp is used.

Android reference for android.hardware.camera2.params.OutputConfiguration.TIMESTAMP_BASE_SENSOR.

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.

Monotonic 2

Timestamp base roughly the same as SystemClock.uptimeMillis().

The timestamps of the output images are monotonically increasing, and are roughly in the same time base as SystemClock.uptimeMillis(). The timestamps with this time base can be directly used for audio-video sync in video recording.

If the camera device's CameraCharacteristics.SENSOR_INFO_TIMESTAMP_SOURCE is REALTIME, timestamps with this time base cannot directly match the timestamps in CameraCaptureSession.CaptureCallback.onCaptureStarted, CameraCaptureSession.CaptureCallback.onReadoutStarted, or the sensor timestamps in CaptureResult.

Android reference for android.hardware.camera2.params.OutputConfiguration.TIMESTAMP_BASE_MONOTONIC.

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.

Realtime 3

Timestamp base roughly the same as SystemClock.elapsedRealtime().

The timestamps of the output images are roughly in the same time base as SystemClock.elapsedRealtime(). The timestamps with this time base cannot be directly used for audio-video sync in video recording.

If the camera device's CameraCharacteristics.SENSOR_INFO_TIMESTAMP_SOURCE is UNKNOWN, timestamps with this time base cannot directly match the timestamps in CameraCaptureSession.CaptureCallback.onCaptureStarted, CameraCaptureSession.CaptureCallback.onReadoutStarted, or the sensor timestamps in CaptureResult.

If using a REALTIME timestamp base on a device that supports only TIMESTAMP_SOURCE_UNKNOWN, the accuracy of timestamps is only what is guaranteed in the documentation for UNKNOWN. In particular, they have no guarantees about being accurate enough to use in fusing image data with the output of inertial sensors, for features such as image stabilization or augmented reality.

Android reference for android.hardware.camera2.params.OutputConfiguration.TIMESTAMP_BASE_REALTIME.

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.

ChoreographerSynced 4

Timestamp is synchronized to choreographer.

The timestamp of the output images are overridden with choreographer pulses from the display subsystem for smoother display of camera frames. An output target of SurfaceView uses this time base by default. Note that the timestamp override is done for fixed camera frame rate only.

This timestamp base isn't applicable to SurfaceTexture targets. SurfaceTexture's updateTexImage function always uses the latest image from the camera stream. In the case of a TextureView, the image is displayed right away.

Timestamps with this time base cannot directly match the timestamps in CameraCaptureSession.CaptureCallback.onCaptureStarted, CameraCaptureSession.CaptureCallback.onReadoutStarted, or the sensor timestamps in CaptureResult. This timestamp base shouldn't be used if the timestamp needs to be used for audio-video synchronization.

Android reference for android.hardware.camera2.params.OutputConfiguration.TIMESTAMP_BASE_CHOREOGRAPHER_SYNCED.

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