#!/usr/bin/env ruby require 'gst' pipeline = Gst::Pipeline.new src = Gst::ElementFactory.make("videotestsrc") identity = Gst::ElementFactory.make("identity") sink = Gst::ElementFactory.make("fakesink") identity.signal_handoffs = true identity.signal_connect("handoff") { | element, buffer | puts "got buffer" } pipeline.add(src, identity, sink) src >> identity >> sink loop = GLib::MainLoop.new(nil, false) 10.times do p pipeline.play puts "Playing" sleep 1 puts "Stopping" pipeline.stop puts "Stopped" end