Class ImageReaderNatives

java.lang.Object
org.robolectric.nativeruntime.ImageReaderNatives

public final class ImageReaderNatives extends Object
Native methods for ImageReader JNI registration.

Native method signatures are derived from

 API 33 (T, Android 13)
 https://cs.android.com/android/platform/superproject/+/android-13.0.0_r1:frameworks/base/media/java/android/media/ImageReader.java

 API 31/32 (S, S_V2, Android 12)
 https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/media/java/android/media/ImageReader.java
 https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/media/jni/android_media_ImageReader.cpp

 API 30 (R, Android 11)
 https://cs.android.com/android/platform/superproject/+/android-11.0.0_r1:frameworks/base/media/java/android/media/ImageReader.java

 API 29 (Q, Android 10)
 https://cs.android.com/android/platform/superproject/+/android-10.0.0_r1:frameworks/base/media/java/android/media/ImageReader.java
 
  • Field Details

    • mNativeContext

      public long mNativeContext
    • ACQUIRE_SUCCESS

      public static final int ACQUIRE_SUCCESS
      Returned by nativeImageSetup when acquiring the image was successful.
      See Also:
    • ACQUIRE_NO_BUFS

      public static final int ACQUIRE_NO_BUFS
      Returned by nativeImageSetup when we couldn't acquire the buffer, because there were no buffers available to acquire.
      See Also:
    • ACQUIRE_MAX_IMAGES

      public static final int ACQUIRE_MAX_IMAGES
      Returned by nativeImageSetup when we couldn't acquire the buffer because the consumer has already acquired maxImages and cannot acquire more than that.
      See Also:
  • Constructor Details

    • ImageReaderNatives

      public ImageReaderNatives()
  • Method Details

    • postEventFromNative

      public static void postEventFromNative(Object o)
    • nativeInit

      public void nativeInit(Object weakSelf, int w, int h, int fmt, int maxImgs, long consumerUsage)
    • nativeClose

      public void nativeClose()
    • nativeReleaseImage

      public void nativeReleaseImage(Image i)
    • nativeGetSurface

      public Surface nativeGetSurface()
    • nativeDetachImage

      public int nativeDetachImage(Image i)
    • nativeDiscardFreeBuffers

      public void nativeDiscardFreeBuffers()
    • nativeImageSetup

      public int nativeImageSetup(Image i)
      Returns:
      A return code ACQUIRE_*
      See Also:
    • nativeClassInit

      public static void nativeClassInit()
      We use a class initializer to allow the native code to cache some field offsets.