mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:46:13 +00:00
audiodecoder: Add max-errors property
The number of consecutive decode errors that should be tolerated before returning flow error should be up to the application, not the element. Hence max-error should be exposed as a property. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/720>
This commit is contained in:
parent
226a371e3f
commit
63933da9e8
2 changed files with 65 additions and 1 deletions
|
@ -10972,6 +10972,20 @@
|
||||||
"type": "gboolean",
|
"type": "gboolean",
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
"max-errors": {
|
||||||
|
"blurb": "Max consecutive decoder errors before returning flow error",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "10",
|
||||||
|
"max": "2147483647",
|
||||||
|
"min": "-1",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gint",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
"min-latency": {
|
"min-latency": {
|
||||||
"blurb": "Aggregate output data to a minimum of latency time (ns)",
|
"blurb": "Aggregate output data to a minimum of latency time (ns)",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
@ -19525,6 +19539,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"max-errors": {
|
||||||
|
"blurb": "Max consecutive decoder errors before returning flow error",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "10",
|
||||||
|
"max": "2147483647",
|
||||||
|
"min": "-1",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gint",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
"qos": {
|
"qos": {
|
||||||
"blurb": "Handle Quality-of-Service events from downstream",
|
"blurb": "Handle Quality-of-Service events from downstream",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
@ -21154,6 +21182,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"max-errors": {
|
||||||
|
"blurb": "Max consecutive decoder errors before returning flow error",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "10",
|
||||||
|
"max": "2147483647",
|
||||||
|
"min": "-1",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gint",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
"min-latency": {
|
"min-latency": {
|
||||||
"blurb": "Aggregate output data to a minimum of latency time (ns)",
|
"blurb": "Aggregate output data to a minimum of latency time (ns)",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
|
|
@ -142,7 +142,8 @@ enum
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_LATENCY,
|
PROP_LATENCY,
|
||||||
PROP_TOLERANCE,
|
PROP_TOLERANCE,
|
||||||
PROP_PLC
|
PROP_PLC,
|
||||||
|
PROP_MAX_ERRORS
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEFAULT_LATENCY 0
|
#define DEFAULT_LATENCY 0
|
||||||
|
@ -150,6 +151,7 @@ enum
|
||||||
#define DEFAULT_PLC FALSE
|
#define DEFAULT_PLC FALSE
|
||||||
#define DEFAULT_DRAINABLE TRUE
|
#define DEFAULT_DRAINABLE TRUE
|
||||||
#define DEFAULT_NEEDS_FORMAT FALSE
|
#define DEFAULT_NEEDS_FORMAT FALSE
|
||||||
|
#define DEFAULT_MAX_ERRORS GST_AUDIO_DECODER_MAX_ERRORS
|
||||||
|
|
||||||
typedef struct _GstAudioDecoderContext
|
typedef struct _GstAudioDecoderContext
|
||||||
{
|
{
|
||||||
|
@ -408,6 +410,20 @@ gst_audio_decoder_class_init (GstAudioDecoderClass * klass)
|
||||||
"Perform packet loss concealment (if supported)",
|
"Perform packet loss concealment (if supported)",
|
||||||
DEFAULT_PLC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
DEFAULT_PLC, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstAudioDecoder:max-errors:
|
||||||
|
*
|
||||||
|
* Maximum number of tolerated consecutive decode errors. See
|
||||||
|
* gst_audio_decoder_set_max_errors() for more details.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class, PROP_MAX_ERRORS,
|
||||||
|
g_param_spec_int ("max-errors", "Max errors",
|
||||||
|
"Max consecutive decoder errors before returning flow error",
|
||||||
|
-1, G_MAXINT, DEFAULT_MAX_ERRORS,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
audiodecoder_class->sink_event =
|
audiodecoder_class->sink_event =
|
||||||
GST_DEBUG_FUNCPTR (gst_audio_decoder_sink_eventfunc);
|
GST_DEBUG_FUNCPTR (gst_audio_decoder_sink_eventfunc);
|
||||||
audiodecoder_class->src_event =
|
audiodecoder_class->src_event =
|
||||||
|
@ -3104,6 +3120,9 @@ gst_audio_decoder_get_property (GObject * object, guint prop_id,
|
||||||
case PROP_PLC:
|
case PROP_PLC:
|
||||||
g_value_set_boolean (value, dec->priv->plc);
|
g_value_set_boolean (value, dec->priv->plc);
|
||||||
break;
|
break;
|
||||||
|
case PROP_MAX_ERRORS:
|
||||||
|
g_value_set_int (value, gst_audio_decoder_get_max_errors (dec));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -3128,6 +3147,9 @@ gst_audio_decoder_set_property (GObject * object, guint prop_id,
|
||||||
case PROP_PLC:
|
case PROP_PLC:
|
||||||
dec->priv->plc = g_value_get_boolean (value);
|
dec->priv->plc = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_MAX_ERRORS:
|
||||||
|
gst_audio_decoder_set_max_errors (dec, g_value_get_int (value));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue