vlc | branch: master | Thomas Guillem <[email protected]> | Tue Mar 1 19:08:48 2016 +0100| [4f5af4a46acee0560ecc1946bf0649f923ba59e9] | committer: Thomas Guillem
mediacodec: fix Android error callback not sent in case of early fail This is the last android ugly hack. This will be gone with the decoder fallback. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4f5af4a46acee0560ecc1946bf0649f923ba59e9 --- modules/codec/omxil/mediacodec.c | 5 +++-- modules/video_output/android/utils.c | 21 +++++++++++++++++++-- modules/video_output/android/utils.h | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c index 1331a44..539190f 100644 --- a/modules/codec/omxil/mediacodec.c +++ b/modules/codec/omxil/mediacodec.c @@ -1473,8 +1473,9 @@ end: if (!p_sys->b_error_signaled) { /* Signal the error to the Java. * TODO: remove this when there is a decoder fallback */ - if (p_dec->fmt_in.i_cat == VIDEO_ES && p_sys->u.video.p_awh) - AWindowHandler_sendHardwareAccelerationError(p_sys->u.video.p_awh); + if (p_dec->fmt_in.i_cat == VIDEO_ES) + AWindowHandler_sendHardwareAccelerationError(VLC_OBJECT(p_dec), + p_sys->u.video.p_awh); p_sys->b_error_signaled = true; vlc_cond_broadcast(&p_sys->cond); } diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c index 24aba61..1a619ed 100644 --- a/modules/video_output/android/utils.c +++ b/modules/video_output/android/utils.c @@ -752,12 +752,29 @@ AWindowHandler_setWindowLayout(AWindowHandler *p_awh, } int -AWindowHandler_sendHardwareAccelerationError(AWindowHandler *p_awh) +AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj, + AWindowHandler *p_awh) { - JNIEnv *p_env = AWindowHandler_getEnv(p_awh); + assert(p_obj || p_awh); + JNIEnv *p_env; + + if (p_awh) + { + p_env = AWindowHandler_getEnv(p_awh); + p_awh = NULL; + } + else + { + p_awh = AWindowHandler_new(p_obj); + if (!p_awh) + return VLC_EGENERIC; + p_env = AWindowHandler_getEnv(p_awh); + } if (!p_env) return VLC_EGENERIC; JNI_CALL(CallVoidMethod, sendHardwareAccelerationError); + if (p_awh) + AWindowHandler_destroy(p_awh); return VLC_SUCCESS; } diff --git a/modules/video_output/android/utils.h b/modules/video_output/android/utils.h index 4637718..d04f710 100644 --- a/modules/video_output/android/utils.h +++ b/modules/video_output/android/utils.h @@ -175,4 +175,4 @@ int AWindowHandler_setWindowLayout(AWindowHandler *p_awh, /* Signal a critical error * TODO: remove this when there is a decoder fallback */ int -AWindowHandler_sendHardwareAccelerationError(AWindowHandler *p_awh); +AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj, AWindowHandler *p_awh); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
