Namespace

Included Modules

Class/Module Index [+]

Quicksearch

TestElement

Public Instance Methods

test_clock() click to toggle source
# File gstreamer/test/test_element.rb, line 9
def test_clock
  bin = create_element("playbin")
  assert(bin.require_clock?)
  assert(bin.provide_clock?)
  assert_nil(bin.clock)
end
test_each_pad() click to toggle source
# File gstreamer/test/test_element.rb, line 16
def test_each_pad
  pads = []
  create_element("filesrc").each_pad do |pad|
    pads << pad.name
  end
  assert_equal(["src"], pads)
end
test_query() click to toggle source
# File gstreamer/test/test_element.rb, line 66
def test_query
  pipeline = Gst::Pipeline.new
  assert_boolean(pipeline.query(Gst::QueryFormats.new))
end
test_reference_counting() click to toggle source
# File gstreamer/test/test_element.rb, line 76
def test_reference_counting
  pipeline = Gst::Pipeline.new
  bin = TestBin.new

  10.times do
    pipeline.add(bin)
    pipeline.remove(bin)
  end
end
test_send_event() click to toggle source
# File gstreamer/test/test_element.rb, line 71
def test_send_event
  pipeline = Gst::Pipeline.new
  assert_boolean(pipeline.send_event(Gst::EventEOS.new))
end
test_state() click to toggle source
# File gstreamer/test/test_element.rb, line 24
def test_state
  pipeline = Gst::Pipeline.new
  src = create_element("fakesrc")
  sink = create_element("fakesink")
  pipeline.add(src, sink)

  assert_equal([Gst::STATE_CHANGE_SUCCESS,
                Gst::STATE_NULL,
                Gst::STATE_VOID_PENDING],
               pipeline.get_state)

  pipeline.ready
  assert_equal([Gst::STATE_CHANGE_SUCCESS,
                Gst::STATE_READY,
                Gst::STATE_VOID_PENDING],
               pipeline.get_state)

  pipeline.play
  assert_equal([Gst::STATE_CHANGE_FAILURE,
                Gst::STATE_READY,
                Gst::STATE_PLAYING],
               pipeline.get_state)

  pipeline.pause
  assert_equal([Gst::STATE_CHANGE_ASYNC,
                Gst::STATE_READY,
                Gst::STATE_PAUSED],
               pipeline.get_state(1))

  pipeline.stop
  assert_equal([Gst::STATE_CHANGE_SUCCESS,
                Gst::STATE_NULL,
                Gst::STATE_VOID_PENDING],
               pipeline.get_state)

  pipeline.set_state(:playing)
  assert_equal([Gst::STATE_CHANGE_FAILURE,
                Gst::STATE_READY,
                Gst::STATE_PLAYING],
               pipeline.get_state)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.