[Nice] nicesrc outbuf overwritten before read

Youness Alaoui youness.alaoui at collabora.co.uk
Tue Jun 21 15:05:58 PDT 2011


I hope I can help you with your issue, but I'm not sure exactly what's going on.
First of all, you want to do VoIP using gstreamer? then why not use farsight
directly ?
the set_relay_info should not affect in any way the bug you are describing so I
don't think/see how it's related.
Also, the code does not loop internally, so when the read_callback is called,
and g_main_loop_quit is called within it, then the mainloop should quit and the
callback should not be called twice.
Can you add debug messages in the read_callback and before+after the
g_main_loop_run and get me proof that that's what's happening?
Also maybe assign NULL to outbuf after its pointer is copied into *buffer, and
print the value of outbuf in the read_callback to make sure that it is actually
NULL all the time.
Also, what is the exact behavior you're getting, so I know why you've looked
into this.. was it that some data is lost ? If it is, then maybe data was lost
and you thought that it was overwritten by nicesrc but it actually never
arrived, don't forget that libnice uses UDP, so it's not reliable. If you want a
reliable socket, use nice_agent_new_reliable.
Let me know if you did your tests with reliable mode or not.


On 06/21/2011 10:30 AM, Daniel Lindström wrote:
> Hi
> I have some problem and was hoping I could get some help from this
> mailing list. I'm trying to send video from A to B with libnice and
> gstreamer. The scenario not working for me is when A and B are on the
> same computer, so the host candidates are used. If I do not set the
> relay server (nice_agent_set_relay_info) everything works fine and it
> uses the host candidate. If I do set the relay server it still uses
> the host candidate as intended, but something goes wrong between
> libnice and nicesrc, or nicesrc and rtpjpegpayload in the gstreamer
> pipeline.
> What happends seems to be the following scenario:
> gst_nice_src_create is called and it calls g_main_loop_run to wait for a buffer
> gst_nice_src_read_callback is called from libnice with a buffer which
> is saved to the outbuf of the nicesrc. When done it calls
> g_main_loop_quit.
> Now I would expect gst_nice_src_create to continue the execution, but
> instead gst_nice_src_read_callback is called again and the allocated
> outbuf is overwritten.
> For some reason it also works if the frame is small enough to fit in
> one MTU (by coding it really small or raising the MTU on rtpjpegpay)..
> However, I don't think there is any problem in the payload packitizer
> / depackitizer since the fact that it does not matter if I use any
> other kind of payload, and it does work if I do net set the relay
> information.
> Can it be that I have misunderstood how some component should be used,
> or is there a bug somewhere? I'm thankful for all help.
> Regards,
> - Daniel
> _______________________________________________
> Nice mailing list
> Nice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nice

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/nice/attachments/20110621/12d7248a/attachment.pgp>

More information about the Nice mailing list