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

Commit ee6cff0d authored by Jiwen 'Steve' Cai's avatar Jiwen 'Steve' Cai
Browse files

ANativeWindow_toSurface header

This enables the conversion from an ANativeWindow (created by NDK API
such as: AImageReader_create) to a Java Surface, so that developers can
hookup a Java Producer to a native buffer consumer.

Bug: 36862948
Test: android.media.cts.NativeImageReaderTest
Change-Id: I11962bc791680a62579e51c32f2d51911cac48f8
parent 0860434b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -54,6 +54,17 @@ ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);
ANativeWindow* ANativeWindow_fromSurfaceTexture(JNIEnv* env, jobject surfaceTexture);
#endif

#if __ANDROID_API__ >= 26
/**
 * Return a Java Surface object derived from the ANativeWindow, for interacting
 * with it through Java code. The returned Java object acquires a reference on
 * the ANativeWindow; maintains it through general Java object's life cycle;
 * and will automatically release the reference when the Java object gets garbage
 * collected.
 */
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
#endif

#ifdef __cplusplus
};
#endif