{
sink->transfer_buf = g_malloc (sizeof (TransferBuffer));
sink->transfer_cond = g_malloc (sizeof (TransferCondition));
- sink->transfer_cond->cond = g_cond_new ();
+ g_cond_init (&sink->transfer_cond->cond);
sink->transfer_cond->data_sent = FALSE;
sink->transfer_cond->data_available = FALSE;
sink->transfer_cond->wait_for_response = FALSE;
}
gst_curl_base_sink_transfer_cleanup (this);
- g_cond_free (this->transfer_cond->cond);
+ g_cond_clear (&this->transfer_cond->cond);
g_free (this->transfer_cond);
g_free (this->transfer_buf);
sink->transfer_cond->data_available = TRUE;
sink->transfer_cond->data_sent = FALSE;
sink->transfer_cond->wait_for_response = TRUE;
- g_cond_signal (sink->transfer_cond->cond);
+ g_cond_signal (&sink->transfer_cond->cond);
}
void
GST_OBJECT_LOCK (sink);
GST_LOG_OBJECT (sink, "setting transfer thread close flag");
sink->transfer_thread_close = TRUE;
- g_cond_signal (sink->transfer_cond->cond);
+ g_cond_signal (&sink->transfer_cond->cond);
GST_OBJECT_UNLOCK (sink);
if (sink->transfer_thread != NULL) {
sink->transfer_thread_close = FALSE;
sink->new_file = TRUE;
sink->transfer_thread =
- g_thread_create ((GThreadFunc) gst_curl_base_sink_transfer_thread_func,
- sink, TRUE, &error);
+ g_thread_try_new ("Curl Transfer Thread", (GThreadFunc)
+ gst_curl_base_sink_transfer_thread_func, sink, &error);
if (sink->transfer_thread == NULL || error != NULL) {
ret = FALSE;
GST_LOG ("waiting for data");
while (!sink->transfer_cond->data_available &&
!sink->transfer_thread_close && !sink->new_file) {
- g_cond_wait (sink->transfer_cond->cond, GST_OBJECT_GET_LOCK (sink));
+ g_cond_wait (&sink->transfer_cond->cond, GST_OBJECT_GET_LOCK (sink));
}
if (sink->transfer_thread_close) {
{
GST_LOG ("new file name");
sink->new_file = TRUE;
- g_cond_signal (sink->transfer_cond->cond);
+ g_cond_signal (&sink->transfer_cond->cond);
}
static void
* This can therefore never happen while this function is running since this
* function also is called by the pipeline thread (in the render function) */
while (!sink->transfer_cond->data_sent) {
- g_cond_wait (sink->transfer_cond->cond, GST_OBJECT_GET_LOCK (sink));
+ g_cond_wait (&sink->transfer_cond->cond, GST_OBJECT_GET_LOCK (sink));
}
GST_LOG ("buffer send completed");
}
GST_OBJECT_LOCK (sink);
sink->transfer_cond->data_available = FALSE;
sink->transfer_cond->data_sent = TRUE;
- g_cond_signal (sink->transfer_cond->cond);
+ g_cond_signal (&sink->transfer_cond->cond);
GST_OBJECT_UNLOCK (sink);
}
GST_OBJECT_LOCK (sink);
while (sink->transfer_cond->wait_for_response) {
- g_cond_wait (sink->transfer_cond->cond, GST_OBJECT_GET_LOCK (sink));
+ g_cond_wait (&sink->transfer_cond->cond, GST_OBJECT_GET_LOCK (sink));
}
GST_OBJECT_UNLOCK (sink);
GST_OBJECT_LOCK (sink);
sink->transfer_cond->wait_for_response = FALSE;
- g_cond_signal (sink->transfer_cond->cond);
+ g_cond_signal (&sink->transfer_cond->cond);
GST_OBJECT_UNLOCK (sink);
}
{
GST_LOG ("transfer completed: %d", sink->transfer_end);
sink->transfer_end = TRUE;
- g_cond_signal (sink->cond_transfer_end);
+ g_cond_signal (&sink->cond_transfer_end);
}
static void
GST_LOG ("waiting for final data do be sent: %d", sink->transfer_end);
while (!sink->transfer_end) {
- g_cond_wait (sink->cond_transfer_end, GST_OBJECT_GET_LOCK (sink));
+ g_cond_wait (&sink->cond_transfer_end, GST_OBJECT_GET_LOCK (sink));
}
GST_LOG ("final data sent");
}
sink->payload_headers = NULL;
sink->base64_chunk = NULL;
- sink->cond_transfer_end = g_cond_new ();
+ g_cond_init (&sink->cond_transfer_end);
sink->transfer_end = FALSE;
sink->eos = FALSE;
g_free (this->message_body);
g_free (this->content_type);
- g_cond_free (this->cond_transfer_end);
+ g_cond_clear (&this->cond_transfer_end);
if (this->base64_chunk != NULL) {
if (this->base64_chunk->chunk_array != NULL) {