1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
6  *
7  *
8  *  This library is free software; you can redistribute it and/or
9  *  modify it under the terms of the GNU Lesser General Public
10  *  License as published by the Free Software Foundation; either
11  *  version 2.1 of the License, or (at your option) any later version.
12  *
13  *  This library is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  *  Lesser General Public License for more details.
17  *
18  *  You should have received a copy of the GNU Lesser General Public
19  *  License along with this library; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23 
24 #ifndef __GST_AVDTP_SINK_H
25 #define __GST_AVDTP_SINK_H
26 
27 #include <gst/gst.h>
28 #include <gst/base/gstbasesink.h>
29 #include "gstavdtputil.h"
30 
31 G_BEGIN_DECLS
32 #define GST_TYPE_AVDTP_SINK \
33 	(gst_avdtp_sink_get_type())
34 #define GST_AVDTP_SINK(obj) \
35 	(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVDTP_SINK,\
36 		GstAvdtpSink))
37 #define GST_AVDTP_SINK_CLASS(klass) \
38 	(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVDTP_SINK,\
39 		GstAvdtpSinkClass))
40 #define GST_IS_AVDTP_SINK(obj) \
41 	(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVDTP_SINK))
42 #define GST_IS_AVDTP_SINK_CLASS(obj) \
43 	(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVDTP_SINK))
44 typedef struct _GstAvdtpSink GstAvdtpSink;
45 typedef struct _GstAvdtpSinkClass GstAvdtpSinkClass;
46 
47 struct _GstAvdtpSink
48 {
49   GstBaseSink sink;
50 
51   GstAvdtpConnection conn;
52 
53   gboolean autoconnect;
54 
55   /* mp3 stream data (outside caps data) */
56   gint mp3_using_crc;
57   gint channel_mode;
58 
59   /* stream connection data */
60   GstCaps *stream_caps;
61 
62   GstCaps *dev_caps;
63 
64   GMutex sink_lock;
65 
66   guint watch_id;
67 };
68 
69 struct _GstAvdtpSinkClass
70 {
71   GstBaseSinkClass parent_class;
72 };
73 
74 GType gst_avdtp_sink_get_type (void);
75 
76 GstCaps *gst_avdtp_sink_get_device_caps (GstAvdtpSink * sink);
77 
78 guint gst_avdtp_sink_get_link_mtu (GstAvdtpSink * sink);
79 
80 void gst_avdtp_sink_set_device (GstAvdtpSink * sink, const gchar * device);
81 
82 void gst_avdtp_sink_set_transport (GstAvdtpSink * sink,
83     const gchar * transport);
84 
85 gchar *gst_avdtp_sink_get_device (GstAvdtpSink * sink);
86 
87 gchar *gst_avdtp_sink_get_transport (GstAvdtpSink * sink);
88 
89 gboolean gst_avdtp_sink_plugin_init (GstPlugin * plugin);
90 
91 void gst_avdtp_sink_set_crc (GstAvdtpSink * self, gboolean crc);
92 
93 void gst_avdtp_sink_set_channel_mode (GstAvdtpSink * self, const gchar * mode);
94 
95 
96 G_END_DECLS
97 #endif /* __GST_AVDTP_SINK_H */
98