static GstBuffer *buf = NULL;
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
buffer_probe (GstPad * pad, GstBuffer * buffer, gpointer unused)
{
while (buf != NULL)
g_cond_wait (cond, lock);
+ /* increase the refcount because we store it globally for others to use */
buf = gst_buffer_ref (buffer);
g_cond_signal (cond);
}
+/* waits until the probe receives a buffer. will catch every buffer */
static GstBuffer *
get_buffer (GstElement * bin, GstPad * pad)
{