def test_desynch_clock
src = Gst::ElementFactory.make("fakesrc", "source")
id = Gst::ElementFactory.make("identity", "filter")
sink = Gst::ElementFactory.make("fakesink", "sink")
pipeline = Gst::Pipeline.new("pipeline")
src >> id >> sink
pipeline.add(src, id, sink)
assert_instance_of(Gst::Clock, clock = pipeline.clock)
clock.test(self)
assert !clock.active?
assert_equal(clock.time, 0)
debug(clock)
pipeline.play
debug(clock)
assert clock.active?
5.times do |x|
sleep 1
pipeline.iterate
debug(clock)
a, b = (x.succ - 0.1) * Gst::SECOND, (x.succ + 0.1) * Gst::SECOND
assert (clock.time >= a && clock.time <= b)
end
end