Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] gstavdtpsink: Fix using deprecated glib api
@ 2012-07-24 12:04 Szymon Janc
  2012-07-24 12:04 ` [PATCH 2/3] gsta2dpsink: " Szymon Janc
  2012-07-24 12:04 ` [PATCH 3/3] build: Require GLib 2.32 or later when building with gstreamer support Szymon Janc
  0 siblings, 2 replies; 4+ messages in thread
From: Szymon Janc @ 2012-07-24 12:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

g_mutex_new() is deprecated in glib 2.33. GMutex can now be allocated
as part of larger structure and initialized using g_mutex_init().

This also fixes following build error:

  CC     audio/audio_libgstbluetooth_la-gstavdtpsink.lo
audio/gstavdtpsink.c: In function 'gst_avdtp_sink_finalize':
audio/gstavdtpsink.c:198:2: error: 'g_mutex_free' is deprecated
  (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:273)
  [-Werror=deprecated-declarations]
audio/gstavdtpsink.c: In function 'gst_avdtp_sink_init':
audio/gstavdtpsink.c:1044:2: error: 'g_mutex_new' is deprecated
  (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:271)
  [-Werror=deprecated-declarations]
cc1: all warnings being treated as errors
make[1]: *** [audio/audio_libgstbluetooth_la-gstavdtpsink.lo] Error 1
---
 audio/gstavdtpsink.c |    8 ++++----
 audio/gstavdtpsink.h |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/audio/gstavdtpsink.c b/audio/gstavdtpsink.c
index ffaed7f..92c920f 100644
--- a/audio/gstavdtpsink.c
+++ b/audio/gstavdtpsink.c
@@ -56,11 +56,11 @@ GST_DEBUG_CATEGORY_STATIC(avdtp_sink_debug);
 #define DEFAULT_AUTOCONNECT TRUE
 
 #define GST_AVDTP_SINK_MUTEX_LOCK(s) G_STMT_START {	\
-		g_mutex_lock(s->sink_lock);		\
+		g_mutex_lock(&s->sink_lock);		\
 	} G_STMT_END
 
 #define GST_AVDTP_SINK_MUTEX_UNLOCK(s) G_STMT_START {	\
-		g_mutex_unlock(s->sink_lock);		\
+		g_mutex_unlock(&s->sink_lock);		\
 	} G_STMT_END
 
 struct bluetooth_data {
@@ -195,7 +195,7 @@ static void gst_avdtp_sink_finalize(GObject *object)
 	if (self->transport)
 		g_free(self->transport);
 
-	g_mutex_free(self->sink_lock);
+	g_mutex_clear(&self->sink_lock);
 
 	G_OBJECT_CLASS(parent_class)->finalize(object);
 }
@@ -1041,7 +1041,7 @@ static void gst_avdtp_sink_init(GstAvdtpSink *self,
 
 	self->autoconnect = DEFAULT_AUTOCONNECT;
 
-	self->sink_lock = g_mutex_new();
+	g_mutex_init(&self->sink_lock);
 
 	/* FIXME this is for not synchronizing with clock, should be tested
 	 * with devices to see the behaviour
diff --git a/audio/gstavdtpsink.h b/audio/gstavdtpsink.h
index eb998ac..393797e 100644
--- a/audio/gstavdtpsink.h
+++ b/audio/gstavdtpsink.h
@@ -66,7 +66,7 @@ struct _GstAvdtpSink {
 
 	GstCaps *dev_caps;
 
-	GMutex *sink_lock;
+	GMutex sink_lock;
 
 	guint watch_id;
 };
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] gsta2dpsink: Fix using deprecated glib api
  2012-07-24 12:04 [PATCH 1/3] gstavdtpsink: Fix using deprecated glib api Szymon Janc
@ 2012-07-24 12:04 ` Szymon Janc
  2012-07-24 12:04 ` [PATCH 3/3] build: Require GLib 2.32 or later when building with gstreamer support Szymon Janc
  1 sibling, 0 replies; 4+ messages in thread
From: Szymon Janc @ 2012-07-24 12:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

g_mutex_new() is deprecated in glib 2.33. GMutex can now be allocated
as part of larger structure and initialized using g_mutex_init().

This also fixes following build error:

  CC     audio/audio_libgstbluetooth_la-gsta2dpsink.lo
audio/gsta2dpsink.c: In function 'gst_a2dp_sink_finalize':
audio/gsta2dpsink.c:82:2: error: 'g_mutex_free' is deprecated
  (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:273)
  [-Werror=deprecated-declarations]
audio/gsta2dpsink.c: In function 'gst_a2dp_sink_init':
audio/gsta2dpsink.c:711:2: error: 'g_mutex_new' is deprecated
  (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:271)
  [-Werror=deprecated-declarations]
cc1: all warnings being treated as errors
---
 audio/gsta2dpsink.c |   12 ++++++------
 audio/gsta2dpsink.h |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/audio/gsta2dpsink.c b/audio/gsta2dpsink.c
index c8f6346..9f8781e 100644
--- a/audio/gsta2dpsink.c
+++ b/audio/gsta2dpsink.c
@@ -79,7 +79,7 @@ static void gst_a2dp_sink_finalize(GObject *obj)
 {
 	GstA2dpSink *self = GST_A2DP_SINK(obj);
 
-	g_mutex_free(self->cb_mutex);
+	g_mutex_clear(&self->cb_mutex);
 
 	G_OBJECT_CLASS(parent_class)->finalize(obj);
 }
@@ -665,10 +665,10 @@ static gboolean gst_a2dp_sink_init_fakesink(GstA2dpSink *self)
 	if (self->fakesink != NULL)
 		return TRUE;
 
-	g_mutex_lock(self->cb_mutex);
+	g_mutex_lock(&self->cb_mutex);
 	self->fakesink = gst_a2dp_sink_init_element(self, "fakesink",
 			"fakesink", self->capsfilter);
-	g_mutex_unlock(self->cb_mutex);
+	g_mutex_unlock(&self->cb_mutex);
 
 	if (!self->fakesink)
 		return FALSE;
@@ -678,7 +678,7 @@ static gboolean gst_a2dp_sink_init_fakesink(GstA2dpSink *self)
 
 static gboolean gst_a2dp_sink_remove_fakesink(GstA2dpSink *self)
 {
-	g_mutex_lock(self->cb_mutex);
+	g_mutex_lock(&self->cb_mutex);
 
 	if (self->fakesink != NULL) {
 		gst_element_set_locked_state(self->fakesink, TRUE);
@@ -688,7 +688,7 @@ static gboolean gst_a2dp_sink_remove_fakesink(GstA2dpSink *self)
 		self->fakesink = NULL;
 	}
 
-	g_mutex_unlock(self->cb_mutex);
+	g_mutex_unlock(&self->cb_mutex);
 
 	return TRUE;
 }
@@ -708,7 +708,7 @@ static void gst_a2dp_sink_init(GstA2dpSink *self,
 	self->ghostpad = NULL;
 	self->sink_is_in_bin = FALSE;
 
-	self->cb_mutex = g_mutex_new();
+	g_mutex_init(&self->cb_mutex);
 
 	/* we initialize our capsfilter */
 	gst_a2dp_sink_init_caps_filter(self);
diff --git a/audio/gsta2dpsink.h b/audio/gsta2dpsink.h
index 1a591b2..5822dcd 100644
--- a/audio/gsta2dpsink.h
+++ b/audio/gsta2dpsink.h
@@ -66,7 +66,7 @@ struct _GstA2dpSink {
 	 * when it is created we forward this to it */
 	GstTagList *taglist;
 
-	GMutex *cb_mutex;
+	GMutex cb_mutex;
 };
 
 struct _GstA2dpSinkClass {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] build: Require GLib 2.32 or later when building with gstreamer support
  2012-07-24 12:04 [PATCH 1/3] gstavdtpsink: Fix using deprecated glib api Szymon Janc
  2012-07-24 12:04 ` [PATCH 2/3] gsta2dpsink: " Szymon Janc
@ 2012-07-24 12:04 ` Szymon Janc
  2012-07-24 13:38   ` Marcel Holtmann
  1 sibling, 1 reply; 4+ messages in thread
From: Szymon Janc @ 2012-07-24 12:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

gstreamer code now uses g_mutex_init() and related functions only
available in GLib >= 2.32.
---
 acinclude.m4 |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/acinclude.m4 b/acinclude.m4
index 39b0a18..5e39aa7 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -108,6 +108,8 @@ AC_DEFUN([AC_PATH_GLIB], [
 AC_DEFUN([AC_PATH_GSTREAMER], [
 	PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.30 gstreamer-plugins-base-0.10, gstreamer_found=yes,
 				AC_MSG_WARN(GStreamer library version 0.10.30 or later is required);gstreamer_found=no)
+	PKG_CHECK_MODULES(GLIB_FOR_GS, glib-2.0 >= 2.32, dummy=yes,
+				AC_MSG_ERROR(GLib >= 2.32 is required for gstreamer support))
 	AC_SUBST(GSTREAMER_CFLAGS)
 	AC_SUBST(GSTREAMER_LIBS)
 	GSTREAMER_PLUGINSDIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-0.10`
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] build: Require GLib 2.32 or later when building with gstreamer support
  2012-07-24 12:04 ` [PATCH 3/3] build: Require GLib 2.32 or later when building with gstreamer support Szymon Janc
@ 2012-07-24 13:38   ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2012-07-24 13:38 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

> gstreamer code now uses g_mutex_init() and related functions only
> available in GLib >= 2.32.
> ---
>  acinclude.m4 |    2 ++
>  1 file changed, 2 insertions(+)

since we are planning to move SBC to a separate project and GStreamer
Bluetooth support then into GStreamer upstream, this is a NACK.

Regards

Marcel



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-24 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 12:04 [PATCH 1/3] gstavdtpsink: Fix using deprecated glib api Szymon Janc
2012-07-24 12:04 ` [PATCH 2/3] gsta2dpsink: " Szymon Janc
2012-07-24 12:04 ` [PATCH 3/3] build: Require GLib 2.32 or later when building with gstreamer support Szymon Janc
2012-07-24 13:38   ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox