return FALSE;
}
+ rsp->h.length = 0;
io_error = gst_avdtp_sink_audioservice_expect (self,
&rsp->h, BT_GET_CAPABILITIES);
if (io_error != G_IO_ERROR_NONE) {
return FALSE;
}
+ rsp->h.length = sizeof (*rsp);
io_error = gst_avdtp_sink_audioservice_expect (self,
&rsp->h, BT_START_STREAM);
if (io_error != G_IO_ERROR_NONE) {
return FALSE;
}
+ ind->h.length = sizeof (*ind);
io_error = gst_avdtp_sink_audioservice_expect (self, &ind->h, BT_NEW_STREAM);
if (io_error != G_IO_ERROR_NONE) {
GST_ERROR_OBJECT (self, "Error while receiving " "stream filedescriptor");
return FALSE;
}
+ req->h.length += req->codec.length - sizeof (req->codec);
io_error = gst_avdtp_sink_audioservice_send (self, &req->h);
if (io_error != G_IO_ERROR_NONE) {
GST_ERROR_OBJECT (self, "Error ocurred while sending "
return FALSE;
}
+ rsp->h.length = sizeof (*rsp);
io_error = gst_avdtp_sink_audioservice_expect (self,
&rsp->h, BT_SET_CONFIGURATION);
if (io_error != G_IO_ERROR_NONE) {
GIOError error;
gsize written;
const char *type, *name;
+ uint16_t length;
- error = g_io_channel_write (self->server, (const gchar *) msg,
- BT_SUGGESTED_BUFFER_SIZE, &written);
+ length = msg->length ? msg->length : BT_SUGGESTED_BUFFER_SIZE;
+
+ error = g_io_channel_write (self->server, (const gchar *) msg, length,
+ &written);
if (error != G_IO_ERROR_NONE)
GST_ERROR_OBJECT (self, "Error sending data to audio service:"
" %s(%d)", strerror (errno), errno);
GIOError status;
gsize bytes_read;
const char *type, *name;
+ uint16_t length;
+
+ length = inmsg->length ? inmsg->length : BT_SUGGESTED_BUFFER_SIZE;
- status = g_io_channel_read (self->server, (gchar *) inmsg,
- BT_SUGGESTED_BUFFER_SIZE, &bytes_read);
+ status = g_io_channel_read (self->server, (gchar *) inmsg, length,
+ &bytes_read);
if (status != G_IO_ERROR_NONE) {
GST_ERROR_OBJECT (self, "Error receiving data from " "audio service");
return status;