diff options
Diffstat (limited to 'android/media/Image.java')
-rw-r--r-- | android/media/Image.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/android/media/Image.java b/android/media/Image.java index fbe55614..37c57854 100644 --- a/android/media/Image.java +++ b/android/media/Image.java @@ -19,7 +19,9 @@ package android.media; import java.nio.ByteBuffer; import java.lang.AutoCloseable; +import android.annotation.Nullable; import android.graphics.Rect; +import android.hardware.HardwareBuffer; /** * <p>A single complete image buffer to use with a media source such as a @@ -184,6 +186,30 @@ public abstract class Image implements AutoCloseable { public abstract long getTimestamp(); /** + * Get the transformation associated with this frame. + * @return The window transformation that needs to be applied for this frame. + * @hide + */ + public abstract int getTransform(); + + /** + * Get the {@link android.hardware.HardwareBuffer HardwareBuffer} handle of the input image + * intended for GPU and/or hardware access. + * <p> + * The returned {@link android.hardware.HardwareBuffer HardwareBuffer} shall not be used + * after {@link Image#close Image.close()} has been called. + * </p> + * @return the HardwareBuffer associated with this Image or null if this Image doesn't support + * this feature (e.g. {@link android.media.ImageWriter ImageWriter} or + * {@link android.media.MediaCodec MediaCodec} don't). + */ + @Nullable + public HardwareBuffer getHardwareBuffer() { + throwISEIfImageIsInvalid(); + return null; + } + + /** * Set the timestamp associated with this frame. * <p> * The timestamp is measured in nanoseconds, and is normally monotonically |