gst_funnel_sink_chain (GstPad * pad, GstBuffer * buffer)
{
GstFlowReturn res;
- GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
GstEvent *event = NULL;
GstClockTime newts;
#if 0
out:
#endif
- gst_object_unref (funnel);
return res;
}
static gboolean
gst_funnel_sink_event (GstPad * pad, GstEvent * event)
{
- GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad);
gboolean forward = TRUE;
gboolean res = TRUE;
- if (G_UNLIKELY (funnel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:
{
else
gst_event_unref (event);
- gst_object_unref (funnel);
-
return res;
}
static gboolean
gst_funnel_sink_query (GstPad * pad, GstQuery * query)
{
- GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
+ GstFunnel *funnel = GST_FUNNEL (GST_PAD_PARENT (pad));
gboolean forward = TRUE;
gboolean res = TRUE;
- if (G_UNLIKELY (funnel == NULL)) {
- gst_query_unref (query);
- return FALSE;
- }
-
if (forward)
res = gst_pad_peer_query (funnel->srcpad, query);
- gst_object_unref (funnel);
-
return res;
}
gboolean done = FALSE;
GValue value = { 0, };
- funnel = gst_pad_get_parent_element (pad);
- if (G_UNLIKELY (funnel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ funnel = GST_ELEMENT_CAST (GST_PAD_PARENT (pad));
iter = gst_element_iterate_sink_pads (funnel);
}
g_value_unset (&value);
gst_iterator_free (iter);
- gst_object_unref (funnel);
gst_event_unref (event);
return result;
GstIterator *it = NULL;
GValue val = { 0, };
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL))
- return NULL;
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE);
if (otherpad) {
g_value_unset (&val);
gst_object_unref (otherpad);
}
- gst_object_unref (sel);
return it;
}
GstPad *prev_active_sinkpad;
GstPad *active_sinkpad;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
selpad = GST_SELECTOR_PAD_CAST (pad);
GST_INPUT_SELECTOR_LOCK (sel);
} else
gst_event_unref (event);
- gst_object_unref (sel);
-
return res;
}
gst_selector_pad_query (GstPad * pad, GstQuery * query)
{
gboolean res = FALSE;
- GstInputSelector *sel;
-
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL))
- return FALSE;
switch (GST_QUERY_TYPE (query)) {
default:
break;
}
- gst_object_unref (sel);
-
return res;
}
GstSegment *seg;
GstEvent *start_event = NULL;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
selpad = GST_SELECTOR_PAD_CAST (pad);
seg = &selpad->segment;
selpad->pushed = TRUE;
done:
- gst_object_unref (sel);
return res;
/* dropped buffers */
GstPad *eventpad;
GList *pushed_pads = NULL;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
-
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
/* Send upstream events to all sinkpads */
iter = gst_element_iterate_sink_pads (GST_ELEMENT_CAST (sel));
gboolean res = FALSE;
GstInputSelector *sel;
- sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL))
- return FALSE;
+ sel = GST_INPUT_SELECTOR (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_LATENCY:
break;
}
- gst_object_unref (sel);
-
return res;
}
GstIterator *it = NULL;
GstPad *opad;
GstSingleQueue *squeue;
- GstMultiQueue *mq = GST_MULTI_QUEUE (gst_pad_get_parent (pad));
+ GstMultiQueue *mq = GST_MULTI_QUEUE (GST_PAD_PARENT (pad));
GValue val = { 0, };
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
out:
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
- gst_object_unref (mq);
return it;
}
GstEvent *sref = NULL;
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
- mq = (GstMultiQueue *) gst_pad_get_parent (pad);
+ mq = (GstMultiQueue *) GST_PAD_PARENT (pad);
type = GST_EVENT_TYPE (event);
break;
}
done:
- gst_object_unref (mq);
return res;
flushing:
GstOutputSelector *osel;
GstClockTime position, duration;
- osel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
+ osel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
/*
* The _switch function might push a buffer if 'resend-latest' is true.
GST_LOG_OBJECT (osel, "pushing buffer to %" GST_PTR_FORMAT,
osel->active_srcpad);
res = gst_pad_push (osel->active_srcpad, buf);
- gst_object_unref (osel);
return res;
}
GstOutputSelector *sel;
GstPad *active = NULL;
- sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
}
}
- gst_object_unref (sel);
-
return res;
}
GstOutputSelector *sel;
GstPad *active = NULL;
- sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
- if (G_UNLIKELY (sel == NULL)) {
- return FALSE;
- }
+ sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:
break;
}
- gst_object_unref (sel);
-
return res;
}
GstPadLinkReturn result = GST_PAD_LINK_OK;
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
GST_DEBUG_OBJECT (queue, "queue linking source pad");
}
GST_QUEUE_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
return result;
}
{
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
- if (G_UNLIKELY (queue == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
break;
}
done:
- gst_object_unref (queue);
return TRUE;
/* ERRORS */
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"refusing event, we are flushing");
GST_QUEUE_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
gst_event_unref (event);
return FALSE;
}
{
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "refusing event, we are EOS");
GST_QUEUE_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
gst_event_unref (event);
return FALSE;
}
static gboolean
gst_queue_handle_sink_query (GstPad * pad, GstQuery * query)
{
- GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
gboolean res;
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
-
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_ACCEPT_CAPS:
case GST_QUERY_CAPS:
res = gst_pad_query_default (pad, query);
break;
}
- gst_object_unref (queue);
return res;
}
gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
- if (G_UNLIKELY (queue == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)",
event, GST_EVENT_TYPE (event));
res = gst_pad_push_event (queue->sinkpad, event);
- gst_object_unref (queue);
return res;
}
static gboolean
gst_queue_handle_src_query (GstPad * pad, GstQuery * query)
{
- GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
+ GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
gboolean res;
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
-
res = gst_pad_peer_query (queue->sinkpad, query);
if (!res) {
- gst_object_unref (queue);
return FALSE;
}
break;
}
- gst_object_unref (queue);
return TRUE;
}
gboolean result = TRUE;
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE_MUTEX_LOCK (queue);
GST_QUEUE_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
-
return result;
}
gboolean result = FALSE;
GstQueue *queue;
- queue = GST_QUEUE (gst_pad_get_parent (pad));
+ queue = GST_QUEUE (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE_MUTEX_LOCK (queue);
result = gst_pad_stop_task (pad);
}
- gst_object_unref (queue);
-
return result;
}
gst_queue2_handle_sink_query (GstPad * pad, GstQuery * query)
{
gboolean res;
- GstQueue2 *queue;
-
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
switch (GST_QUERY_TYPE (query)) {
default:
res = gst_pad_query_default (pad, query);
break;
}
- gst_object_unref (queue);
-
return res;
}
gst_queue2_handle_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = TRUE;
- GstQueue2 *queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ GstQueue2 *queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
- if (G_UNLIKELY (queue == NULL)) {
- gst_event_unref (event);
- return FALSE;
- }
#ifndef GST_DISABLE_GST_DEBUG
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)",
event, GST_EVENT_TYPE_NAME (event));
break;
}
- gst_object_unref (queue);
return res;
}
{
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
- if (G_UNLIKELY (queue == NULL))
- return FALSE;
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
break;
}
- gst_object_unref (queue);
return TRUE;
/* ERRORS */
peer_failed:
{
GST_DEBUG_OBJECT (queue, "failed peer query");
- gst_object_unref (queue);
return FALSE;
}
}
GstQueue2 *queue;
GstFlowReturn ret;
- queue = GST_QUEUE2_CAST (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2_CAST (GST_PAD_PARENT (pad));
length = (length == -1) ? DEFAULT_BUFFER_SIZE : length;
GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->srcresult, out_flushing);
ret = gst_queue2_create_read (queue, offset, length, buffer);
GST_QUEUE2_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
-
return ret;
/* ERRORS */
GST_DEBUG_OBJECT (queue, "we are flushing");
GST_QUEUE2_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
return ret;
}
out_unexpected:
{
GST_DEBUG_OBJECT (queue, "read beyond end of file");
GST_QUEUE2_MUTEX_UNLOCK (queue);
- gst_object_unref (queue);
return GST_FLOW_EOS;
}
}
gboolean result = TRUE;
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE2_MUTEX_LOCK (queue);
GST_QUEUE2_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
-
return result;
}
gboolean result = FALSE;
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE2_MUTEX_LOCK (queue);
result = gst_pad_stop_task (pad);
}
- gst_object_unref (queue);
-
return result;
}
gboolean result;
GstQueue2 *queue;
- queue = GST_QUEUE2 (gst_pad_get_parent (pad));
+ queue = GST_QUEUE2 (GST_PAD_PARENT (pad));
if (active) {
GST_QUEUE2_MUTEX_LOCK (queue);
result = TRUE;
GST_QUEUE2_MUTEX_UNLOCK (queue);
}
- gst_object_unref (queue);
return result;
}
GstFlowReturn res;
GstTee *tee;
- tee = GST_TEE_CAST (gst_pad_get_parent (pad));
+ tee = GST_TEE_CAST (GST_PAD_PARENT (pad));
GST_DEBUG_OBJECT (tee, "received list %p", list);
GST_DEBUG_OBJECT (tee, "handled list %s", gst_flow_get_name (res));
- gst_object_unref (tee);
-
return res;
}
gboolean res;
GstPad *sinkpad;
- tee = GST_TEE (gst_pad_get_parent (pad));
+ tee = GST_TEE (GST_PAD_PARENT (pad));
GST_OBJECT_LOCK (tee);
tee->sink_mode = active & GST_PAD_ACTIVATE_PULL;
GST_OBJECT_UNLOCK (tee);
- gst_object_unref (tee);
-
return res;
/* ERRORS */
GST_OBJECT_UNLOCK (tee);
GST_INFO_OBJECT (tee, "Cannot activate in pull mode, pull-mode "
"set to NEVER");
- gst_object_unref (tee);
return FALSE;
}
cannot_pull_multiple_srcs:
GST_OBJECT_UNLOCK (tee);
GST_INFO_OBJECT (tee, "Cannot activate multiple src pads in pull mode, "
"pull-mode set to SINGLE");
- gst_object_unref (tee);
return FALSE;
}
sink_activate_failed:
{
GST_INFO_OBJECT (tee, "Failed to %sactivate sink pad in pull mode",
active ? "" : "de");
- gst_object_unref (tee);
return FALSE;
}
}
gboolean res;
GstPad *sinkpad;
- tee = GST_TEE (gst_pad_get_parent (pad));
+ tee = GST_TEE (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_SCHEDULING:
break;
}
- gst_object_unref (tee);
-
return res;
}
GstTee *tee;
GstFlowReturn ret;
- tee = GST_TEE (gst_pad_get_parent (pad));
+ tee = GST_TEE (GST_PAD_PARENT (pad));
ret = gst_pad_pull_range (tee->sinkpad, offset, length, buf);
else if (ret == GST_FLOW_EOS)
gst_tee_pull_eos (tee);
- gst_object_unref (tee);
-
return ret;
}
GstValve *valve;
gboolean ret = TRUE;
- valve = GST_VALVE (gst_pad_get_parent (pad));
- if (valve == NULL)
- return FALSE;
+ valve = GST_VALVE (GST_PAD_PARENT (pad));
if (g_atomic_int_get (&valve->drop))
gst_event_unref (event);
if (g_atomic_int_get (&valve->drop))
ret = TRUE;
- gst_object_unref (valve);
return ret;
}
gboolean res;
GstPad *otherpad;
- valve = GST_VALVE (gst_pad_get_parent (pad));
- if (valve == NULL)
- return FALSE;
+ valve = GST_VALVE (GST_PAD_PARENT (pad));
otherpad = (pad == valve->sinkpad ? valve->srcpad : valve->sinkpad);
break;
}
- gst_object_unref (valve);
-
return res;
}