bluez: Rename a2dpsendersink to avdtpsink.
This commit is contained in:
parent
26017b78da
commit
309c6ecc47
@ -134,8 +134,7 @@ gst_a2dp_sink_set_property (GObject * object, guint prop_id,
|
|||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_DEVICE:
|
case PROP_DEVICE:
|
||||||
if (self->sink != NULL)
|
if (self->sink != NULL)
|
||||||
gst_a2dp_sender_sink_set_device (self->sink,
|
gst_avdtp_sink_set_device (self->sink, g_value_get_string (value));
|
||||||
g_value_get_string (value));
|
|
||||||
|
|
||||||
if (self->device != NULL)
|
if (self->device != NULL)
|
||||||
g_free (self->device);
|
g_free (self->device);
|
||||||
@ -158,7 +157,7 @@ gst_a2dp_sink_get_property (GObject * object, guint prop_id,
|
|||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_DEVICE:
|
case PROP_DEVICE:
|
||||||
if (self->sink != NULL) {
|
if (self->sink != NULL) {
|
||||||
device = gst_a2dp_sender_sink_get_device (self->sink);
|
device = gst_avdtp_sink_get_device (self->sink);
|
||||||
if (device != NULL)
|
if (device != NULL)
|
||||||
g_value_take_string (value, device);
|
g_value_take_string (value, device);
|
||||||
}
|
}
|
||||||
@ -228,15 +227,14 @@ gst_a2dp_sink_change_state (GstElement * element, GstStateChange transition)
|
|||||||
self->sink_is_in_bin = FALSE;
|
self->sink_is_in_bin = FALSE;
|
||||||
|
|
||||||
self->sink =
|
self->sink =
|
||||||
GST_A2DP_SENDER_SINK (gst_element_factory_make ("a2dpsendersink",
|
GST_AVDTP_SINK (gst_element_factory_make ("avdtpsink", "avdtpsink"));
|
||||||
"sendersink"));
|
|
||||||
if (self->sink == NULL) {
|
if (self->sink == NULL) {
|
||||||
GST_WARNING_OBJECT (self, "failed to create a2dpsendersink");
|
GST_WARNING_OBJECT (self, "failed to create avdtpsink");
|
||||||
return GST_STATE_CHANGE_FAILURE;
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->device != NULL)
|
if (self->device != NULL)
|
||||||
gst_a2dp_sender_sink_set_device (self->sink, self->device);
|
gst_avdtp_sink_set_device (self->sink, self->device);
|
||||||
|
|
||||||
ret = gst_element_set_state (GST_ELEMENT (self->sink), GST_STATE_READY);
|
ret = gst_element_set_state (GST_ELEMENT (self->sink), GST_STATE_READY);
|
||||||
break;
|
break;
|
||||||
@ -264,8 +262,7 @@ gst_a2dp_sink_change_state (GstElement * element, GstStateChange transition)
|
|||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
if (self->sink_is_in_bin) {
|
if (self->sink_is_in_bin) {
|
||||||
if (!gst_bin_remove (GST_BIN (self), GST_ELEMENT (self->sink)))
|
if (!gst_bin_remove (GST_BIN (self), GST_ELEMENT (self->sink)))
|
||||||
GST_WARNING_OBJECT (self, "Failed to remove "
|
GST_WARNING_OBJECT (self, "Failed to remove " "avdtpsink from bin");
|
||||||
"a2dpsendersink from bin");
|
|
||||||
} else if (self->sink != NULL) {
|
} else if (self->sink != NULL) {
|
||||||
gst_element_set_state (GST_ELEMENT (self->sink), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (self->sink), GST_STATE_NULL);
|
||||||
g_object_unref (G_OBJECT (self->sink));
|
g_object_unref (G_OBJECT (self->sink));
|
||||||
@ -308,7 +305,7 @@ gst_a2dp_sink_class_init (GstA2dpSinkClass * klass)
|
|||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_a2dp_sink_get_device_caps (GstA2dpSink * self)
|
gst_a2dp_sink_get_device_caps (GstA2dpSink * self)
|
||||||
{
|
{
|
||||||
return gst_a2dp_sender_sink_get_device_caps (self->sink);
|
return gst_avdtp_sink_get_device_caps (self->sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
@ -340,31 +337,31 @@ gst_a2dp_sink_init_sender_sink (GstA2dpSink * self)
|
|||||||
GstElement *sink;
|
GstElement *sink;
|
||||||
|
|
||||||
if (self->sink == NULL)
|
if (self->sink == NULL)
|
||||||
sink = gst_element_factory_make ("a2dpsendersink", "sendersink");
|
sink = gst_element_factory_make ("avdtpsink", "avdtosink");
|
||||||
else
|
else
|
||||||
sink = GST_ELEMENT (self->sink);
|
sink = GST_ELEMENT (self->sink);
|
||||||
|
|
||||||
if (sink == NULL) {
|
if (sink == NULL) {
|
||||||
GST_ERROR_OBJECT (self, "Couldn't create a2dpsendersink");
|
GST_ERROR_OBJECT (self, "Couldn't create avdtpsink");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_bin_add (GST_BIN (self), sink)) {
|
if (!gst_bin_add (GST_BIN (self), sink)) {
|
||||||
GST_ERROR_OBJECT (self, "failed to add a2dpsendersink " "to the bin");
|
GST_ERROR_OBJECT (self, "failed to add avdtpsink " "to the bin");
|
||||||
goto cleanup_and_fail;
|
goto cleanup_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_element_set_state (sink, GST_STATE_READY) == GST_STATE_CHANGE_FAILURE) {
|
if (gst_element_set_state (sink, GST_STATE_READY) == GST_STATE_CHANGE_FAILURE) {
|
||||||
GST_ERROR_OBJECT (self, "a2dpsendersink failed to go to ready");
|
GST_ERROR_OBJECT (self, "avdtpsink failed to go to ready");
|
||||||
goto remove_element_and_fail;
|
goto remove_element_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_element_link (GST_ELEMENT (self->rtp), sink)) {
|
if (!gst_element_link (GST_ELEMENT (self->rtp), sink)) {
|
||||||
GST_ERROR_OBJECT (self, "couldn't link rtpsbcpay " "to a2dpsendersink");
|
GST_ERROR_OBJECT (self, "couldn't link rtpsbcpay " "to avdtpsink");
|
||||||
goto remove_element_and_fail;
|
goto remove_element_and_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->sink = GST_A2DP_SENDER_SINK (sink);
|
self->sink = GST_AVDTP_SINK (sink);
|
||||||
self->sink_is_in_bin = TRUE;
|
self->sink_is_in_bin = TRUE;
|
||||||
g_object_set (G_OBJECT (self->sink), "device", self->device, NULL);
|
g_object_set (G_OBJECT (self->sink), "device", self->device, NULL);
|
||||||
|
|
||||||
@ -461,10 +458,10 @@ gst_a2dp_sink_init_dynamic_elements (GstA2dpSink * self, GstCaps * caps)
|
|||||||
|
|
||||||
/* send directly the crc */
|
/* send directly the crc */
|
||||||
if (gst_tag_list_get_boolean (self->taglist, "has-crc", &crc))
|
if (gst_tag_list_get_boolean (self->taglist, "has-crc", &crc))
|
||||||
gst_a2dp_sender_sink_set_crc (self->sink, crc);
|
gst_avdtp_sink_set_crc (self->sink, crc);
|
||||||
|
|
||||||
if (gst_tag_list_get_string (self->taglist, "channel-mode", &mode))
|
if (gst_tag_list_get_string (self->taglist, "channel-mode", &mode))
|
||||||
gst_a2dp_sender_sink_set_channel_mode (self->sink, mode);
|
gst_avdtp_sink_set_channel_mode (self->sink, mode);
|
||||||
|
|
||||||
capsfilterpad = gst_ghost_pad_get_target (self->ghostpad);
|
capsfilterpad = gst_ghost_pad_get_target (self->ghostpad);
|
||||||
gst_pad_send_event (capsfilterpad, event);
|
gst_pad_send_event (capsfilterpad, event);
|
||||||
@ -472,11 +469,11 @@ gst_a2dp_sink_init_dynamic_elements (GstA2dpSink * self, GstCaps * caps)
|
|||||||
g_free (mode);
|
g_free (mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_a2dp_sender_sink_set_device_caps (self->sink, caps))
|
if (!gst_avdtp_sink_set_device_caps (self->sink, caps))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_object_set (G_OBJECT (self->rtp), "mtu",
|
g_object_set (G_OBJECT (self->rtp), "mtu",
|
||||||
gst_a2dp_sender_sink_get_link_mtu (self->sink), NULL);
|
gst_avdtp_sink_get_link_mtu (self->sink), NULL);
|
||||||
|
|
||||||
/* we forward our new segment here if we have one */
|
/* we forward our new segment here if we have one */
|
||||||
if (self->newseg_event) {
|
if (self->newseg_event) {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/rtp/gstbasertppayload.h>
|
#include <gst/rtp/gstbasertppayload.h>
|
||||||
#include "gsta2dpsendersink.h"
|
#include "gstavdtpsink.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ struct _GstA2dpSink {
|
|||||||
GstBin bin;
|
GstBin bin;
|
||||||
|
|
||||||
GstBaseRTPPayload *rtp;
|
GstBaseRTPPayload *rtp;
|
||||||
GstA2dpSenderSink *sink;
|
GstAvdtpSink *sink;
|
||||||
GstElement *capsfilter;
|
GstElement *capsfilter;
|
||||||
|
|
||||||
gchar *device;
|
gchar *device;
|
||||||
|
1336
sys/bluez/gstavdtpsink.c
Normal file
1336
sys/bluez/gstavdtpsink.c
Normal file
File diff suppressed because it is too large
Load Diff
101
sys/bluez/gstavdtpsink.h
Normal file
101
sys/bluez/gstavdtpsink.h
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* BlueZ - Bluetooth protocol stack for Linux
|
||||||
|
*
|
||||||
|
* Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GST_AVDTP_SINK_H
|
||||||
|
#define __GST_AVDTP_SINK_H
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include <gst/base/gstbasesink.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GST_TYPE_AVDTP_SINK \
|
||||||
|
(gst_avdtp_sink_get_type())
|
||||||
|
#define GST_AVDTP_SINK(obj) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVDTP_SINK,\
|
||||||
|
GstAvdtpSink))
|
||||||
|
#define GST_AVDTP_SINK_CLASS(klass) \
|
||||||
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVDTP_SINK,\
|
||||||
|
GstAvdtpSinkClass))
|
||||||
|
#define GST_IS_AVDTP_SINK(obj) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVDTP_SINK))
|
||||||
|
#define GST_IS_AVDTP_SINK_CLASS(obj) \
|
||||||
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVDTP_SINK))
|
||||||
|
|
||||||
|
typedef struct _GstAvdtpSink GstAvdtpSink;
|
||||||
|
typedef struct _GstAvdtpSinkClass GstAvdtpSinkClass;
|
||||||
|
|
||||||
|
struct bluetooth_data;
|
||||||
|
|
||||||
|
struct _GstAvdtpSink {
|
||||||
|
GstBaseSink sink;
|
||||||
|
|
||||||
|
gchar *device;
|
||||||
|
GIOChannel *stream;
|
||||||
|
|
||||||
|
struct bluetooth_data *data;
|
||||||
|
GIOChannel *server;
|
||||||
|
|
||||||
|
/* mp3 stream data (outside caps data)*/
|
||||||
|
gboolean mpeg_stream_changed;
|
||||||
|
gint mp3_using_crc;
|
||||||
|
gint channel_mode;
|
||||||
|
|
||||||
|
/* stream connection data */
|
||||||
|
GstCaps *stream_caps;
|
||||||
|
|
||||||
|
GstCaps *dev_caps;
|
||||||
|
|
||||||
|
GMutex *sink_lock;
|
||||||
|
|
||||||
|
guint watch_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GstAvdtpSinkClass {
|
||||||
|
GstBaseSinkClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType gst_avdtp_sink_get_type(void);
|
||||||
|
|
||||||
|
GstCaps *gst_avdtp_sink_get_device_caps(GstAvdtpSink *sink);
|
||||||
|
gboolean gst_avdtp_sink_set_device_caps(GstAvdtpSink *sink,
|
||||||
|
GstCaps *caps);
|
||||||
|
|
||||||
|
guint gst_avdtp_sink_get_link_mtu(GstAvdtpSink *sink);
|
||||||
|
|
||||||
|
void gst_avdtp_sink_set_device(GstAvdtpSink *sink,
|
||||||
|
const gchar* device);
|
||||||
|
|
||||||
|
gchar *gst_avdtp_sink_get_device(GstAvdtpSink *sink);
|
||||||
|
|
||||||
|
gboolean gst_avdtp_sink_plugin_init(GstPlugin *plugin);
|
||||||
|
|
||||||
|
void gst_avdtp_sink_set_crc(GstAvdtpSink *self, gboolean crc);
|
||||||
|
|
||||||
|
void gst_avdtp_sink_set_channel_mode(GstAvdtpSink *self,
|
||||||
|
const gchar *mode);
|
||||||
|
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __GST_AVDTP_SINK_H */
|
Loading…
x
Reference in New Issue
Block a user