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

Method __init__

old_examples/audioconcat.py:41–70  ·  view source on GitHub ↗
(self, location, caps)

Source from the content-addressed store, hash-verified

39 '''Decodes audio file, outputs at specified caps'''
40
41 def __init__(self, location, caps):
42 gst.Bin.__init__(self)
43
44 # Create elements
45 src = gst.element_factory_make('filesrc')
46 dec = gst.element_factory_make('decodebin')
47 conv = gst.element_factory_make('audioconvert')
48 rsmpl = gst.element_factory_make('audioresample')
49 ident = gst.element_factory_make('identity')
50
51 # Set 'location' property on filesrc
52 src.set_property('location', location)
53
54 # Connect handler for 'new-decoded-pad' signal
55 dec.connect('new-decoded-pad', self.__on_new_decoded_pad)
56
57 # Add elements to bin
58 self.add(src, dec, conv, rsmpl, ident)
59
60 # Link *some* elements
61 # This is completed in self.__on_new_decoded_pad()
62 src.link(dec)
63 conv.link(rsmpl)
64 rsmpl.link(ident, caps)
65
66 # Reference used in self.__on_new_decoded_pad()
67 self.__apad = conv.get_pad('sink')
68
69 # Add ghost pad
70 self.add_pad(gst.GhostPad('src', ident.get_pad('src')))
71
72
73 def __on_new_decoded_pad(self, element, pad, last):

Callers

nothing calls this directly

Calls 3

set_propertyMethod · 0.80
addMethod · 0.80
linkMethod · 0.80

Tested by

no test coverage detected