dnl *** bluez ***
translit(dnm, m, l) AM_CONDITIONAL(USE_BLUEZ, true)
AG_GST_CHECK_FEATURE(BLUEZ, [Bluez], bluez, [
- PKG_CHECK_MODULES([BLUEZ], [bluez < 5.0], [
+ PKG_CHECK_MODULES([BLUEZ4], [bluez < 5.0], [
+ HAVE_BLUEZ=yes
+ AC_DEFINE(HAVE_BLUEZ4,[1],[Old bluez detected])
+ ], [
+ PKG_CHECK_MODULES([BLUEZ5], [bluez >= 5.0], [
+ HAVE_BLUEZ=yes
+ AC_DEFINE(HAVE_BLUEZ5,[1],[Current bluez detected])
+ ], [
+ HAVE_BLUEZ=no
+ ])
+ ])
+ AS_IF([ test x$HAVE_BLUEZ = xyes ],[
dnl FIXME: we should be able to replace this with the GLib DBus stuff
PKG_CHECK_MODULES([DBUS], [dbus-1], [HAVE_BLUEZ=yes], [HAVE_BLUEZ=no])
- ], [
- HAVE_BLUEZ=no
])
])
{
DBusMessage *msg, *reply;
DBusError err;
+#ifdef HAVE_BLUEZ4
const char *access_type = "rw";
+#endif
int fd;
uint16_t imtu, omtu;
if (conn->data.conn == NULL)
conn->data.conn = dbus_bus_get (DBUS_BUS_SYSTEM, &err);
+#ifdef HAVE_BLUEZ4
msg = dbus_message_new_method_call ("org.bluez", conn->transport,
"org.bluez.MediaTransport", "Acquire");
dbus_message_append_args (msg, DBUS_TYPE_STRING, &access_type,
DBUS_TYPE_INVALID);
+#else
+ msg = dbus_message_new_method_call ("org.bluez", conn->transport,
+ "org.bluez.MediaTransport1", "Acquire");
+#endif
reply = dbus_connection_send_with_reply_and_block (conn->data.conn,
msg, -1, &err);
gst_avdtp_connection_transport_release (GstAvdtpConnection * conn)
{
DBusMessage *msg;
+#ifdef HAVE_BLUEZ4
const char *access_type = "rw";
msg = dbus_message_new_method_call ("org.bluez", conn->transport,
dbus_message_append_args (msg, DBUS_TYPE_STRING, &access_type,
DBUS_TYPE_INVALID);
-
+#else
+ msg = dbus_message_new_method_call ("org.bluez", conn->transport,
+ "org.bluez.MediaTransport1", "Release");
+#endif
dbus_connection_send (conn->data.conn, msg, NULL);
dbus_message_unref (msg);
DBusMessage *msg, *reply;
DBusMessageIter arg_i, ele_i;
DBusError err;
+#ifndef HAVE_BLUEZ4
+ const char *interface;
+#endif
dbus_error_init (&err);
+#ifdef HAVE_BLUEZ4
msg = dbus_message_new_method_call ("org.bluez", conn->transport,
"org.bluez.MediaTransport", "GetProperties");
-
+#else
+ msg = dbus_message_new_method_call ("org.bluez", conn->transport,
+ "org.freedesktop.DBus.Properties", "GetAll");
+#endif
if (!msg) {
GST_ERROR ("D-Bus Memory allocation failed");
return FALSE;
}
-
+#ifndef HAVE_BLUEZ4
+ interface = "org.bluez.MediaTransport1";
+ dbus_message_append_args (msg, DBUS_TYPE_STRING, &interface,
+ DBUS_TYPE_INVALID);
+#endif
reply = dbus_connection_send_with_reply_and_block (conn->data.conn,
msg, -1, &err);