[gst-devel] gstrtpbin and langage C or ruby
Guillaume Dorchies
guillaume.dorchies at gmail.com
Mon Sep 1 23:48:38 CEST 2008
Hello
I try to create a little rtp server with gstreamer in C or in ruby.
Where can I find a translation of this line "gst-launch-0.10 -v gstrtpbin
name=rtpbin \
filesrc location="/data/file.mp3" ! mad ! audioconvert ! rtpL16pay !
rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink port=5000 "
in C or in ruby.
I wrote this code in ruby
def create_pipeline_hard
# Create a pipeline to hold the elements
pipeline = Gst::Pipeline.new("my_pipeline")
filesrc=Gst::ElementFactory.make("filesrc","filesrc")
filesrc.location=FILE_ONE
mad=Gst::ElementFactory.make("mad")
audioconvert=Gst::ElementFactory.make("audioconvert")
pay=Gst::ElementFactory.make("rtpL16pay")
@rtpbin=Gst::ElementFactory.make('gstrtpbin','rtpbin')
puts @rtpbin.public_methods.inspect
udpsink=Gst::ElementFactory.make('udpsink')
pipeline.add( filesrc, mad, audioconvert, pay, @rtpbin, udpsink)
@rtpbin.signal_connect("pad-added") do | source, pad |
puts "in pad-added #{pad.name}"
if pad.name.include?('send_rtp_src')
pad.link(udpsink.get_pad('sink'))
end
end
filesrc >> mad >> audioconvert >> pay #Link the pads
# send_rtp_sink=@rtpbin.get_request_pad('send_rtp_sink_%d')
send_rtp_sink=@rtpbin.get_request_pad('send_rtp_sink_0')
pay.get_pad('src').link(send_rtp_sink)
return pipeline
end
the pipeline work but it don't send music
Thanks a lot
Guillaume
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080901/97f60de2/attachment.htm>
More information about the gstreamer-devel
mailing list