mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
plugins/elements/gstqueue.c: First patch of code cleanups, use the macros and right arguments in the macros to signal...
Original commit message from CVS: Patch by: Felipe Contreras <felipe dot contreras at gmail dot com> * plugins/elements/gstqueue.c: (gst_queue_handle_sink_event): First patch of code cleanups, use the macros and right arguments in the macros to signal and lock the queue. See #480858.
This commit is contained in:
parent
1b3e413bba
commit
de02b89391
2 changed files with 19 additions and 11 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2007-09-28 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
Patch by: Felipe Contreras <felipe dot contreras at gmail dot com>
|
||||||
|
|
||||||
|
* plugins/elements/gstqueue.c: (gst_queue_handle_sink_event):
|
||||||
|
First patch of code cleanups, use the macros and right arguments in the
|
||||||
|
macros to signal and lock the queue. See #480858.
|
||||||
|
|
||||||
2007-09-26 Wim Taymans <wim.taymans@gmail.com>
|
2007-09-26 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* gst/gstbus.c: (poll_func):
|
* gst/gstbus.c: (poll_func):
|
||||||
|
|
|
@ -142,23 +142,23 @@ enum
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
#define GST_QUEUE_WAIT_DEL_CHECK(q, label) G_STMT_START { \
|
#define GST_QUEUE_WAIT_DEL_CHECK(q, label) G_STMT_START { \
|
||||||
STATUS (queue, q->sinkpad, "wait for DEL"); \
|
STATUS (q, q->sinkpad, "wait for DEL"); \
|
||||||
g_cond_wait (q->item_del, queue->qlock); \
|
g_cond_wait (q->item_del, q->qlock); \
|
||||||
if (q->srcresult != GST_FLOW_OK) { \
|
if (q->srcresult != GST_FLOW_OK) { \
|
||||||
STATUS (queue, q->srcpad, "received DEL wakeup"); \
|
STATUS (q, q->srcpad, "received DEL wakeup"); \
|
||||||
goto label; \
|
goto label; \
|
||||||
} \
|
} \
|
||||||
STATUS (queue, q->sinkpad, "received DEL"); \
|
STATUS (q, q->sinkpad, "received DEL"); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
#define GST_QUEUE_WAIT_ADD_CHECK(q, label) G_STMT_START { \
|
#define GST_QUEUE_WAIT_ADD_CHECK(q, label) G_STMT_START { \
|
||||||
STATUS (queue, q->srcpad, "wait for ADD"); \
|
STATUS (q, q->srcpad, "wait for ADD"); \
|
||||||
g_cond_wait (q->item_add, q->qlock); \
|
g_cond_wait (q->item_add, q->qlock); \
|
||||||
if (q->srcresult != GST_FLOW_OK) { \
|
if (q->srcresult != GST_FLOW_OK) { \
|
||||||
STATUS (queue, q->srcpad, "received ADD wakeup"); \
|
STATUS (q, q->srcpad, "received ADD wakeup"); \
|
||||||
goto label; \
|
goto label; \
|
||||||
} \
|
} \
|
||||||
STATUS (queue, q->srcpad, "received ADD"); \
|
STATUS (q, q->srcpad, "received ADD"); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
#define GST_QUEUE_SIGNAL_DEL(q) G_STMT_START { \
|
#define GST_QUEUE_SIGNAL_DEL(q) G_STMT_START { \
|
||||||
|
@ -742,8 +742,8 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
||||||
GST_QUEUE_MUTEX_LOCK (queue);
|
GST_QUEUE_MUTEX_LOCK (queue);
|
||||||
queue->srcresult = GST_FLOW_WRONG_STATE;
|
queue->srcresult = GST_FLOW_WRONG_STATE;
|
||||||
/* unblock the loop and chain functions */
|
/* unblock the loop and chain functions */
|
||||||
g_cond_signal (queue->item_add);
|
GST_QUEUE_SIGNAL_ADD (queue);
|
||||||
g_cond_signal (queue->item_del);
|
GST_QUEUE_SIGNAL_DEL (queue);
|
||||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||||
|
|
||||||
/* make sure it pauses, this should happen since we sent
|
/* make sure it pauses, this should happen since we sent
|
||||||
|
@ -1291,14 +1291,14 @@ gst_queue_change_state (GstElement * element, GstStateChange transition)
|
||||||
* the _chain function, it might have more room now
|
* the _chain function, it might have more room now
|
||||||
* to store the buffer/event in the queue */
|
* to store the buffer/event in the queue */
|
||||||
#define QUEUE_CAPACITY_CHANGE(q)\
|
#define QUEUE_CAPACITY_CHANGE(q)\
|
||||||
g_cond_signal (queue->item_del);
|
GST_QUEUE_SIGNAL_DEL (q);
|
||||||
|
|
||||||
/* Changing the minimum required fill level must
|
/* Changing the minimum required fill level must
|
||||||
* wake up the _loop function as it might now
|
* wake up the _loop function as it might now
|
||||||
* be able to preceed.
|
* be able to preceed.
|
||||||
*/
|
*/
|
||||||
#define QUEUE_THRESHOLD_CHANGE(q)\
|
#define QUEUE_THRESHOLD_CHANGE(q)\
|
||||||
g_cond_signal (queue->item_add);
|
GST_QUEUE_SIGNAL_ADD (q);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_queue_set_property (GObject * object,
|
gst_queue_set_property (GObject * object,
|
||||||
|
|
Loading…
Reference in a new issue