summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-06 10:01:58 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-06 10:03:20 -0400
commit2cc5c539a3afb8d887990b22fc62a43111281cb5 (patch)
treef2ff31cf8d88a3a6faf99a10699873d57dfa2f51 /plugins
parent1cd0dd3503c141954ba0740cc5eca6676af9c028 (diff)
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
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstidentity.c21
-rw-r--r--plugins/elements/gstidentity.h1
2 files changed, 21 insertions, 1 deletions
diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c
index 6867c3eba..d44709ec2 100644
--- a/plugins/elements/gstidentity.c
+++ b/plugins/elements/gstidentity.c
@@ -74,6 +74,7 @@ enum
#define DEFAULT_CHECK_IMPERFECT_OFFSET FALSE
#define DEFAULT_SIGNAL_HANDOFFS TRUE
#define DEFAULT_TS_OFFSET 0
+#define DEFAULT_DROP_ALLOCATION FALSE
enum
{
@@ -91,7 +92,8 @@ enum
PROP_TS_OFFSET,
PROP_CHECK_IMPERFECT_TIMESTAMP,
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",
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:
* @identity: the identity instance
@@ -759,6 +766,9 @@ gst_identity_set_property (GObject * object, guint prop_id,
case PROP_SIGNAL_HANDOFFS:
identity->signal_handoffs = g_value_get_boolean (value);
break;
+ case PROP_DROP_ALLOCATION:
+ identity->drop_allocation = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -822,6 +832,9 @@ gst_identity_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_SIGNAL_HANDOFFS:
g_value_set_boolean (value, identity->signal_handoffs);
break;
+ case PROP_DROP_ALLOCATION:
+ g_value_set_boolean (value, identity->drop_allocation);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -887,6 +900,12 @@ gst_identity_query (GstBaseTransform * base, GstPadDirection direction,
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);
if (GST_QUERY_TYPE (query) == GST_QUERY_LATENCY) {
diff --git a/plugins/elements/gstidentity.h b/plugins/elements/gstidentity.h
index e622b491a..e9027324c 100644
--- a/plugins/elements/gstidentity.h
+++ b/plugins/elements/gstidentity.h
@@ -78,6 +78,7 @@ struct _GstIdentity {
GCond blocked_cond;
gboolean blocked;
GstClockTimeDiff ts_offset;
+ gboolean drop_allocation;
};
struct _GstIdentityClass {