55
If an application has never called
android.hardware.Camera.Parameters.setPreviewFormat(int), then the device MUST use
android.hardware.PixelFormat.YCbCr_420_SP for preview data provided to application
callbacks.
If an application registers an android.hardware.Camera.PreviewCallback instance and the
system calls the onPreviewFrame() method when the preview format is YCbCr_420_SP,
the data in the byte[] passed into onPreviewFrame() must further be in the NV21 encoding
format. That is, NV21 MUST be the default.
For android.hardware.Camera, device implementations MUST support the YV12 format
(as denoted by the android.graphics.ImageFormat.YV12 constant) for camera previews for
both front- and rear-facing cameras. (The hardware video encoder and camera may use
any native pixel format, but the device implementation MUST support conversion to YV12.)
For android.hardware.camera2, device implementations must support the
android.hardware.ImageFormat.YUV_420_888 and android.hardware.ImageFormat.JPEG
formats as outputs through the android.media.ImageReader API.
Device implementations MUST still implement the full Camera API included in the Android SDK
documentation [Resources, 111
], regardless of whether the device includes hardware autofocus or
other capabilities. For instance, cameras that lack autofocus MUST still call any registered
android.hardware.Camera.AutoFocusCallback instances (even though this has no relevance to a non-
autofocus camera.) Note that this does apply to front-facing cameras; for instance, even though most
front-facing cameras do not support autofocus, the API callbacks must still be “faked” as described.
Device implementations MUST recognize and honor each parameter name defined as a constant on
the android.hardware.Camera.Parameters class, if the underlying hardware supports the feature. If the
device hardware does not support a feature, the API must behave as documented. Conversely,
device implementations MUST NOT honor or recognize string constants passed to the
android.hardware.Camera.setParameters() method other than those documented as constants on the
android.hardware.Camera.Parameters. That is, device implementations MUST support all standard
Camera parameters if the hardware allows, and MUST NOT support custom Camera parameter types.
For instance, device implementations that support image capture using high dynamic range (HDR)
imaging techniques MUST support camera parameter Camera.SCENE_MODE_HDR [Resources,
112
].
Because not all device implementations can fully support all the features of the
android.hardware.camera2 API, device implementations MUST report the proper level of support with
the android.info.supportedHardwareLevel property as described in the Android SDK [Resources, 113
]
and report the appropriate framework feature flags [Resources, 114
].
Device implementations MUST also declare its Individual camera capabilities of
android.hardware.camera2 via the android.request.availableCapabilities property and declare the
appropriate feature flags [Resources, 114
]; a device must define the feature flag if any of its attached
camera devices supports the feature.
Device implementations MUST broadcast the Camera.ACTION_NEW_PICTURE intent whenever a
new picture is taken by the camera and the entry of the picture has been added to the media store.
Device implementations MUST broadcast the Camera.ACTION_NEW_VIDEO intent whenever a new
video is recorded by the camera and the entry of the picture has been added to the media store.
7.5.5. Camera Orientation
Both front- and rear-facing cameras, if present, MUST be oriented so that the long dimension of the
camera aligns with the screen’s long dimension. That is, when the device is held in the landscape
orientation, cameras MUST capture images in the landscape orientation. This applies regardless of
the device’s natural orientation; that is, it applies to landscape-primary devices as well as portrait-
primary devices.
Page 55 of 74