}
if (error_msg) {
- GST_ELEMENT_ERROR (self, STREAM, FAILED, (NULL), ("%s", error_msg));
- ret = GST_FLOW_ERROR;
+ if (gomx->post_gst_element_error == FALSE) {
+ GST_ERROR_OBJECT (self, "post GST_ELEMENT_ERROR as %s", error_msg);
+ GST_ELEMENT_ERROR (self, STREAM, FAILED, (NULL), ("%s", error_msg));
+ gomx->post_gst_element_error = TRUE;
+ ret = GST_FLOW_ERROR;
+ } else {
+ GST_ERROR_OBJECT (self, "GST_ELEMENT_ERROR is already posted. skip this (%s)", error_msg);
+ }
}
if (buf)
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
GST_INFO_OBJECT (self, "GST_STATE_CHANGE_NULL_TO_READY");
+ core->omx_unrecover_err_cnt = 0;
+ core->post_gst_element_error = FALSE;
+
if (core->omx_state != OMX_StateLoaded) {
ret = GST_STATE_CHANGE_FAILURE;
goto leave;
g_object_unref(self->adapter);
self->adapter = NULL;
}
+ core->omx_unrecover_err_cnt = 0;
+ core->post_gst_element_error = FALSE;
break;
default:
}
if (error_msg) {
- GST_ELEMENT_ERROR (self, STREAM, FAILED, (NULL), ("%s", error_msg));
- ret = GST_FLOW_ERROR;
+ if (gomx->post_gst_element_error == FALSE) {
+ GST_ERROR_OBJECT (self, "post GST_ELEMENT_ERROR as %s", error_msg);
+ GST_ELEMENT_ERROR (self, STREAM, FAILED, (NULL), ("%s", error_msg));
+ gomx->post_gst_element_error = TRUE;
+ ret = GST_FLOW_ERROR;
+ } else {
+ GST_ERROR_OBJECT (self, "GST_ELEMENT_ERROR is already posted. skip this (%s)", error_msg);
+ }
}
if (self->adapter_size > 0 && adapter_buf) {
/* MODIFICATION: set to ignore condition signal to stop. */
if (core->component_vendor == GOMX_VENDOR_SLSI &&
core->omx_error == OMX_ErrorMFCInit) {
- GST_WARNING_OBJECT (core->object, "do not send g_cond_signal when MFC init fail. (%d)", core->omx_unrecover_err_cnt);
+ GST_WARNING_OBJECT (core->object, "do not send g_cond_signal when MFC init fail. (%d)",
+ core->omx_unrecover_err_cnt);
+ if (core->omx_unrecover_err_cnt == 0) {
+ if (core->post_gst_element_error == FALSE) {
+ GST_ERROR_OBJECT (core->object, "post GST_ELEMENT_ERROR as Error from OpenMAX component");
+ GST_ELEMENT_ERROR (core->object, STREAM, FAILED, (NULL), ("%s", "Error from OpenMAX component"));
+ core->post_gst_element_error = TRUE;
+ } else {
+ GST_ERROR_OBJECT (core->object, "GST_ELEMENT_ERROR is already posted. skip this (Error from OpenMAX component)");
+ }
+ }
core->omx_unrecover_err_cnt++;
} else {
g_cond_signal (core->omx_state_condition);
}
g_mutex_unlock (core->omx_state_mutex);
-
if (core->omx_unrecover_err_cnt >= OMX_UNRECOVERABLE_ERROR_MAX_COUNT) {
- GST_WARNING_OBJECT (core->object, "got unrecoverable error 10 times. go to omx pause state");
+ GST_WARNING_OBJECT (core->object, "got unrecoverable error too much. go to omx pause state");
g_omx_core_pause(core);
+ core->omx_unrecover_err_cnt = 0;
}
break;
}
gchar *library_name;
gchar *component_name;
gchar *component_role;
+
/* MODIFICATION: omx vender */
GOmxVendor component_vendor;
+ /* MODIFICATION: handle continuous MFC init fails */
gint omx_unrecover_err_cnt;
+
+ /* MODIFICATION: to do GST_ELEMENT_ERROR only one time */
+ gboolean post_gst_element_error;
};
struct GOmxPort