示例#1
0
    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)
示例#2
0
    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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
    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)
示例#6
0
文件: codec.py 项目: jamal/Pandamon
    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
示例#7
0
    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)
示例#8
0
    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)