mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-07 03:02:17 +00:00
comment on my understanding
Original commit message from CVS: comment on my understanding
This commit is contained in:
parent
a80c8f6887
commit
10cf7276d1
1 changed files with 4 additions and 0 deletions
|
@ -33,6 +33,8 @@ static GMutex *lock = NULL;
|
||||||
static GstBuffer *buf = NULL;
|
static GstBuffer *buf = NULL;
|
||||||
static gulong id;
|
static gulong id;
|
||||||
|
|
||||||
|
/* called for every buffer. Waits until the global "buf" variable is unset,
|
||||||
|
* then sets it to the buffer received, and signals. */
|
||||||
static gboolean
|
static gboolean
|
||||||
buffer_probe (GstPad * pad, GstBuffer * buffer, gpointer unused)
|
buffer_probe (GstPad * pad, GstBuffer * buffer, gpointer unused)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +43,7 @@ buffer_probe (GstPad * pad, GstBuffer * buffer, gpointer unused)
|
||||||
while (buf != NULL)
|
while (buf != NULL)
|
||||||
g_cond_wait (cond, lock);
|
g_cond_wait (cond, lock);
|
||||||
|
|
||||||
|
/* increase the refcount because we store it globally for others to use */
|
||||||
buf = gst_buffer_ref (buffer);
|
buf = gst_buffer_ref (buffer);
|
||||||
|
|
||||||
g_cond_signal (cond);
|
g_cond_signal (cond);
|
||||||
|
@ -62,6 +65,7 @@ start_pipeline (GstElement * bin, GstPad * pad)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* waits until the probe receives a buffer. will catch every buffer */
|
||||||
static GstBuffer *
|
static GstBuffer *
|
||||||
get_buffer (GstElement * bin, GstPad * pad)
|
get_buffer (GstElement * bin, GstPad * pad)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue