mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
dataqueue, elements: avoid unnecessary runtime type checks
This commit is contained in:
parent
72953ec2bb
commit
6ce1f0cbce
6 changed files with 16 additions and 17 deletions
|
@ -383,7 +383,7 @@ gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
|
|||
/* We ALWAYS need to check for queue fillness */
|
||||
if (gst_data_queue_locked_is_full (queue)) {
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
g_signal_emit (G_OBJECT (queue), gst_data_queue_signals[SIGNAL_FULL], 0);
|
||||
g_signal_emit (queue, gst_data_queue_signals[SIGNAL_FULL], 0);
|
||||
GST_DATA_QUEUE_MUTEX_LOCK_CHECK (queue, flushing);
|
||||
|
||||
/* signal might have removed some items */
|
||||
|
@ -441,7 +441,7 @@ gst_data_queue_pop (GstDataQueue * queue, GstDataQueueItem ** item)
|
|||
|
||||
if (gst_data_queue_locked_is_empty (queue)) {
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
g_signal_emit (G_OBJECT (queue), gst_data_queue_signals[SIGNAL_EMPTY], 0);
|
||||
g_signal_emit (queue, gst_data_queue_signals[SIGNAL_EMPTY], 0);
|
||||
GST_DATA_QUEUE_MUTEX_LOCK_CHECK (queue, flushing);
|
||||
|
||||
while (gst_data_queue_locked_is_empty (queue)) {
|
||||
|
|
|
@ -478,8 +478,8 @@ gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
|||
gst_fake_sink_notify_last_message (sink);
|
||||
}
|
||||
if (sink->signal_handoffs)
|
||||
g_signal_emit (G_OBJECT (sink), gst_fake_sink_signals[SIGNAL_HANDOFF], 0,
|
||||
buf, bsink->sinkpad);
|
||||
g_signal_emit (sink, gst_fake_sink_signals[SIGNAL_HANDOFF], 0, buf,
|
||||
bsink->sinkpad);
|
||||
|
||||
if (sink->dump) {
|
||||
gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
||||
|
|
|
@ -856,8 +856,8 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
|
|||
|
||||
if (src->signal_handoffs) {
|
||||
GST_LOG_OBJECT (src, "pre handoff emit");
|
||||
g_signal_emit (G_OBJECT (src), gst_fake_src_signals[SIGNAL_HANDOFF], 0,
|
||||
buf, basesrc->srcpad);
|
||||
g_signal_emit (src, gst_fake_src_signals[SIGNAL_HANDOFF], 0, buf,
|
||||
basesrc->srcpad);
|
||||
GST_LOG_OBJECT (src, "post handoff emit");
|
||||
}
|
||||
|
||||
|
|
|
@ -614,8 +614,7 @@ gst_identity_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
|
|||
}
|
||||
|
||||
if (identity->signal_handoffs)
|
||||
g_signal_emit (G_OBJECT (identity), gst_identity_signals[SIGNAL_HANDOFF], 0,
|
||||
buf);
|
||||
g_signal_emit (identity, gst_identity_signals[SIGNAL_HANDOFF], 0, buf);
|
||||
|
||||
if (trans->segment.format == GST_FORMAT_TIME)
|
||||
runtimestamp = gst_segment_to_running_time (&trans->segment,
|
||||
|
|
|
@ -1382,7 +1382,7 @@ single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
|
|||
/* Overrun is always forwarded, since this is blocking the upstream element */
|
||||
if (filled) {
|
||||
GST_DEBUG_OBJECT (mq, "A queue is filled, signalling overrun");
|
||||
g_signal_emit (G_OBJECT (mq), gst_multi_queue_signals[SIGNAL_OVERRUN], 0);
|
||||
g_signal_emit (mq, gst_multi_queue_signals[SIGNAL_OVERRUN], 0);
|
||||
}
|
||||
|
||||
beach:
|
||||
|
@ -1422,7 +1422,7 @@ single_queue_underrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
|
|||
|
||||
if (empty) {
|
||||
GST_DEBUG_OBJECT (mq, "All queues are empty, signalling it");
|
||||
g_signal_emit (G_OBJECT (mq), gst_multi_queue_signals[SIGNAL_UNDERRUN], 0);
|
||||
g_signal_emit (mq, gst_multi_queue_signals[SIGNAL_UNDERRUN], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1498,9 +1498,9 @@ gst_single_queue_new (GstMultiQueue * mqueue)
|
|||
sq->turn = g_cond_new ();
|
||||
|
||||
/* attach to underrun/overrun signals to handle non-starvation */
|
||||
g_signal_connect (G_OBJECT (sq->queue), "full",
|
||||
g_signal_connect (sq->queue, "full",
|
||||
G_CALLBACK (single_queue_overrun_cb), sq);
|
||||
g_signal_connect (G_OBJECT (sq->queue), "empty",
|
||||
g_signal_connect (sq->queue, "empty",
|
||||
G_CALLBACK (single_queue_underrun_cb), sq);
|
||||
|
||||
tmp = g_strdup_printf ("sink%d", sq->id);
|
||||
|
|
|
@ -900,7 +900,7 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|||
* We always handle events and they don't count in our statistics. */
|
||||
while (gst_queue_is_filled (queue)) {
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_OVERRUN], 0);
|
||||
g_signal_emit (queue, gst_queue_signals[SIGNAL_OVERRUN], 0);
|
||||
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
||||
|
||||
/* we recheck, the signal could have changed the thresholds */
|
||||
|
@ -937,7 +937,7 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|||
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "queue is not full");
|
||||
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_RUNNING], 0);
|
||||
g_signal_emit (queue, gst_queue_signals[SIGNAL_RUNNING], 0);
|
||||
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
||||
break;
|
||||
}
|
||||
|
@ -1130,7 +1130,7 @@ gst_queue_loop (GstPad * pad)
|
|||
|
||||
while (gst_queue_is_empty (queue)) {
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_UNDERRUN], 0);
|
||||
g_signal_emit (queue, gst_queue_signals[SIGNAL_UNDERRUN], 0);
|
||||
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "queue is empty");
|
||||
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
||||
|
||||
|
@ -1140,8 +1140,8 @@ gst_queue_loop (GstPad * pad)
|
|||
}
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
||||
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_RUNNING], 0);
|
||||
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_PUSHING], 0);
|
||||
g_signal_emit (queue, gst_queue_signals[SIGNAL_RUNNING], 0);
|
||||
g_signal_emit (queue, gst_queue_signals[SIGNAL_PUSHING], 0);
|
||||
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "queue is not empty");
|
||||
|
||||
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
||||
|
|
Loading…
Reference in a new issue