curl: fix compilation
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 14 May 2012 07:15:55 +0000 (09:15 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 14 May 2012 07:15:55 +0000 (09:15 +0200)
Don't use deprecated thread API

ext/curl/gstcurlbasesink.c
ext/curl/gstcurlbasesink.h
ext/curl/gstcurlsmtpsink.c
ext/curl/gstcurlsmtpsink.h

index 680be023f98cf28d350dda5362bc8782e50d5037..96b554e3290cf39e6aba42f258e8e86e4a7a2168 100644 (file)
@@ -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);
 }
 
index f40d3bcb6b13f8c9e7a1e1e40eb6f3eb86723945..378792cd69f08d06eee9ca535915e9273fe93f9d 100644 (file)
@@ -52,7 +52,7 @@ struct _TransferBuffer
 
 struct _TransferCondition
 {
-  GCond *cond;
+  GCond cond;
   gboolean data_sent;
   gboolean data_available;
   gboolean wait_for_response;
index 283f86a3f8bcf8533524430e5cf722313f59f801..6bf78efd13f9adda094709ad47a3c62f938a05d9 100644 (file)
@@ -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) {
index ce8dc20cf5c41d02880a31c5978de2cd7d2c8394..3927021aa2702fdb1d271ab2bc515295076b42e4 100644 (file)
@@ -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;