errorignore: Add ignore-eos mode
It's otherwise very complicated to ignore GST_FLOW_EOS without a ghostpad's chain function to rewrite. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2492>
This commit is contained in:
parent
dee294809f
commit
43199bc883
@ -8502,6 +8502,18 @@
|
|||||||
"type": "GstFlowReturn",
|
"type": "GstFlowReturn",
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
"ignore-eos": {
|
||||||
|
"blurb": "Whether to ignore GST_FLOW_EOS",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
"ignore-error": {
|
"ignore-error": {
|
||||||
"blurb": "Whether to ignore GST_FLOW_ERROR",
|
"blurb": "Whether to ignore GST_FLOW_ERROR",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
@ -50,6 +50,7 @@ enum
|
|||||||
PROP_IGNORE_ERROR,
|
PROP_IGNORE_ERROR,
|
||||||
PROP_IGNORE_NOTLINKED,
|
PROP_IGNORE_NOTLINKED,
|
||||||
PROP_IGNORE_NOTNEGOTIATED,
|
PROP_IGNORE_NOTNEGOTIATED,
|
||||||
|
PROP_IGNORE_EOS,
|
||||||
PROP_CONVERT_TO
|
PROP_CONVERT_TO
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -122,6 +123,16 @@ gst_error_ignore_class_init (GstErrorIgnoreClass * klass)
|
|||||||
"Whether to ignore GST_FLOW_NOT_NEGOTIATED",
|
"Whether to ignore GST_FLOW_NOT_NEGOTIATED",
|
||||||
TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstErrorIgnore:ignore-eos:
|
||||||
|
*
|
||||||
|
* Since: 1.20
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (object_class, PROP_IGNORE_EOS,
|
||||||
|
g_param_spec_boolean ("ignore-eos",
|
||||||
|
"Ignore GST_FLOW_EOS", "Whether to ignore GST_FLOW_EOS",
|
||||||
|
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_CONVERT_TO,
|
g_object_class_install_property (object_class, PROP_CONVERT_TO,
|
||||||
g_param_spec_enum ("convert-to", "GstFlowReturn to convert to",
|
g_param_spec_enum ("convert-to", "GstFlowReturn to convert to",
|
||||||
"Which GstFlowReturn value we should convert to when ignoring",
|
"Which GstFlowReturn value we should convert to when ignoring",
|
||||||
@ -153,6 +164,7 @@ gst_error_ignore_init (GstErrorIgnore * self)
|
|||||||
self->ignore_error = TRUE;
|
self->ignore_error = TRUE;
|
||||||
self->ignore_notlinked = FALSE;
|
self->ignore_notlinked = FALSE;
|
||||||
self->ignore_notnegotiated = TRUE;
|
self->ignore_notnegotiated = TRUE;
|
||||||
|
self->ignore_eos = FALSE;
|
||||||
self->convert_to = GST_FLOW_NOT_LINKED;
|
self->convert_to = GST_FLOW_NOT_LINKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +184,9 @@ gst_error_ignore_set_property (GObject * object, guint prop_id,
|
|||||||
case PROP_IGNORE_NOTNEGOTIATED:
|
case PROP_IGNORE_NOTNEGOTIATED:
|
||||||
self->ignore_notnegotiated = g_value_get_boolean (value);
|
self->ignore_notnegotiated = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_IGNORE_EOS:
|
||||||
|
self->ignore_eos = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
case PROP_CONVERT_TO:
|
case PROP_CONVERT_TO:
|
||||||
self->convert_to = g_value_get_enum (value);
|
self->convert_to = g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
@ -197,6 +212,9 @@ gst_error_ignore_get_property (GObject * object, guint prop_id, GValue * value,
|
|||||||
case PROP_IGNORE_NOTNEGOTIATED:
|
case PROP_IGNORE_NOTNEGOTIATED:
|
||||||
g_value_set_boolean (value, self->ignore_notnegotiated);
|
g_value_set_boolean (value, self->ignore_notnegotiated);
|
||||||
break;
|
break;
|
||||||
|
case PROP_IGNORE_EOS:
|
||||||
|
g_value_set_boolean (value, self->ignore_eos);
|
||||||
|
break;
|
||||||
case PROP_CONVERT_TO:
|
case PROP_CONVERT_TO:
|
||||||
g_value_set_enum (value, self->convert_to);
|
g_value_set_enum (value, self->convert_to);
|
||||||
break;
|
break;
|
||||||
@ -246,6 +264,7 @@ gst_error_ignore_sink_chain (GstPad * pad, GstObject * parent,
|
|||||||
|
|
||||||
if ((ret == GST_FLOW_ERROR && self->ignore_error) ||
|
if ((ret == GST_FLOW_ERROR && self->ignore_error) ||
|
||||||
(ret == GST_FLOW_NOT_LINKED && self->ignore_notlinked) ||
|
(ret == GST_FLOW_NOT_LINKED && self->ignore_notlinked) ||
|
||||||
|
(ret == GST_FLOW_EOS && self->ignore_eos) ||
|
||||||
(ret == GST_FLOW_NOT_NEGOTIATED && self->ignore_notnegotiated))
|
(ret == GST_FLOW_NOT_NEGOTIATED && self->ignore_notnegotiated))
|
||||||
return self->convert_to;
|
return self->convert_to;
|
||||||
else
|
else
|
||||||
|
@ -44,6 +44,7 @@ struct _GstErrorIgnore {
|
|||||||
gboolean ignore_error;
|
gboolean ignore_error;
|
||||||
gboolean ignore_notlinked;
|
gboolean ignore_notlinked;
|
||||||
gboolean ignore_notnegotiated;
|
gboolean ignore_notnegotiated;
|
||||||
|
gboolean ignore_eos;
|
||||||
GstFlowReturn convert_to;
|
GstFlowReturn convert_to;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user