guint16 seqnum;
gboolean pad_added;
GstPad *pad;
- GMutex *lock;
- GCond *cond;
+ GMutex lock;
+ GCond cond;
GstPad *sinkpad;
GList *pads;
} CleanupData;
{
data->seqnum = 10;
data->pad_added = FALSE;
- data->lock = g_mutex_new ();
- data->cond = g_cond_new ();
+ g_mutex_init (&data->lock);
+ g_cond_init (&data->cond);
data->pads = NULL;
}
{
g_list_foreach (data->pads, (GFunc) gst_object_unref, NULL);
g_list_free (data->pads);
- g_mutex_free (data->lock);
- g_cond_free (data->cond);
+ g_mutex_clear (&data->lock);
+ g_cond_clear (&data->cond);
}
static guint8 rtp_packet[] = { 0x80, 0x60, 0x94, 0xbc, 0x8f, 0x37, 0x4e, 0xb8,
sinkpad = make_sinkpad (data);
fail_unless (gst_pad_link (pad, sinkpad) == GST_PAD_LINK_OK);
- g_mutex_lock (data->lock);
+ g_mutex_lock (&data->lock);
data->pad_added = TRUE;
data->pad = pad;
- g_cond_signal (data->cond);
- g_mutex_unlock (data->lock);
+ g_cond_signal (&data->cond);
+ g_mutex_unlock (&data->lock);
}
static void
fail_unless (data->pad_added == TRUE);
- g_mutex_lock (data->lock);
+ g_mutex_lock (&data->lock);
data->pad_added = FALSE;
- g_cond_signal (data->cond);
- g_mutex_unlock (data->lock);
+ g_cond_signal (&data->cond);
+ g_mutex_unlock (&data->lock);
}
GST_START_TEST (test_cleanup_recv)
fail_unless (res == GST_FLOW_OK);
/* we wait for the new pad to appear now */
- g_mutex_lock (data.lock);
+ g_mutex_lock (&data.lock);
while (!data.pad_added)
- g_cond_wait (data.cond, data.lock);
- g_mutex_unlock (data.lock);
+ g_cond_wait (&data.cond, &data.lock);
+ g_mutex_unlock (&data.lock);
/* sourcepad created now */
fail_unless (rtpbin->numsinkpads == 1);
gst_object_unref (rtp_sink);
/* pad should be gone now */
- g_mutex_lock (data.lock);
+ g_mutex_lock (&data.lock);
while (data.pad_added)
- g_cond_wait (data.cond, data.lock);
- g_mutex_unlock (data.lock);
+ g_cond_wait (&data.cond, &data.lock);
+ g_mutex_unlock (&data.lock);
/* nothing left anymore now */
fail_unless (rtpbin->numsinkpads == 0);
fail_unless (res == GST_FLOW_OK);
/* we wait for the new pad to appear now */
- g_mutex_lock (data.lock);
+ g_mutex_lock (&data.lock);
while (!data.pad_added)
- g_cond_wait (data.cond, data.lock);
- g_mutex_unlock (data.lock);
+ g_cond_wait (&data.cond, &data.lock);
+ g_mutex_unlock (&data.lock);
/* sourcepad created now */
fail_unless (rtpbin->numsinkpads == 1);
fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
/* pad should be gone now */
- g_mutex_lock (data.lock);
+ g_mutex_lock (&data.lock);
while (data.pad_added)
- g_cond_wait (data.cond, data.lock);
- g_mutex_unlock (data.lock);
+ g_cond_wait (&data.cond, &data.lock);
+ g_mutex_unlock (&data.lock);
/* back to playing for the next round */
ret = gst_element_set_state (rtpbin, GST_STATE_PLAYING);