Commit b7966c0c authored by Wim Taymans's avatar Wim Taymans

pad: make an ACCEPT_CAPS query

Replace the acceptcaps function with a query.
parent 756f6eb3
......@@ -107,32 +107,40 @@ gboolean
gst_proxy_pad_query_default (GstPad * pad, GstQuery * query)
{
gboolean res;
GstPad *target;
g_return_val_if_fail (GST_IS_PROXY_PAD (pad), FALSE);
g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
target = gst_proxy_pad_get_target (pad);
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ACCEPT_CAPS:
{
if (target) {
res = gst_pad_query (target, query);
gst_object_unref (target);
} else {
GST_DEBUG_OBJECT (pad, "no target");
/* We don't have a target, we return TRUE and we assume that any future
* target will be able to deal with any configured caps. */
res = TRUE;
}
break;
}
default:
{
GstPad *target;
if (!(target = gst_proxy_pad_get_target (pad)))
goto no_target;
res = gst_pad_query (target, query);
gst_object_unref (target);
if (target) {
res = gst_pad_query (target, query);
gst_object_unref (target);
} else {
GST_DEBUG_OBJECT (pad, "no target pad");
res = FALSE;
}
break;
}
}
return res;
/* ERRORS */
no_target:
{
GST_DEBUG_OBJECT (pad, "no target pad");
return FALSE;
}
}
/**
......@@ -485,7 +493,6 @@ gst_proxy_pad_init (GstProxyPad * ppad)
gst_proxy_pad_iterate_internal_links_default);
gst_pad_set_getcaps_function (pad, gst_proxy_pad_getcaps_default);
gst_pad_set_acceptcaps_function (pad, gst_proxy_pad_acceptcaps_default);
gst_pad_set_fixatecaps_function (pad, gst_proxy_pad_fixatecaps_default);
gst_pad_set_unlink_function (pad, gst_proxy_pad_unlink_default);
}
......
......@@ -142,7 +142,6 @@ static void gst_pad_get_property (GObject * object, guint prop_id,
static GstCaps *gst_pad_get_caps_unlocked (GstPad * pad, GstCaps * filter);
static void gst_pad_set_pad_template (GstPad * pad, GstPadTemplate * templ);
static gboolean gst_pad_activate_default (GstPad * pad);
static gboolean gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps);
static void gst_pad_fixate_caps_default (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_pad_chain_list_default (GstPad * pad,
GstBufferList * list);
......@@ -302,7 +301,6 @@ gst_pad_class_init (GstPadClass * klass)
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_event_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_query_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_iterate_internal_links_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_acceptcaps_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_chain_list_default);
GST_DEBUG_REGISTER_FUNCPTR (gst_pad_fixate_caps_default);
}
......@@ -318,7 +316,6 @@ gst_pad_init (GstPad * pad)
GST_PAD_EVENTFUNC (pad) = gst_pad_event_default;
GST_PAD_QUERYFUNC (pad) = gst_pad_query_default;
GST_PAD_ITERINTLINKFUNC (pad) = gst_pad_iterate_internal_links_default;
GST_PAD_ACCEPTCAPSFUNC (pad) = gst_pad_acceptcaps_default;
GST_PAD_FIXATECAPSFUNC (pad) = gst_pad_fixate_caps_default;
GST_PAD_CHAINLISTFUNC (pad) = gst_pad_chain_list_default;
......@@ -1545,27 +1542,6 @@ gst_pad_set_getcaps_function (GstPad * pad, GstPadGetCapsFunction getcaps)
GST_DEBUG_FUNCPTR_NAME (getcaps));
}
/**
* gst_pad_set_acceptcaps_function:
* @pad: a #GstPad.
* @acceptcaps: the #GstPadAcceptCapsFunction to set.
*
* Sets the given acceptcaps function for the pad. The acceptcaps function
* will be called to check if the pad can accept the given caps. Setting the
* acceptcaps function to NULL restores the default behaviour of allowing
* any caps that matches the caps from gst_pad_get_caps().
*/
void
gst_pad_set_acceptcaps_function (GstPad * pad,
GstPadAcceptCapsFunction acceptcaps)
{
g_return_if_fail (GST_IS_PAD (pad));
GST_PAD_ACCEPTCAPSFUNC (pad) = acceptcaps;
GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "acceptcapsfunc set to %s",
GST_DEBUG_FUNCPTR_NAME (acceptcaps));
}
/**
* gst_pad_set_fixatecaps_function:
* @pad: a #GstPad.
......@@ -2447,37 +2423,6 @@ gst_pad_fixate_caps (GstPad * pad, GstCaps * caps)
fixatefunc (pad, caps);
}
/* Default accept caps implementation just checks against
* against the allowed caps for the pad */
static gboolean
gst_pad_acceptcaps_default (GstPad * pad, GstCaps * caps)
{
/* get the caps and see if it intersects to something not empty */
GstCaps *allowed;
gboolean result = FALSE;
GST_DEBUG_OBJECT (pad, "caps %" GST_PTR_FORMAT, caps);
allowed = gst_pad_get_caps (pad, NULL);
if (!allowed)
goto nothing_allowed;
GST_DEBUG_OBJECT (pad, "allowed caps %" GST_PTR_FORMAT, allowed);
result = gst_caps_is_subset (caps, allowed);
gst_caps_unref (allowed);
return result;
/* ERRORS */
nothing_allowed:
{
GST_DEBUG_OBJECT (pad, "no caps allowed on the pad");
return FALSE;
}
}
/**
* gst_pad_accept_caps:
* @pad: a #GstPad to check
......@@ -2490,54 +2435,23 @@ nothing_allowed:
gboolean
gst_pad_accept_caps (GstPad * pad, GstCaps * caps)
{
gboolean result;
GstPadAcceptCapsFunction acceptfunc;
#if 0
GstCaps *existing = NULL;
#endif
gboolean res;
GstQuery *query;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (GST_IS_CAPS (caps), FALSE);
/* any pad can be unnegotiated */
if (caps == NULL)
return TRUE;
/* lock for checking the existing caps */
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "accept caps of %p", caps);
#if 0
GST_OBJECT_LOCK (pad);
/* The current caps on a pad are trivially acceptable */
if (G_LIKELY ((existing = GST_PAD_CAPS (pad)))) {
if (caps == existing || gst_caps_is_equal (caps, existing))
goto is_same_caps;
}
GST_OBJECT_UNLOCK (pad);
#endif
acceptfunc = GST_PAD_ACCEPTCAPSFUNC (pad);
/* Only null if the element explicitly unset it */
if (G_UNLIKELY (acceptfunc == NULL))
goto no_func;
/* we can call the function */
result = acceptfunc (pad, caps);
GST_DEBUG_OBJECT (pad, "acceptfunc returned %d", result);
return result;
#if 0
is_same_caps:
{
GST_DEBUG_OBJECT (pad, "pad had same caps");
GST_OBJECT_UNLOCK (pad);
return TRUE;
}
#endif
no_func:
{
GST_DEBUG_OBJECT (pad, "no acceptcaps function");
return FALSE;
query = gst_query_new_accept_caps (caps);
res = gst_pad_query (pad, query);
if (res) {
GST_DEBUG_OBJECT (pad, "query returned %d", res);
gst_query_parse_accept_caps_result (query, &res);
}
gst_query_unref (query);
return res;
}
/**
......@@ -2546,41 +2460,24 @@ no_func:
* @caps: a #GstCaps to check on the pad
*
* Check if the peer of @pad accepts @caps. If @pad has no peer, this function
* returns TRUE.
* returns FALSE.
*
* Returns: TRUE if the peer of @pad can accept the caps or @pad has no peer.
*/
gboolean
gst_pad_peer_accept_caps (GstPad * pad, GstCaps * caps)
{
GstPad *peerpad;
gboolean result;
GstQuery *query;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (GST_IS_CAPS (caps), FALSE);
GST_OBJECT_LOCK (pad);
GST_CAT_DEBUG_OBJECT (GST_CAT_CAPS, pad, "peer accept caps of (%p)", pad);
peerpad = GST_PAD_PEER (pad);
if (G_UNLIKELY (peerpad == NULL))
goto no_peer;
gst_object_ref (peerpad);
/* release lock before calling external methods but keep ref to pad */
GST_OBJECT_UNLOCK (pad);
result = gst_pad_accept_caps (peerpad, caps);
gst_object_unref (peerpad);
query = gst_query_new_accept_caps (caps);
result = gst_pad_peer_query (pad, query);
gst_query_unref (query);
return result;
no_peer:
{
GST_OBJECT_UNLOCK (pad);
return TRUE;
}
}
/**
......@@ -3093,6 +2990,33 @@ gst_pad_event_default (GstPad * pad, GstEvent * event)
return result;
}
/* Default accept caps implementation just checks against
* the allowed caps for the pad */
static gboolean
gst_pad_query_accept_caps (GstPad * pad, GstQuery * query)
{
/* get the caps and see if it intersects to something not empty */
GstCaps *caps, *allowed;
gboolean result;
gst_query_parse_accept_caps (query, &caps);
GST_DEBUG_OBJECT (pad, "caps %" GST_PTR_FORMAT, caps);
allowed = gst_pad_get_caps (pad, NULL);
if (allowed) {
GST_DEBUG_OBJECT (pad, "allowed caps %" GST_PTR_FORMAT, allowed);
result = gst_caps_is_subset (caps, allowed);
gst_caps_unref (allowed);
} else {
GST_DEBUG_OBJECT (pad, "no caps allowed on the pad");
result = FALSE;
}
gst_query_set_accept_caps_result (query, result);
return TRUE;
}
/**
* gst_pad_query_default:
* @pad: a #GstPad to call the default query handler on.
......@@ -3115,6 +3039,10 @@ gst_pad_query_default (GstPad * pad, GstQuery * query)
case GST_QUERY_SCHEDULING:
forward = FALSE;
break;
case GST_QUERY_ACCEPT_CAPS:
ret = gst_pad_query_accept_caps (pad, query);
forward = FALSE;
break;
case GST_QUERY_POSITION:
case GST_QUERY_SEEKING:
case GST_QUERY_FORMATS:
......
......@@ -418,18 +418,6 @@ typedef void (*GstPadUnlinkFunction) (GstPad *pad);
*/
typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad, GstCaps *filter);
/**
* GstPadAcceptCapsFunction:
* @pad: the #GstPad to check
* @caps: the #GstCaps to check
*
* Check if @pad can accept @caps. By default this function will see if @caps
* intersect with the result from gst_pad_get_caps() by can be overridden to
* perform extra checks.
*
* Returns: TRUE if the caps can be accepted by the pad.
*/
typedef gboolean (*GstPadAcceptCapsFunction) (GstPad *pad, GstCaps *caps);
/**
* GstPadFixateCapsFunction:
* @pad: a #GstPad
......@@ -626,7 +614,6 @@ typedef enum {
* @block_cond: conditional to signal pad block
* @probes: installed probes
* @getcapsfunc: function to get caps of the pad
* @acceptcapsfunc: function to check if pad can accept caps
* @fixatecapsfunc: function to fixate caps
* @mode: current activation mode of the pad
* @activatefunc: pad activation function
......@@ -668,7 +655,6 @@ struct _GstPad {
/* the pad capabilities */
GstPadGetCapsFunction getcapsfunc;
GstPadAcceptCapsFunction acceptcapsfunc;
GstPadFixateCapsFunction fixatecapsfunc;
GstPadActivateMode mode;
......@@ -743,7 +729,6 @@ struct _GstPadClass {
#define GST_PAD_UNLINKFUNC(pad) (GST_PAD_CAST(pad)->unlinkfunc)
#define GST_PAD_GETCAPSFUNC(pad) (GST_PAD_CAST(pad)->getcapsfunc)
#define GST_PAD_ACCEPTCAPSFUNC(pad) (GST_PAD_CAST(pad)->acceptcapsfunc)
#define GST_PAD_FIXATECAPSFUNC(pad) (GST_PAD_CAST(pad)->fixatecapsfunc)
#define GST_PAD_IS_SRC(pad) (GST_PAD_DIRECTION(pad) == GST_PAD_SRC)
......@@ -880,7 +865,6 @@ GstPad* gst_pad_get_peer (GstPad *pad);
/* capsnego functions */
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps);
void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
......
......@@ -54,7 +54,8 @@ static const gchar *_quark_strings[] = {
"min-buffers", "max-buffers", "prefix", "postfix", "align", "time",
"GstQueryAllocation", "need-pool", "meta", "pool", "GstEventCaps",
"GstEventReconfigure", "segment", "GstQueryScheduling", "pull-mode",
"random-access", "sequential", "allocator", "GstEventFlushStop", "options"
"random-access", "sequential", "allocator", "GstEventFlushStop", "options",
"GstQueryAcceptCaps", "result"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
......
......@@ -155,8 +155,10 @@ typedef enum _GstQuarkId
GST_QUARK_ALLOCATOR = 126,
GST_QUARK_EVENT_FLUSH_STOP = 127,
GST_QUARK_OPTIONS = 128,
GST_QUARK_QUERY_ACCEPT_CAPS = 129,
GST_QUARK_RESULT = 130,
GST_QUARK_MAX = 129
GST_QUARK_MAX = 131
} GstQuarkId;
extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
......
......@@ -105,6 +105,7 @@ static GstQueryTypeDefinition standard_definitions[] = {
{GST_QUERY_URI, "uri", "URI of the source or sink", 0},
{GST_QUERY_ALLOCATION, "allocation", "Allocation properties", 0},
{GST_QUERY_SCHEDULING, "scheduling", "Scheduling properties", 0},
{GST_QUERY_ACCEPT_CAPS, "accept-caps", "Accept caps", 0},
{GST_QUERY_NONE, NULL, NULL, 0}
};
......@@ -2002,3 +2003,63 @@ gst_query_parse_scheduling (GstQuery * query, gboolean * pull_mode,
GST_QUARK (MAXSIZE), G_TYPE_INT, maxsize,
GST_QUARK (ALIGN), G_TYPE_INT, align, NULL);
}
/**
* gst_query_new_accept_caps
* @caps: a #GstCaps
*
* Constructs a new query object for querying if @caps are accepted.
*
* Free-function: gst_query_unref
*
* Returns: (transfer full): a new #GstQuery
*/
GstQuery *
gst_query_new_accept_caps (GstCaps * caps)
{
GstQuery *query;
GstStructure *structure;
structure = gst_structure_new_id (GST_QUARK (QUERY_ACCEPT_CAPS),
GST_QUARK (CAPS), GST_TYPE_CAPS, caps,
GST_QUARK (RESULT), G_TYPE_BOOLEAN, FALSE, NULL);
query = gst_query_new (GST_QUERY_ACCEPT_CAPS, structure);
return query;
}
void
gst_query_parse_accept_caps (GstQuery * query, GstCaps ** caps)
{
GstStructure *structure;
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS);
structure = GST_QUERY_STRUCTURE (query);
gst_structure_id_get (structure, GST_QUARK (CAPS), GST_TYPE_CAPS, caps, NULL);
}
void
gst_query_set_accept_caps_result (GstQuery * query, gboolean result)
{
GstStructure *structure;
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS);
g_return_if_fail (gst_query_is_writable (query));
structure = GST_QUERY_STRUCTURE (query);
gst_structure_id_set (structure,
GST_QUARK (RESULT), G_TYPE_BOOLEAN, result, NULL);
}
void
gst_query_parse_accept_caps_result (GstQuery * query, gboolean * result)
{
GstStructure *structure;
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ACCEPT_CAPS);
structure = GST_QUERY_STRUCTURE (query);
gst_structure_id_get (structure,
GST_QUARK (RESULT), G_TYPE_BOOLEAN, result, NULL);
}
......@@ -55,6 +55,7 @@ G_BEGIN_DECLS
* @GST_QUERY_URI: query the URI of the source or sink. Since 0.10.22.
* @GST_QUERY_ALLOCATION: the buffer allocation properties
* @GST_QUERY_SCHEDULING: the scheduling properties
* @GST_QUERY_ACCEPT_CAPS: the accept caps query
*
* Standard predefined Query types
*/
......@@ -75,7 +76,9 @@ typedef enum {
GST_QUERY_CUSTOM,
GST_QUERY_URI,
GST_QUERY_ALLOCATION,
GST_QUERY_SCHEDULING
GST_QUERY_SCHEDULING,
GST_QUERY_ACCEPT_CAPS,
GST_QUERY_LAST
} GstQueryType;
/**
......@@ -378,6 +381,11 @@ void gst_query_set_scheduling (GstQuery *query, gboolean pul
void gst_query_parse_scheduling (GstQuery *query, gboolean *pull_mode,
gboolean *random_access, gboolean *sequential,
gint *minsize, gint *maxsize, gint *align);
/* accept-caps query */
GstQuery * gst_query_new_accept_caps (GstCaps *caps);
void gst_query_parse_accept_caps (GstQuery *query, GstCaps **caps);
void gst_query_set_accept_caps_result (GstQuery *query, gboolean result);
void gst_query_parse_accept_caps_result (GstQuery *query, gboolean *result);
G_END_DECLS
......
......@@ -318,7 +318,6 @@ static GstFlowReturn gst_base_transform_getrange (GstPad * pad, guint64 offset,
static GstFlowReturn gst_base_transform_chain (GstPad * pad,
GstBuffer * buffer);
static GstCaps *gst_base_transform_getcaps (GstPad * pad, GstCaps * filter);
static gboolean gst_base_transform_acceptcaps (GstPad * pad, GstCaps * caps);
static gboolean gst_base_transform_acceptcaps_default (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps);
static gboolean gst_base_transform_setcaps (GstBaseTransform * trans,
......@@ -399,8 +398,6 @@ gst_base_transform_init (GstBaseTransform * trans,
trans->sinkpad = gst_pad_new_from_template (pad_template, "sink");
gst_pad_set_getcaps_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_getcaps));
gst_pad_set_acceptcaps_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_acceptcaps));
gst_pad_set_event_function (trans->sinkpad,
GST_DEBUG_FUNCPTR (gst_base_transform_sink_event));
gst_pad_set_chain_function (trans->sinkpad,
......@@ -417,8 +414,6 @@ gst_base_transform_init (GstBaseTransform * trans,
trans->srcpad = gst_pad_new_from_template (pad_template, "src");
gst_pad_set_getcaps_function (trans->srcpad,
GST_DEBUG_FUNCPTR (gst_base_transform_getcaps));
gst_pad_set_acceptcaps_function (trans->srcpad,
GST_DEBUG_FUNCPTR (gst_base_transform_acceptcaps));
gst_pad_set_event_function (trans->srcpad,
GST_DEBUG_FUNCPTR (gst_base_transform_src_event));
gst_pad_set_getrange_function (trans->srcpad,
......@@ -1182,24 +1177,6 @@ no_transform_possible:
}
}
static gboolean
gst_base_transform_acceptcaps (GstPad * pad, GstCaps * caps)
{
gboolean ret = TRUE;
GstBaseTransform *trans;
GstBaseTransformClass *bclass;
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->accept_caps)
ret = bclass->accept_caps (trans, GST_PAD_DIRECTION (pad), caps);
gst_object_unref (trans);
return ret;
}
/* called when new caps arrive on the sink or source pad,
* We try to find the best caps for the other side using our _find_transform()
* function. If there are caps, we configure the transform for this new
......@@ -1304,9 +1281,12 @@ gst_base_transform_default_query (GstBaseTransform * trans,
{
gboolean ret = FALSE;
GstPad *otherpad;
GstBaseTransformClass *klass;
otherpad = (direction == GST_PAD_SRC) ? trans->sinkpad : trans->srcpad;
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ALLOCATION:
{
......@@ -1324,11 +1304,7 @@ gst_base_transform_default_query (GstBaseTransform * trans,
GST_DEBUG_OBJECT (trans, "doing passthrough query");
ret = gst_pad_peer_query (otherpad, query);
} else {
GstBaseTransformClass *klass;
GST_DEBUG_OBJECT (trans, "propose allocation values");
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
/* pass the query to the propose_allocation vmethod if any */
if (G_LIKELY (klass->propose_allocation))
ret = klass->propose_allocation (trans, query);
......@@ -1363,6 +1339,19 @@ gst_base_transform_default_query (GstBaseTransform * trans,
}
break;
}
case GST_QUERY_ACCEPT_CAPS:
{
GstCaps *caps;
gst_query_parse_accept_caps (query, &caps);
if (klass->accept_caps) {
ret = klass->accept_caps (trans, direction, caps);
gst_query_set_accept_caps_result (query, ret);
/* return TRUE, we answered the query */
ret = TRUE;
}
break;
}
default:
ret = gst_pad_peer_query (otherpad, query);
break;
......
......@@ -180,7 +180,6 @@ static gint64 gst_selector_pad_get_running_time (GstSelectorPad * pad);
static void gst_selector_pad_reset (GstSelectorPad * pad);
static gboolean gst_selector_pad_event (GstPad * pad, GstEvent * event);
static GstCaps *gst_selector_pad_getcaps (GstPad * pad, GstCaps * filter);
static gboolean gst_selector_pad_acceptcaps (GstPad * pad, GstCaps * caps);
static gboolean gst_selector_pad_query (GstPad * pad, GstQuery * query);
static GstIterator *gst_selector_pad_iterate_linked_pads (GstPad * pad);
static GstFlowReturn gst_selector_pad_chain (GstPad * pad, GstBuffer * buf);
......@@ -506,6 +505,7 @@ gst_selector_pad_query (GstPad * pad, GstQuery * query)
otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE);
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ACCEPT_CAPS:
default:
if (otherpad)
res = gst_pad_peer_query (otherpad, query);
......@@ -539,23 +539,6 @@ gst_selector_pad_getcaps (GstPad * pad, GstCaps * filter)
return caps;
}
static gboolean
gst_selector_pad_acceptcaps (GstPad * pad, GstCaps * caps)
{
GstInputSelector *sel;
gboolean res;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL))
return FALSE;
GST_DEBUG_OBJECT (sel, "Checking acceptcaps of srcpad peer");
res = gst_pad_peer_accept_caps (sel->srcpad, caps);
gst_object_unref (sel);
return res;
}
/* must be called with the SELECTOR_LOCK, will block while the pad is blocked
* or return TRUE when flushing */
static gboolean
......@@ -1323,8 +1306,6 @@ gst_input_selector_request_new_pad (GstElement * element,
GST_DEBUG_FUNCPTR (gst_selector_pad_event));
gst_pad_set_getcaps_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_selector_pad_getcaps));
gst_pad_set_acceptcaps_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_selector_pad_acceptcaps));
gst_pad_set_query_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_selector_pad_query));
gst_pad_set_chain_function (sinkpad,
......
......@@ -1036,16 +1036,10 @@ gst_single_queue_push_one (GstMultiQueue * mq, GstSingleQueue * sq,
if (GST_IS_BUFFER (object)) {
GstBuffer *buffer;
GstClockTime timestamp, duration;
#if 0
GstCaps *caps;
#endif
buffer = GST_BUFFER_CAST (object);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer);
#if 0
caps = GST_BUFFER_CAPS (buffer);
#endif
apply_buffer (mq, sq, timestamp, duration, &sq->src_segment);
......@@ -1056,14 +1050,6 @@ gst_single_queue_push_one (GstMultiQueue * mq, GstSingleQueue * sq,
"SingleQueue %d : Pushing buffer %p with ts %" GST_TIME_FORMAT,
sq->id, buffer, GST_TIME_ARGS (timestamp));
#if 0
/* Set caps on pad before pushing, this avoids core calling the acceptcaps
* function on the srcpad, which will call acceptcaps upstream, which might
* not accept these caps (anymore). */
if (caps && caps != GST_PAD_CAPS (sq->srcpad))
gst_pad_set_caps (sq->srcpad, caps);