Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2db296b2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Add details about default output YUV encoding" into udc-dev am: 766c6bfd

parents 3b651858 766c6bfd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -283,7 +283,8 @@ public abstract class CameraDevice implements AutoCloseable {
     * @see StreamConfigurationMap#getInputFormats
     * @see StreamConfigurationMap#getInputSizes
     * @see StreamConfigurationMap#getValidOutputFormatsForInput
     * @see StreamConfigurationMap#getOutputSizes
     * @see StreamConfigurationMap#getOutputSizes(int)
     * @see StreamConfigurationMap#getOutputSizes(Class)
     * @see android.media.ImageWriter
     * @see android.media.ImageReader
     * @deprecated Please use {@link
+11 −8
Original line number Diff line number Diff line
@@ -129,14 +129,17 @@ public final class CameraManager {
    /**
     * Enable physical camera availability callbacks when the logical camera is unavailable
     *
     * <p>Previously once a logical camera becomes unavailable, no {@link
     * #onPhysicalCameraAvailable} or {@link #onPhysicalCameraUnavailable} will be called until
     * the logical camera becomes available again. The results in the app opening the logical
     * camera not able to receive physical camera availability change.</p>
     *
     * <p>With this change, the {@link #onPhysicalCameraAvailable} and {@link
     * #onPhysicalCameraUnavailable} can still be called while the logical camera is unavailable.
     * </p>
     * <p>Previously once a logical camera becomes unavailable, no
     * {@link AvailabilityCallback#onPhysicalCameraAvailable} or
     * {@link AvailabilityCallback#onPhysicalCameraUnavailable} will
     * be called until the logical camera becomes available again. The
     * results in the app opening the logical camera not able to
     * receive physical camera availability change.</p>
     *
     * <p>With this change, the {@link
     * AvailabilityCallback#onPhysicalCameraAvailable} and {@link
     * AvailabilityCallback#onPhysicalCameraUnavailable} can still be
     * called while the logical camera is unavailable.  </p>
     */
    @ChangeId
    @EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
+22 −6
Original line number Diff line number Diff line
@@ -62,12 +62,28 @@ RAW buffers for {@link android.hardware.camera2.DngCreator} can be
done with {@link android.media.ImageReader} with the {@link
android.graphics.ImageFormat#JPEG} and {@link
android.graphics.ImageFormat#RAW_SENSOR} formats.  Application-driven
processing of camera data in RenderScript, OpenGL ES, or directly in
managed or native code is best done through {@link
android.renderscript.Allocation} with a YUV {@link
android.renderscript.Type}, {@link android.graphics.SurfaceTexture},
and {@link android.media.ImageReader} with a {@link
android.graphics.ImageFormat#YUV_420_888} format, respectively.</p>
processing of camera data in OpenGL ES, or directly in managed or
native code is best done through {@link
android.graphics.SurfaceTexture}, or {@link android.media.ImageReader}
with a {@link android.graphics.ImageFormat#YUV_420_888} format,
respectively. </p>

<p>By default, YUV-format buffers provided by the camera are using the
JFIF YUV<->RGB transform matrix (equivalent to Rec.601 full-range
encoding), and after conversion to RGB with this matrix, the resulting
RGB data is in the sRGB colorspace.  Captured JPEG images may contain
an ICC profile to specify their color space information; if not, they
should be assumed to be in the sRGB space as well. On some devices,
the output colorspace can be changed via {@link
android.hardware.camera2.params.SessionConfiguration#setColorSpace}.
</p>
<p>
Note that although the YUV->RGB transform is the JFIF matrix (Rec.601
full-range), due to legacy and compatibility reasons, the output is in
the sRGB colorspace, which uses the Rec.709 color primaries. Image
processing code can safely treat the output RGB as being in the sRGB
colorspace.
</p>

<p>The application then needs to construct a {@link
android.hardware.camera2.CaptureRequest}, which defines all the
+2 −2
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ public final class ColorSpaceProfiles {
     * @see OutputConfiguration#setDynamicRangeProfile
     * @see SessionConfiguration#setColorSpace
     * @see ColorSpace.Named
     * @see DynamicRangeProfiles.Profile
     * @see DynamicRangeProfiles
     */
    public @NonNull Set<Long> getSupportedDynamicRangeProfiles(@NonNull ColorSpace.Named colorSpace,
            @ImageFormat.Format int imageFormat) {
@@ -230,7 +230,7 @@ public final class ColorSpaceProfiles {
     * @see SessionConfiguration#setColorSpace
     * @see OutputConfiguration#setDynamicRangeProfile
     * @see ColorSpace.Named
     * @see DynamicRangeProfiles.Profile
     * @see DynamicRangeProfiles
     */
    public @NonNull Set<ColorSpace.Named> getSupportedColorSpacesForDynamicRange(
            @ImageFormat.Format int imageFormat,
+8 −6
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ import java.util.Set;
 * Immutable class to store the recommended stream configurations to set up
 * {@link android.view.Surface Surfaces} for creating a
 * {@link android.hardware.camera2.CameraCaptureSession capture session} with
 * {@link android.hardware.camera2.CameraDevice#createCaptureSession}.
 * {@link android.hardware.camera2.CameraDevice#createCaptureSession(SessionConfiguration)}.
 *
 * <p>The recommended list does not replace or deprecate the exhaustive complete list found in
 * {@link StreamConfigurationMap}. It is a suggestion about available power and performance
@@ -70,7 +70,7 @@ import java.util.Set;
 * }</code></pre>
 *
 * @see CameraCharacteristics#getRecommendedStreamConfigurationMap
 * @see CameraDevice#createCaptureSession
 * @see CameraDevice#createCaptureSession(SessionConfiguration)
 */
public final class RecommendedStreamConfigurationMap {

@@ -282,7 +282,7 @@ public final class RecommendedStreamConfigurationMap {

    /**
     * Determine whether or not output surfaces with a particular user-defined format can be passed
     * {@link CameraDevice#createCaptureSession createCaptureSession}.
     * {@link CameraDevice#createCaptureSession(SessionConfiguration) createCaptureSession}.
     *
     * <p>
     * For further information refer to {@link StreamConfigurationMap#isOutputSupportedFor}.
@@ -292,7 +292,7 @@ public final class RecommendedStreamConfigurationMap {
     * @param format an image format from either {@link ImageFormat} or {@link PixelFormat}
     * @return
     *          {@code true} if using a {@code surface} with this {@code format} will be
     *          supported with {@link CameraDevice#createCaptureSession}
     *          supported with {@link CameraDevice#createCaptureSession(SessionConfiguration)}
     *
     * @throws IllegalArgumentException
     *          if the image format was not a defined named constant
@@ -508,8 +508,10 @@ public final class RecommendedStreamConfigurationMap {
    }

    /**
     * Determine whether or not the {@code surface} in its current state is suitable to be included
     * in a {@link CameraDevice#createCaptureSession capture session} as an output.
     * Determine whether or not the {@code surface} in its current
     * state is suitable to be included in a {@link
     * CameraDevice#createCaptureSession(SessionConfiguration) capture
     * session} as an output.
     *
     * <p>For more information refer to {@link StreamConfigurationMap#isOutputSupportedFor}.
     * </p>
Loading