diff options
author | Aman Gupta <aman@tmm1.net> | 2019-09-05 22:49:00 +0300 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2019-09-10 23:51:05 +0300 |
commit | 7fddf4b2662b25f048f4dbed74cf28cd375694fc (patch) | |
tree | 79e4857365664f678eb87bc76db62072b8f6756c /libavcodec/mediacodec_surface.c | |
parent | 8a3623e2fbde8cb2da3235bf9e230f3512a31c34 (diff) |
avcodec/mediacodec_surface: define and use FFANativeWindow to mimic NDK interface
This will make it easy to switch to ANativeWindow_fromSurface
and ANativeWindow_release in the future.
Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/mediacodec_surface.c')
-rw-r--r-- | libavcodec/mediacodec_surface.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mediacodec_surface.c b/libavcodec/mediacodec_surface.c index 26724d3574..09a42295d2 100644 --- a/libavcodec/mediacodec_surface.c +++ b/libavcodec/mediacodec_surface.c @@ -25,7 +25,7 @@ #include "ffjni.h" #include "mediacodec_surface.h" -void *ff_mediacodec_surface_ref(void *surface, void *log_ctx) +FFANativeWindow *ff_mediacodec_surface_ref(void *surface, void *log_ctx) { JNIEnv *env = NULL; @@ -37,7 +37,7 @@ void *ff_mediacodec_surface_ref(void *surface, void *log_ctx) return (*env)->NewGlobalRef(env, surface); } -int ff_mediacodec_surface_unref(void *surface, void *log_ctx) +int ff_mediacodec_surface_unref(FFANativeWindow *window, void *log_ctx) { JNIEnv *env = NULL; @@ -46,7 +46,7 @@ int ff_mediacodec_surface_unref(void *surface, void *log_ctx) return AVERROR_EXTERNAL; } - (*env)->DeleteGlobalRef(env, surface); + (*env)->DeleteGlobalRef(env, window); return 0; } |