All of lore.kernel.org
 help / color / mirror / Atom feed
* Gstreamer e DCCP: issues related to ccid-3
@ 2007-10-25  3:47 Łeandro Sales
  2007-10-25 10:17 ` Gerrit Renker
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Łeandro Sales @ 2007-10-25  3:47 UTC (permalink / raw)
  To: dccp

Can you please revise to me the problem that you and the VLC guy had
while was implement DCCP support on VLC?
   I'm implementing the dccp plugin for gstreamer and everything goes
very well, I can transmit an mp3 sound using ccid-2, but when I try to
use ccid-3, I can just send very little via send function and after
the function returns 11 (EAGAIN). Is there any different parameter
that I should set? I think that the problem that you had in VLC should
be the same for me and in this case you help me. I have been working
with Arnaldo on this stuffs but I decided to make it public sharing
this problem to all of you and get some help.
   Basically the functions that I'm using to send are the following:

PS: the second function, gst_dccp_send_buffer, is a call back function
called by gstreamer when it has data to be sent. Thank you.

/* write buffer to given socket incrementally.
 * Returns number of bytes written.
 */
gint
gst_dccp_socket_write (int socket, const void *buf, size_t count)
{
 size_t bytes_written = 0;
 ssize_t wrote;

 while (bytes_written < count) {
   wrote = send (socket, (const char *) buf + bytes_written,
           count - bytes_written, MSG_NOSIGNAL);
   if (wrote <= 0) {
     return bytes_written;
   }
   bytes_written += wrote;
 }

 if (bytes_written < 0)
   GST_WARNING ("error while writing");
 else
   GST_LOG ("wrote %" G_GSIZE_FORMAT " bytes succesfully", bytes_written);
 return bytes_written;
}


/* write a GDP header to the socket.  Return false if fails. */
GstFlowReturn
gst_dccp_send_buffer (GstElement * this, GstBuffer * buffer, int socket)
{
 size_t wrote;

 gint size = 0;
 guint8 *data;

 size = GST_BUFFER_SIZE (buffer);
 data = GST_BUFFER_DATA (buffer);

 GST_LOG_OBJECT (this, "writing %d bytes for GDP buffer header\n", size);
 printf("writing %d bytes for GDP buffer header\n\n", size);
 wrote = gst_dccp_socket_write (socket, data, size);
 //g_free (data);

 if (wrote != size) {
   GST_ELEMENT_ERROR (this, CORE, TOO_LAZY, (NULL),
       ("Error while sending data"));
   printf("Error while sending data\n");
   return GST_FLOW_ERROR;
 }

 return GST_FLOW_OK;
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-11-01  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-25  3:47 Gstreamer e DCCP: issues related to ccid-3 Łeandro Sales
2007-10-25 10:17 ` Gerrit Renker
2007-10-25 10:29 ` Gerrit Renker
2007-10-25 17:14 ` Ian McDonald
2007-11-01  4:13 ` Łeandro Sales
2007-11-01  9:48 ` Gerrit Renker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.