MCPcopy Index your code
hub / github.com/GStreamer/gst-python / MySink

Class MySink

old_examples/sinkelement.py:25–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#
24
25class MySink(gst.Element):
26
27 _sinkpadtemplate = gst.PadTemplate ("sinkpadtemplate",
28 gst.PAD_SINK,
29 gst.PAD_ALWAYS,
30 gst.caps_new_any())
31
32 def __init__(self):
33 gst.Element.__init__(self)
34 gst.info('creating sinkpad')
35 self.sinkpad = gst.Pad(self._sinkpadtemplate, "sink")
36 gst.info('adding sinkpad to self')
37 self.add_pad(self.sinkpad)
38
39 gst.info('setting chain/event functions')
40 self.sinkpad.set_chain_function(self.chainfunc)
41 self.sinkpad.set_event_function(self.eventfunc)
42
43 def chainfunc(self, pad, buffer):
44 self.info("%s timestamp(buffer):%d" % (pad, buffer.timestamp))
45 return gst.FLOW_OK
46
47 def eventfunc(self, pad, event):
48 self.info("%s event:%r" % (pad, event.type))
49 return True
50
51gobject.type_register(MySink)
52

Callers 1

sinkelement.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected