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

Commit 1cb37aae authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "ImageReader/ImageWriter: unhide newInstance methods"

parents bde9403f d07e9ec5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -24027,6 +24027,7 @@ package android.media {
    method public android.view.Surface getSurface();
    method public int getWidth();
    method public static android.media.ImageReader newInstance(int, int, int, int);
    method public static android.media.ImageReader newInstance(int, int, int, int, long);
    method public void setOnImageAvailableListener(android.media.ImageReader.OnImageAvailableListener, android.os.Handler);
  }
@@ -24040,6 +24041,7 @@ package android.media {
    method public int getFormat();
    method public int getMaxImages();
    method public static android.media.ImageWriter newInstance(android.view.Surface, int);
    method public static android.media.ImageWriter newInstance(android.view.Surface, int, int);
    method public void queueInputImage(android.media.Image);
    method public void setOnImageReleasedListener(android.media.ImageWriter.OnImageReleasedListener, android.os.Handler);
  }
+7 −8
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ public class ImageReader implements AutoCloseable {
     * consumer end-points. For example, if the application intends to send the images to
     * {@link android.media.MediaCodec} or {@link android.media.MediaRecorder} for hardware video
     * encoding, the format and usage flag combination needs to be
     * {@link ImageFormat#PRIVATE PRIVATE} and {@link HardwareBuffer#USAGE0_VIDEO_ENCODE}. When an
     * {@link ImageFormat#PRIVATE PRIVATE} and {@link HardwareBuffer#USAGE_VIDEO_ENCODE}. When an
     * {@link ImageReader} object is created with a valid size and such format/usage flag
     * combination, the application can send the {@link Image images} to an {@link ImageWriter} that
     * is created with the input {@link android.view.Surface} provided by the
@@ -173,7 +173,7 @@ public class ImageReader implements AutoCloseable {
     * ImageReaders using other format such as {@link ImageFormat#YUV_420_888 YUV_420_888}.
     * </p>
     * <p>
     * Note that not all format and usage flag combination is supported by the
     * Note that not all format and usage flag combinations are supported by the
     * {@link ImageReader}. Below are the supported combinations by the {@link ImageReader}
     * (assuming the consumer end-points support the such image consumption, e.g., hardware video
     * encoding).
@@ -186,13 +186,13 @@ public class ImageReader implements AutoCloseable {
     *   <td>non-{@link android.graphics.ImageFormat#PRIVATE PRIVATE} formats defined by
     *   {@link android.graphics.ImageFormat ImageFormat} or
     *   {@link android.graphics.PixelFormat PixelFormat}</td>
     *   <td>{@link HardwareBuffer#USAGE0_CPU_READ} or
     *   {@link HardwareBuffer#USAGE0_CPU_READ_OFTEN}</td>
     *   <td>{@link HardwareBuffer#USAGE_CPU_READ_RARELY} or
     *   {@link HardwareBuffer#USAGE_CPU_READ_OFTEN}</td>
     * </tr>
     * <tr>
     *   <td>{@link android.graphics.ImageFormat#PRIVATE}</td>
     *   <td>{@link HardwareBuffer#USAGE0_VIDEO_ENCODE} or
     *   {@link HardwareBuffer#USAGE0_GPU_SAMPLED_IMAGE}, or combined</td>
     *   <td>{@link HardwareBuffer#USAGE_VIDEO_ENCODE} or
     *   {@link HardwareBuffer#USAGE_GPU_SAMPLED_IMAGE}, or combined</td>
     * </tr>
     * </table>
     * Using other combinations may result in {@link IllegalArgumentException}.
@@ -208,11 +208,10 @@ public class ImageReader implements AutoCloseable {
     *            become available for access through {@link #acquireLatestImage()} or
     *            {@link #acquireNextImage()}. Must be greater than 0.
     * @param usage The intended usage of the images produced by this ImageReader. It needs
     *            to be one of the Usage0 defined by {@link HardwareBuffer}, or an
     *            to be one of the Usage defined by {@link HardwareBuffer}, or an
     *            {@link IllegalArgumentException} will be thrown.
     * @see Image
     * @see HardwareBuffer
     * @hide
     */
    public static ImageReader newInstance(int width, int height, int format, int maxImages,
            long usage) {
+0 −1
Original line number Diff line number Diff line
@@ -168,7 +168,6 @@ public class ImageWriter implements AutoCloseable {
     *            {@link ImageFormat} or {@link PixelFormat}.
     *
     * @return a new ImageWriter instance.
     * @hide
     */
    public static ImageWriter newInstance(Surface surface, int maxImages, int format) {
        if (!ImageFormat.isPublicFormat(format) && !PixelFormat.isPublicFormat(format)) {