def __init__(self): gst.Bin.__init__(self) self.src_pad = gst.ghost_pad_new_notarget("src", gst.PAD_SRC) self.add_pad(self.src_pad) self.sink_pad = gst.ghost_pad_new_notarget("sink", gst.PAD_SINK) self.add_pad(self.sink_pad)
def __init__(self, type): gst.Bin.__init__(self) self.type = type if (type & INPUT_TYPE_AUDIO): self.audio_pad = gst.ghost_pad_new_notarget("audio_pad", gst.PAD_SRC) self.add_pad(self.audio_pad) if (type & INPUT_TYPE_VIDEO): self.video_pad = gst.ghost_pad_new_notarget("video_pad", gst.PAD_SRC) self.add_pad(self.video_pad)
def __init__(self, type): gst.Bin.__init__(self) self.type = type if (type & INPUT_TYPE_AUDIO): self.audio_pad = gst.ghost_pad_new_notarget( "audio_pad", gst.PAD_SRC) self.add_pad(self.audio_pad) if (type & INPUT_TYPE_VIDEO): self.video_pad = gst.ghost_pad_new_notarget( "video_pad", gst.PAD_SRC) self.add_pad(self.video_pad)
def __init__(self): gst.Bin.__init__(self) self.typefind = gst.element_factory_make('typefind') self.typefind.connect('have-type', self.have_type) self.add(self.typefind) # sink pad (to receive the audio stream) self.sink = gst.GhostPad('sink', self.typefind.get_pad('sink')) # source pads (to be connected once pipeline is complete) self.audiosrc = gst.ghost_pad_new_notarget('audiosrc', gst.PAD_SRC) self.filesrc = gst.ghost_pad_new_notarget('filesrc', gst.PAD_SRC) # add pads to self for p in (self.sink, self.audiosrc, self.filesrc): self.add_pad(p)
def do_request_new_pad(self, template, name=None): if name == None: name = 'sink_%u' % self.pad_count pad = gst.ghost_pad_new_notarget(name, gst.PAD_SINK) pad.set_active(True) self.add_pad(pad) pad.connect('linked', self._on_pad_linked) self.pads[name] = pad self.pad_count += 1 return pad
def __init__(self): """Sets up src and sink pads plus behaviour.""" super(BasePlaylistElement, self).__init__() self._data = io.BytesIO() self._done = False self.sinkpad = gst.Pad(self.sinkpad_template) self.sinkpad.set_chain_function(self._chain) self.sinkpad.set_event_function(self._event) self.add_pad(self.sinkpad) if self.ghost_srcpad: self.srcpad = gst.ghost_pad_new_notarget('src', gst.PAD_SRC) else: self.srcpad = gst.Pad(self.srcpad_template) self.add_pad(self.srcpad)