mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
identity: Add a drop-allocation property
When enabled, this property will make the allocation query fail. This is the same as one could have done using a tee before the tee started implementing the allocation query. https://bugzilla.gnome.org/show_bug.cgi?id=730758
This commit is contained in:
parent
1cd0dd3503
commit
2cc5c539a3
2 changed files with 21 additions and 1 deletions
|
@ -74,6 +74,7 @@ enum
|
||||||
#define DEFAULT_CHECK_IMPERFECT_OFFSET FALSE
|
#define DEFAULT_CHECK_IMPERFECT_OFFSET FALSE
|
||||||
#define DEFAULT_SIGNAL_HANDOFFS TRUE
|
#define DEFAULT_SIGNAL_HANDOFFS TRUE
|
||||||
#define DEFAULT_TS_OFFSET 0
|
#define DEFAULT_TS_OFFSET 0
|
||||||
|
#define DEFAULT_DROP_ALLOCATION FALSE
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -91,7 +92,8 @@ enum
|
||||||
PROP_TS_OFFSET,
|
PROP_TS_OFFSET,
|
||||||
PROP_CHECK_IMPERFECT_TIMESTAMP,
|
PROP_CHECK_IMPERFECT_TIMESTAMP,
|
||||||
PROP_CHECK_IMPERFECT_OFFSET,
|
PROP_CHECK_IMPERFECT_OFFSET,
|
||||||
PROP_SIGNAL_HANDOFFS
|
PROP_SIGNAL_HANDOFFS,
|
||||||
|
PROP_DROP_ALLOCATION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -230,6 +232,11 @@ gst_identity_class_init (GstIdentityClass * klass)
|
||||||
"Signal handoffs", "Send a signal before pushing the buffer",
|
"Signal handoffs", "Send a signal before pushing the buffer",
|
||||||
DEFAULT_SIGNAL_HANDOFFS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
DEFAULT_SIGNAL_HANDOFFS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
g_object_class_install_property (gobject_class, PROP_DROP_ALLOCATION,
|
||||||
|
g_param_spec_boolean ("drop-allocation", "Drop allocation query",
|
||||||
|
"Don't forward allocation queries", DEFAULT_DROP_ALLOCATION,
|
||||||
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstIdentity::handoff:
|
* GstIdentity::handoff:
|
||||||
* @identity: the identity instance
|
* @identity: the identity instance
|
||||||
|
@ -759,6 +766,9 @@ gst_identity_set_property (GObject * object, guint prop_id,
|
||||||
case PROP_SIGNAL_HANDOFFS:
|
case PROP_SIGNAL_HANDOFFS:
|
||||||
identity->signal_handoffs = g_value_get_boolean (value);
|
identity->signal_handoffs = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_DROP_ALLOCATION:
|
||||||
|
identity->drop_allocation = g_value_get_boolean (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;
|
||||||
|
@ -822,6 +832,9 @@ gst_identity_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_SIGNAL_HANDOFFS:
|
case PROP_SIGNAL_HANDOFFS:
|
||||||
g_value_set_boolean (value, identity->signal_handoffs);
|
g_value_set_boolean (value, identity->signal_handoffs);
|
||||||
break;
|
break;
|
||||||
|
case PROP_DROP_ALLOCATION:
|
||||||
|
g_value_set_boolean (value, identity->drop_allocation);
|
||||||
|
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;
|
||||||
|
@ -887,6 +900,12 @@ gst_identity_query (GstBaseTransform * base, GstPadDirection direction,
|
||||||
|
|
||||||
identity = GST_IDENTITY (base);
|
identity = GST_IDENTITY (base);
|
||||||
|
|
||||||
|
if (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION &&
|
||||||
|
identity->drop_allocation) {
|
||||||
|
GST_DEBUG_OBJECT (identity, "Dropping allocation query.");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->query (base, direction, query);
|
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->query (base, direction, query);
|
||||||
|
|
||||||
if (GST_QUERY_TYPE (query) == GST_QUERY_LATENCY) {
|
if (GST_QUERY_TYPE (query) == GST_QUERY_LATENCY) {
|
||||||
|
|
|
@ -78,6 +78,7 @@ struct _GstIdentity {
|
||||||
GCond blocked_cond;
|
GCond blocked_cond;
|
||||||
gboolean blocked;
|
gboolean blocked;
|
||||||
GstClockTimeDiff ts_offset;
|
GstClockTimeDiff ts_offset;
|
||||||
|
gboolean drop_allocation;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstIdentityClass {
|
struct _GstIdentityClass {
|
||||||
|
|
Loading…
Reference in a new issue