Android.Graphics.ImageFormat.Yv12 Field

Value: 842094169

Syntax

[Android.Runtime.Register("YV12")]
[System.Obsolete("This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.")]
public const ImageFormatType Yv12

See Also

Android.Hardware.Camera.SetPreviewCallback(.IPreviewCallback)

Remarks

Android YUV format.

This format is exposed to software decoders and applications.

YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed by (W/2) x (H/2) Cr and Cb planes.

This format assumes

  • an even width
  • an even height
  • a horizontal stride multiple of 16 pixels
  • a vertical stride equal to the height

java Example

 y_size = stride * height
 c_stride = ALIGN(stride/2, 16)
 c_size = c_stride * height/2
 size = y_size + c_size * 2
 cr_offset = y_size
 cb_offset = y_size + c_size

For the Android.Hardware.Camera2 API, the ImageFormat.Yuv420888 format is recommended for YUV output instead.

For the older camera API, this format is guaranteed to be supported for Android.Hardware.Camera preview images since API level 12; for earlier API versions, check NoType:android/hardware/Camera$Parameters;Href=../../../reference/android/hardware/Camera.Parameters.html#getSupportedPreviewFormats().

Note that for camera preview callback use (see Android.Hardware.Camera.SetPreviewCallback(.IPreviewCallback)), the stride value is the smallest possible; that is, it is equal to:

java Example

stride = ALIGN(width, 16)

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 9