gstrtpbin and langage C or ruby

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

gstrtpbin and langage C or ruby

Guillaume Dorchies
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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel