I am writing client code which receives audio+video.
When I am trying to connect rtpbin and depayloader how to know which session is this? Actually,I am writing the code in C and am trying to use g_signal_connect.
So that I can use g_signal_connect (rtpbin, "pad-added", G_CALLBACK (pad_added_cb), videodepay); g_signal_connect
(rtpbin, "pad-added", G_CALLBACK (pad_added_cb), audiodepay); and the pad_added_cb handler is:
my client pipeline is: VIDEO_DEC="rtph264depay ! ffdec_h264" AUDIO_DEC="rtpmp4gdepay ! faad" VIDEO_SINK="ffmpegcolorspace ! autovideosink"
AUDIO_SINK="autoaudiosink" DEST=127.0.0.1 LATENCY=100 gst-launch -v gstrtpbin name=rtpbin \ udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \ udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \ rtpbin.send_rtcp_src_0 ! udpsink port=5005 host=$DEST sync=false async=false
udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_1 \ rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \ udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \
rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=$DEST sync=false async=false Same thing as above pipeline in C language I am writing. Please reply. If you know other way please do let me know.
Thaks in advance.
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Well, I had the same problem, because I am working on softphone with
video- and audio support. I am not sure If there is an "intelligent" solution for this problem, but I checked the payload-type, which is given in this line: > g_print ("new payload on pad: %s\n", GST_PAD_NAME (new_pad)); If its payloadtype 0 then I connect the rtpbin with the audio-depay and if its 96 I connect it to the video-depay. In my case the rtpbin is defined as a pointer in a global structure, therefore I can decide in the callback which depayloader should be used. Do want to realize undirectional or bidirectional streaming? Andreas Am 01.08.2011 06:15, schrieb arpi d: > I am writing client code which receives audio+video. > > When I am trying to connect rtpbin and depayloader how to know which > session is this? > > Actually,I am writing the code in C and am trying to use g_signal_connect. > So that I can use > g_signal_connect (rtpbin, "pad-added", G_CALLBACK (pad_added_cb), > videodepay); > > g_signal_connect (rtpbin, "pad-added", G_CALLBACK (pad_added_cb), > audiodepay); > > and the pad_added_cb handler is: > > |/* will be called when rtpbin has validated a payload that we can depayload */ > |static void > > |pad_added_cb (GstElement * rtpbin, GstPad * new_pad, GstElement * depay) > { > GstPad *sinkpad; > GstPadLinkReturn lres; > > g_print ("new payload on pad: %s\n", GST_PAD_NAME (new_pad)); > > sinkpad = gst_element_get_static_pad (depay,"sink"); > g_assert (sinkpad); > > lres = gst_pad_link (new_pad, sinkpad); > g_assert (lres == GST_PAD_LINK_OK); > gst_object_unref (sinkpad); > }| > > > my client pipeline is: > > VIDEO_DEC="rtph264depay ! ffdec_h264" > AUDIO_DEC="rtpmp4gdepay ! faad" > > VIDEO_SINK="ffmpegcolorspace ! autovideosink" > AUDIO_SINK="autoaudiosink" > DEST=127.0.0.1 > > LATENCY=100 > > gst-launch -v gstrtpbin name=rtpbin \ > udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \ > rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \ > udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \ > rtpbin.send_rtcp_src_0 ! udpsink port=5005 host=$DEST sync=false > async=false > udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_1 \ > rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \ > udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ > rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=$DEST sync=false async=false > Same thing as above pipeline in C language I am writing. > Please reply. > If you know other way please do let me know. > Thaks in advance. > > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks for your reply.
Do you have any idea how I can pass 2 types of Depayloader in callback function using one g_signal_connect method from my main function where rtpbin,videodepayloader and audiodepayloader all are local? Please reply if you know any way. Thanks in advance. |
First you should check, how many parameters you can give in the
data-field of g_signal_connect (http://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect). If its only possible to pass one argument, you can try to make an array with the two pointers to the depayloaders. Its just an idea and I'm not sure if its working. Am 02.08.2011 07:51, schrieb gstreader: > Thanks for your reply. > Do you have any idea how I can pass 2 types of Depayloader in callback > function using one g_signal_connect method from my main function where > rtpbin,videodepayloader and audiodepayloader all are local? > > > Please reply if you know any way. > Thanks in advance. > > > > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-use-g-signal-connect-to-connect-gstrtpbin-with-depayloader-in-both-case-Audio-Video-together-tp3708868p3711414.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel -- ------------------------------------------------------------ Andreas Büttner [gesendet vom Handy] _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Andy_Milestone
Thanks its working.I have used the recv_rtp_src_m (where m is the session identifier) and used the same function GST_PAD_NAME (new_pad) to get this name. passed the depayloaders in an array in g_signal_connect.We can do other way also checking the caps from pad and from there we can search payload type or media type .
On Mon, Aug 1, 2011 at 12:53 AM, Andy_Milestone <[hidden email]> wrote: Well, I had the same problem, because I am working on softphone with video- and audio support. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |