MCPcopy Create free account
hub / github.com/GStreamer/gst-python / probe_cb

Function probe_cb

examples/dynamic_src.py:36–52  ·  view source on GitHub ↗
(pad, info, pdata)

Source from the content-addressed store, hash-verified

34 src.set_state(Gst.State.NULL)
35
36def probe_cb(pad, info, pdata):
37 peer = pad.get_peer()
38 pad.unlink(peer)
39 pdata.pipe.remove(pdata.src)
40 # Can't set the state of the src to NULL from its streaming thread
41 GLib.idle_add(dispose_src_cb, pdata.src)
42
43 pdata.src = Gst.ElementFactory.make('videotestsrc')
44 pdata.src.props.pattern = random.randint(0, 24)
45 pdata.pipe.add(pdata.src)
46 srcpad = pdata.src.get_static_pad ("src")
47 srcpad.link(peer)
48 pdata.src.sync_state_with_parent()
49
50 GLib.timeout_add_seconds(1, timeout_cb, pdata)
51
52 return Gst.PadProbeReturn.REMOVE
53
54def timeout_cb(pdata):
55 srcpad = pdata.src.get_static_pad('src')

Callers

nothing calls this directly

Calls 3

makeMethod · 0.80
addMethod · 0.80
linkMethod · 0.80

Tested by

no test coverage detected