summaryrefslogtreecommitdiff
path: root/ext/curl
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-05-14 09:15:55 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2012-05-14 09:15:55 +0200
commitf710f1250b65be63a99bb3dbeeac808db967ddbc (patch)
tree646abb57f37df6b3d15889a38d3ea351e1928cc9 /ext/curl
parentc5a4ffcbb3630469d00b34e97e9a9aacbddcc6d1 (diff)
downloadgstreamer-plugins-bad-f710f1250b65be63a99bb3dbeeac808db967ddbc.tar.gz
curl: fix compilation
Don't use deprecated thread API
Diffstat (limited to 'ext/curl')
-rw-r--r--ext/curl/gstcurlbasesink.c24
-rw-r--r--ext/curl/gstcurlbasesink.h2
-rw-r--r--ext/curl/gstcurlsmtpsink.c8
-rw-r--r--ext/curl/gstcurlsmtpsink.h2
4 files changed, 18 insertions, 18 deletions
diff --git a/ext/curl/gstcurlbasesink.c b/ext/curl/gstcurlbasesink.c
index 680be023f..96b554e32 100644
--- a/ext/curl/gstcurlbasesink.c
+++ b/ext/curl/gstcurlbasesink.c
@@ -210,7 +210,7 @@ gst_curl_base_sink_init (GstCurlBaseSink * sink)
{
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;
@@ -234,7 +234,7 @@ gst_curl_base_sink_finalize (GObject * gobject)
}
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);
@@ -257,7 +257,7 @@ gst_curl_base_sink_transfer_thread_notify_unlocked (GstCurlBaseSink * sink)
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
@@ -266,7 +266,7 @@ gst_curl_base_sink_transfer_thread_close (GstCurlBaseSink * sink)
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) {
@@ -891,8 +891,8 @@ gst_curl_base_sink_transfer_start_unlocked (GstCurlBaseSink * sink)
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;
@@ -1055,7 +1055,7 @@ gst_curl_base_sink_wait_for_data_unlocked (GstCurlBaseSink * sink)
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) {
@@ -1075,7 +1075,7 @@ gst_curl_base_sink_new_file_notify_unlocked (GstCurlBaseSink * sink)
{
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
@@ -1089,7 +1089,7 @@ 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");
}
@@ -1101,7 +1101,7 @@ gst_curl_base_sink_data_sent_notify (GstCurlBaseSink * sink)
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);
}
@@ -1112,7 +1112,7 @@ gst_curl_base_sink_wait_for_response (GstCurlBaseSink * 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);
@@ -1126,7 +1126,7 @@ gst_curl_base_sink_got_response_notify (GstCurlBaseSink * 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);
}
diff --git a/ext/curl/gstcurlbasesink.h b/ext/curl/gstcurlbasesink.h
index f40d3bcb6..378792cd6 100644
--- a/ext/curl/gstcurlbasesink.h
+++ b/ext/curl/gstcurlbasesink.h
@@ -52,7 +52,7 @@ struct _TransferBuffer
struct _TransferCondition
{
- GCond *cond;
+ GCond cond;
gboolean data_sent;
gboolean data_available;
gboolean wait_for_response;
diff --git a/ext/curl/gstcurlsmtpsink.c b/ext/curl/gstcurlsmtpsink.c
index 283f86a3f..6bf78efd1 100644
--- a/ext/curl/gstcurlsmtpsink.c
+++ b/ext/curl/gstcurlsmtpsink.c
@@ -127,7 +127,7 @@ gst_curl_smtp_sink_notify_transfer_end_unlocked (GstCurlSmtpSink * 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
@@ -136,7 +136,7 @@ gst_curl_smtp_sink_wait_for_transfer_end_unlocked (GstCurlSmtpSink * sink)
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");
}
@@ -292,7 +292,7 @@ gst_curl_smtp_sink_init (GstCurlSmtpSink * sink)
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;
@@ -321,7 +321,7 @@ gst_curl_smtp_sink_finalize (GObject * gobject)
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) {
diff --git a/ext/curl/gstcurlsmtpsink.h b/ext/curl/gstcurlsmtpsink.h
index ce8dc20cf..3927021aa 100644
--- a/ext/curl/gstcurlsmtpsink.h
+++ b/ext/curl/gstcurlsmtpsink.h
@@ -69,7 +69,7 @@ struct _GstCurlSmtpSink
CURL *pop_curl;
gboolean transfer_end;
- GCond *cond_transfer_end;
+ GCond cond_transfer_end;
gint nbr_attachments_left;
gboolean reset_transfer_options;