[vlc-devel] [PATCH 07/12] mediacodec: use decoder_SetErrorGeneric to notify an error
Thomas Guillem
thomas at gllm.fr
Thu Jun 9 11:51:59 CEST 2016
---
modules/codec/omxil/mediacodec.c | 16 ++--------------
modules/video_output/android/utils.c | 29 -----------------------------
modules/video_output/android/utils.h | 5 -----
3 files changed, 2 insertions(+), 48 deletions(-)
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index f006b9a..1fa5251 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -111,8 +111,6 @@ struct decoder_sys_t
/* If true, the first input block was successfully dequeued */
bool b_input_dequeued;
bool b_aborted;
- /* TODO: remove */
- bool b_error_signaled;
union
{
@@ -1516,9 +1514,6 @@ static int DecodeCommon(decoder_t *p_dec, block_t **pp_block)
if (!p_sys->b_aborted)
msg_Err(p_dec, "OutThread timed out");
- /* In case pf_decode is called again (it shouldn't happen) */
- p_sys->b_error_signaled = true;
-
vlc_mutex_unlock(&p_sys->lock);
return 0;
}
@@ -1531,15 +1526,8 @@ end:
}
if (p_sys->b_aborted)
{
- 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)
- AWindowHandler_sendHardwareAccelerationError(VLC_OBJECT(p_dec),
- p_sys->u.video.p_awh);
- p_sys->b_error_signaled = true;
- vlc_cond_broadcast(&p_sys->cond);
- }
+ decoder_SetErrorGeneric(p_dec);
+ vlc_cond_broadcast(&p_sys->cond);
vlc_mutex_unlock(&p_sys->lock);
return -1;
}
diff --git a/modules/video_output/android/utils.c b/modules/video_output/android/utils.c
index dec8f22..6be3cad 100644
--- a/modules/video_output/android/utils.c
+++ b/modules/video_output/android/utils.c
@@ -750,32 +750,3 @@ AWindowHandler_setWindowLayout(AWindowHandler *p_awh,
i_visible_width,i_visible_height, i_sar_num, i_sar_den);
return VLC_SUCCESS;
}
-
-int
-AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj,
- AWindowHandler *p_awh)
-{
- assert(p_obj || p_awh);
- JNIEnv *p_env;
-
- if (p_awh)
- {
- p_env = AWindowHandler_getEnv(p_awh);
- if (!p_env)
- return VLC_EGENERIC;
- JNI_CALL(CallVoidMethod, sendHardwareAccelerationError);
- }
- 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);
- AWindowHandler_destroy(p_awh);
- }
-
- return VLC_SUCCESS;
-}
diff --git a/modules/video_output/android/utils.h b/modules/video_output/android/utils.h
index d04f710..956f5e2 100644
--- a/modules/video_output/android/utils.h
+++ b/modules/video_output/android/utils.h
@@ -171,8 +171,3 @@ int AWindowHandler_setWindowLayout(AWindowHandler *p_awh,
int i_width, int i_height,
int i_visible_width, int i_visible_height,
int i_sar_num, int i_sar_den);
-
-/* Signal a critical error
- * TODO: remove this when there is a decoder fallback */
-int
-AWindowHandler_sendHardwareAccelerationError(vlc_object_t *p_obj, AWindowHandler *p_awh);
--
2.8.1
More information about the vlc-devel
mailing list