示例#1
0
 def on_pipeline_start(self):
     '''
     Called when the stream starts
     '''
     # We may have blocked pads. This will unblock them, assuming the  is running.
     if self.source.get_state() in [Gst.State.PLAYING, Gst.State.PAUSED]:
         unblock_pad(self, 'intervideosrc_src_pad')
         unblock_pad(self, 'interaudiosrc_src_pad')
示例#2
0
文件: connection.py 项目: whhxf/brave
 def unblock_intersrc_if_ready(self):
     '''
     The intervideosrc and interaudiosrc elements are the bits of the destination that receive the input.
     They will be blocked when first created, as they can fail if the input is not yet sending content.
     This method unblocks them.
     '''
     if (self.dest.get_state() in [Gst.State.PLAYING, Gst.State.PAUSED]) and \
        (self.source.get_state() in [Gst.State.PLAYING, Gst.State.PAUSED]) and \
        self._elements_are_created():
         for audio_or_video in ['audio', 'video']:
             pad = self._get_intersrc_src_pad(audio_or_video)
             if pad:
                 unblock_pad(pad)
示例#3
0
    def on_pipeline_start(self):
        '''
        Called when the stream starts
        '''
        # Tell each output to unblock its intervideosrc as content is now coming through
        for name, output in self.session().outputs.items():
            if output.get_state() in [Gst.State.PLAYING, Gst.State.PAUSED]:
                unblock_pad(output, 'intervideosrc_src_pad')
                unblock_pad(output, 'interaudiosrc_src_pad')

        # Likewise, tell each input
        for source in self.sources:
            source.unblock_intersrc_if_ready()