1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
6  *  Copyright (C) 2012  Collabora Ltd.
7  *
8  *
9  *  This library is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU Lesser General Public
11  *  License as published by the Free Software Foundation; either
12  *  version 2.1 of the License, or (at your option) any later version.
13  *
14  *  This library is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  *  Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public
20  *  License along with this library; if not, write to the Free Software
21  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22  *
23  */
24 
25 #ifndef __GST_AVDTP_UTIL_H
26 #define __GST_AVDTP_UTIL_H
27 
28 #include <glib.h>
29 
30 #include "bluez.h"
31 
32 G_BEGIN_DECLS
33 
34 #define DEFAULT_CODEC_BUFFER_SIZE 2048
35 #define TEMPLATE_MAX_BITPOOL_STR "64"
36 
37 struct bluetooth_data
38 {
39   guint link_mtu;
40 
41   BluezMediaTransport1 *conn;
42   guint8 codec;                 /* Bluetooth transport configuration */
43   gchar *uuid;
44   guint8 *config;
45   gint config_size;
46   gboolean is_acquired;
47 
48   gchar buffer[DEFAULT_CODEC_BUFFER_SIZE];      /* Codec transfer buffer */
49 };
50 
51 typedef struct _GstAvdtpConnection GstAvdtpConnection;
52 
53 struct _GstAvdtpConnection
54 {
55   gchar *device;
56   gchar *transport;
57   GIOChannel *stream;
58 
59   struct bluetooth_data data;
60 };
61 
62 gboolean gst_avdtp_connection_acquire (GstAvdtpConnection * conn,
63     gboolean use_try);
64 void gst_avdtp_connection_release (GstAvdtpConnection * conn);
65 void gst_avdtp_connection_reset (GstAvdtpConnection * conn);
66 gboolean gst_avdtp_connection_get_properties (GstAvdtpConnection * conn);
67 GstCaps *gst_avdtp_connection_get_caps (GstAvdtpConnection * conn);
68 void gst_avdtp_connection_set_device (GstAvdtpConnection * conn,
69     const char *device);
70 void gst_avdtp_connection_set_transport (GstAvdtpConnection * conn,
71     const char *transport);
72 void gst_avdtp_connection_notify_volume (GstAvdtpConnection * conn,
73     GObject * target, const gchar * property);
74 gboolean gst_avdtp_connection_conf_recv_stream_fd (GstAvdtpConnection * conn);
75 
76 G_END_DECLS
77 #endif
78