Exemplo n.º 1
0
    def stop_recording_video(self):
        if not self._has_camera:
            return

        # We stop the pipeline while we are adjusting the pipeline to stop
        # recording because if we do it on-the-fly, the following video live
        # feed to the screen becomes several seconds delayed. Weird!
        # FIXME: retest on F11
        # FIXME: could this be the result of audio shortening problems?
        self._eos_cb = self._video_eos
        self._pipeline.get_by_name('camsrc').send_event(gst.event_new_eos())
        self._audiobin.get_by_name('absrc').send_event(gst.event_new_eos())
Exemplo n.º 2
0
	def stop(self):
		if self.running == "true":
			self.running = "false"
		print "Send EnOffStream(EOS) to source element"
		try:
			if self.source.send_event(gst.event_new_eos()):
				print "EOS event sucessfully send"
			else:
				print "EOS event NOT send, try to send it to pipeline"
				self.pipeline.send_event(gst.event_new_eos())
		except NameError:
			print "Error: Pipeline: source not specified"
Exemplo n.º 3
0
    def chain(self, pad, buf):
        ret = self.srcpad.push(buf)
        if ret == gst.FLOW_OK:
            self.info("pushed, doing EOS")
            self.srcpad.push_event(gst.event_new_eos())

        return ret
 def record (self, start):
   if start == 1:
     print ("Start screencast record")
     self.element.set_state (gst.STATE_PLAYING)
   else:
     print ("stop screencast record")
     self.element.send_event (gst.event_new_eos ())
Exemplo n.º 5
0
	def on_message (self, bus, message):

		if message.type == gst.MESSAGE_EOS:
			self.player.seek_simple (gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, self.startpos)
			self.player.set_state (gst.STATE_READY)
			self.updatelabelduration.emit ("00:00.000 / %s" % self.dur_str)
			self.updatesliderseek.emit (self.seekmin)

		elif message.type == gst.MESSAGE_ERROR:
			self.player.seek_simple (gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, self.startpos)
			self.player.set_state (gst.STATE_READY)
			self.updatelabelduration.emit ("00:00.000 / %s" % self.dur_str)
			self.updatesliderseek.emit (self.seekmin)
			err, debug = message.parse_error()
			print 'Error: %s' % err, debug

		elif message.type == gst.MESSAGE_STATE_CHANGED:
			if not message.src == self.player:
				return
			old, new, pending = message.parse_state_changed()
			if self.loop and old == gst.STATE_READY and new == gst.STATE_PAUSED:
				self.seek (self.startpos, self.stoppos)

			self.state = new
			if new == gst.STATE_PLAYING:
				self.updatethreadtimer.setInterval (30)
				self.setbuttonpause.emit()
			else:
				self.updatethreadtimer.setInterval (200)
				self.setbuttonplay.emit()

		elif message.type == gst.MESSAGE_SEGMENT_DONE:
			src = self.player.get_property ("source")
			pad = src.get_pad ('src')
			pad.push_event (gst.event_new_eos())
Exemplo n.º 6
0
    def swap_element(klass, swap_bin, previous_element, next_element,
        old_element, new_element):

        previous_pad = previous_element.get_static_pad("src")

        #FIXME: Use the async method to work for paused state

        previous_pad.set_blocked(True)
        previous_element.unlink(old_element)

        #make sure data is flushed out of element2:

        old_pad = old_element.get_static_pad("src")
        handler_id = old_pad.add_event_probe(event_received)
        old_element.send_event(gst.event_new_eos())
        old_pad.remove_event_probe(handler_id)

        previous_element.unlink(old_element)
        old_element.unlink(next_element)
        old_element.set_state(gst.STATE_NULL)
        swap_bin.remove(old_element)
        swap_bin.add(new_element)
        new_element.link(next_element)
        previous_element.link(new_element)
        new_element.set_state(gst.STATE_PLAYING)
        previous_pad.set_blocked(False)
        swap_bin.set_state(gst.STATE_PLAYING)
        return
Exemplo n.º 7
0
 def button_press_event(self, widget, event):
     if event.button == 1:
         if self.playing == False:
             self.win.fullscreen()
             self.playing = True
             starting = time.time()
             self.start = []
             self.start.append(starting)
             self.player.set_state(gst.STATE_PLAYING)
             self.file_times = open(self.timesfilename, 'w')
         elif self.playing == True:
             if self.current_page + 1 < self.n_pages:
                 self.starting_time = self.start[0]
                 right_now = time.time()
                 time_interval = str(int((right_now - self.starting_time)*1000))
                 self.file_times.write(time_interval + "\n")
                 self.current_page += 1
                 self.page_selector = self.document.get_page(self.current_page)
                 self.area.set_size_request(int(self.width),int(self.height))
                 self.area.queue_draw()
             elif self.current_page + 1 == self.n_pages:
                 self.starting_time = self.start[0]
                 right_now = time.time()
                 time_interval = str(int((right_now - self.starting_time)*1000))
                 self.file_times.write(time_interval + "\n")
                 self.file_times.close()
                 self.win.unfullscreen()
                 #~ self.win.resize(1,1)
                 time.sleep(0.5) # add half a second to avoid problems with iRaccoonShow
                 self.player.send_event(gst.event_new_eos())
                 self.current_page =+ 1
Exemplo n.º 8
0
 def _error_func(self):
     
     # No need to reinitialize more than once
     if self._pipe.get_state(timeout=50*gst.MSECOND)[1] == gst.STATE_NULL:
         return
     
     self.stop()
     self._pipe.set_state(gst.STATE_NULL)
     self._pipe.set_property('audio-sink', None)
     
     # The mainbin is still connected to the old element, need to
     # disconnect it and flush it.
     self._mainbin.unparent()
     
     # Only flush the element if necessary
     if self._mainbin.get_state(timeout=50*gst.MSECOND)[1] != gst.STATE_NULL:
     
         # flush it
         sinkpad = self._mainbin.get_static_pad('sink')
         self._err_probe_id = sinkpad.add_event_probe(self._error_func_flush)
         
         sinkpad.send_event(gst.event_new_eos())
         
     else:
         self._reinitialize()
Exemplo n.º 9
0
    def chain(self, pad, buf):
        ret = self.srcpad.push(buf)
        if ret == gst.FLOW_OK:
            self.info("pushed, doing EOS")
            self.srcpad.push_event(gst.event_new_eos())

        return ret
Exemplo n.º 10
0
    def _error_func(self):

        # No need to reinitialize more than once
        if self._pipe.get_state(timeout=50 * gst.MSECOND)[1] == gst.STATE_NULL:
            return

        self.stop()
        self._pipe.set_state(gst.STATE_NULL)
        self._pipe.set_property('audio-sink', None)

        # The mainbin is still connected to the old element, need to
        # disconnect it and flush it.
        self._mainbin.unparent()

        # Only flush the element if necessary
        if self._mainbin.get_state(timeout=50 *
                                   gst.MSECOND)[1] != gst.STATE_NULL:

            # flush it
            sinkpad = self._mainbin.get_static_pad('sink')
            self._err_probe_id = sinkpad.add_event_probe(
                self._error_func_flush)

            sinkpad.send_event(gst.event_new_eos())

        else:
            self._reinitialize()
Exemplo n.º 11
0
 def stop(self):
     self.valve.set_property("drop", True)
     self.sink.send_event(gst.event_new_eos())
     self.sink.set_state(gst.STATE_NULL)
     self.wavenc.unlink(self.filesink)
     self.sink.remove(self.filesink)
     self.recording = False
Exemplo n.º 12
0
    def swap_element(klass, swap_bin, previous_element, next_element,
                     old_element, new_element):

        previous_pad = previous_element.get_static_pad("src")

        #FIXME: Use the async method to work for paused state

        previous_pad.set_blocked(True)
        previous_element.unlink(old_element)

        #make sure data is flushed out of element2:

        old_pad = old_element.get_static_pad("src")
        handler_id = old_pad.add_event_probe(event_received)
        old_element.send_event(gst.event_new_eos())
        old_pad.remove_event_probe(handler_id)

        previous_element.unlink(old_element)
        old_element.unlink(next_element)
        old_element.set_state(gst.STATE_NULL)
        swap_bin.remove(old_element)
        swap_bin.add(new_element)
        new_element.link(next_element)
        previous_element.link(new_element)
        new_element.set_state(gst.STATE_PLAYING)
        previous_pad.set_blocked(False)
        swap_bin.set_state(gst.STATE_PLAYING)
        return
Exemplo n.º 13
0
    def _our_task(self, something):
        if self._buffer == None:
            self.warning("We were started without a buffer, exiting")
            self.srcpad.pause_task()
            return

        #this is where we repeatedly output our buffer
        self.debug("self:%r, something:%r" % (self, something))

        self.debug("needsegment: %r" % self._needsegment)
        if self._needsegment:
            self.debug("Need to output a new segment")
            segment = gst.event_new_new_segment(False, self._segment.rate,
                                                self._segment.format,
                                                self._segment.start,
                                                self._segment.stop,
                                                self._segment.start)
            self.srcpad.push_event(segment)
            # calculate offset
            # offset is int(segment.start / outputrate)
            self._offset = int(self._segment.start * self._outputrate.num /
                               self._outputrate.denom / gst.SECOND)
            self._needsegment = False
            self.debug("Newsegment event pushed")

        # new position
        position = self._offset * gst.SECOND * self._outputrate.denom / self._outputrate.num
        if self._segment.stop != -1 and position > self._segment.stop:
            self.debug(
                "end of configured segment (position:%s / segment_stop:%s)" %
                (gst.TIME_ARGS(position), gst.TIME_ARGS(self._segment.stop)))
            # end of stream/segment handling
            if self._segment.flags & gst.SEEK_FLAG_SEGMENT:
                # emit a gst.MESSAGE_SEGMENT_DONE
                self.post_message(
                    gst.message_new_segment_done(self, gst.FORMAT_TIME,
                                                 self._segment.stop))
            else:
                self.srcpad.push_event(gst.event_new_eos())
            self.last_return = gst.FLOW_WRONG_STATE
            self.srcpad.pause_task()

        # we need to update the caps here !
        obuf = self._buffer.make_metadata_writable()
        ok, nstart, nstop = self._segment.clip(gst.FORMAT_TIME, position,
                                               position + self._bufferduration)
        if ok:
            obuf.timestamp = nstart
            obuf.duration = nstop - nstart
            obuf.caps = self._srccaps
            self.debug("Pushing out buffer %s" % gst.TIME_ARGS(obuf.timestamp))
            self.last_return = self.srcpad.push(obuf)
        self._offset += 1

        if self.last_return != gst.FLOW_OK:
            self.debug("Pausing ourself, last_return : %s" %
                       gst.flow_get_name(self.last_return))
            self.srcpad.pause_task()
Exemplo n.º 14
0
    def stop(self):
        """
            Stop this queue entry from processing.
        """
        if hasattr(self, "transcoder") and self.transcoder.pipe:
            self.transcoder.pipe.send_event(gst.event_new_eos())
            self.transcoder.start()

            self.force_stopped = True
Exemplo n.º 15
0
 def stop(self):
     """
         Stop this queue entry from processing.
     """
     if hasattr(self, "transcoder") and self.transcoder.pipe:
         self.transcoder.pipe.send_event(gst.event_new_eos())
         self.transcoder.start()
         
         self.force_stopped = True
Exemplo n.º 16
0
 def on_message(bus, message, eos_cb, err_cb):
     t = message.type
     if t == gst.MESSAGE_EOS:
         print "EOS"
         eos_cb()
     elif t == gst.MESSAGE_ERROR:
         err, debug = message.parse_error()
         print "error=", err
         print "debug=", debug
         pipeline.send_event(gst.event_new_eos())
Exemplo n.º 17
0
    def on_message(bus, message, eos_cb, err_cb):
        t = message.type
	if t == gst.MESSAGE_EOS:
            print "EOS"
            eos_cb()
	elif t == gst.MESSAGE_ERROR:
            err, debug = message.parse_error()
            print "error=", err
            print "debug=", debug
            pipeline.send_event(gst.event_new_eos())
Exemplo n.º 18
0
    def _our_task(self, something):
        if self._buffer == None:
            self.warning("We were started without a buffer, exiting")
            self.srcpad.pause_task()
            return

        #this is where we repeatedly output our buffer
        self.debug("self:%r, something:%r" % (self, something))

        self.debug("needsegment: %r" % self._needsegment)
        if self._needsegment:
            self.debug("Need to output a new segment")
            segment = gst.event_new_new_segment(False,
                                                self._segment.rate,
                                                self._segment.format,
                                                self._segment.start,
                                                self._segment.stop,
                                                self._segment.start)
            self.srcpad.push_event(segment)
            # calculate offset
            # offset is int(segment.start / outputrate)
            self._offset = int(self._segment.start * self._outputrate.num / self._outputrate.denom / gst.SECOND)
            self._needsegment = False
            self.debug("Newsegment event pushed")

        # new position
        position = self._offset * gst.SECOND * self._outputrate.denom / self._outputrate.num
        if self._segment.stop != -1 and position > self._segment.stop:
            self.debug("end of configured segment (position:%s / segment_stop:%s)" % (gst.TIME_ARGS(position),
                                                                                     gst.TIME_ARGS(self._segment.stop)))
            # end of stream/segment handling
            if self._segment.flags & gst.SEEK_FLAG_SEGMENT:
                # emit a gst.MESSAGE_SEGMENT_DONE
                self.post_message(gst.message_new_segment_done(self, gst.FORMAT_TIME, self._segment.stop))
            else:
                self.srcpad.push_event(gst.event_new_eos())
            self.last_return = gst.FLOW_WRONG_STATE
            self.srcpad.pause_task()

        # we need to update the caps here !
        obuf = self._buffer.make_metadata_writable()
        ok, nstart, nstop = self._segment.clip(gst.FORMAT_TIME,
                                               position, position + self._bufferduration)
        if ok:
            obuf.timestamp = nstart
            obuf.duration = nstop - nstart
            obuf.caps = self._srccaps
            self.debug("Pushing out buffer %s" % gst.TIME_ARGS(obuf.timestamp))
            self.last_return = self.srcpad.push(obuf)
        self._offset += 1

        if self.last_return != gst.FLOW_OK:
            self.debug("Pausing ourself, last_return : %s" % gst.flow_get_name(self.last_return))
            self.srcpad.pause_task()
Exemplo n.º 19
0
 def _monitor_for_stop(self, track, stop_offset):
     
     if track == self.current and self.get_position() >= stop_offset * gst.SECOND and self.is_playing():
         
         # send eos to pipe
         self._pipe.send_event(gst.event_new_eos())
     
         self._stop_id = None
         return False
     
     return True
Exemplo n.º 20
0
 def _clear_old_sink(self, old_audio_sink):
     
     # push EOS into the element, which will be fired once all the
     # data has left the sink
       
     sinkpad = old_audio_sink.get_static_pad('sink')
     self._pad_event_probe_id = sinkpad.add_event_probe(self._event_probe_cb, old_audio_sink)
     
     sinkpad.send_event(gst.event_new_eos())
     
     return False
Exemplo n.º 21
0
	def shutdown():
		# This should work:
		#pipeline.send_event(gst.event_new_eos())
		# But because the gstreamer EOS stuff seems to be FUBAR,
		# force the EOS to all pads
		# TODO: THIS DOESN'T SEEM TO ALWAYS PROVIDE A CLEAN
		#	SHUTDOWN
		for element in pipeline.recurse():
			for pad in element.pads():
				if pad.get_property("direction") != gst.PAD_SINK:
					continue
				pad.send_event(gst.event_new_eos())
Exemplo n.º 22
0
def clean_shutdown(p):
    camsrc = p.get_by_name("camsrc")
    xsrc = p.get_by_name("xsrc")
    asrc = p.get_by_name("asrc")
    eos = gst.event_new_eos()

    camsrc.send_event(eos)
    xsrc.send_event(eos)
    asrc.send_event(eos)

    bus = p.get_bus()
    bus.poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, -1)
Exemplo n.º 23
0
    def _clear_old_sink(self, old_audio_sink):

        # push EOS into the element, which will be fired once all the
        # data has left the sink

        sinkpad = old_audio_sink.get_static_pad('sink')
        self._pad_event_probe_id = sinkpad.add_event_probe(
            self._event_probe_cb, old_audio_sink)

        sinkpad.send_event(gst.event_new_eos())

        return False
    def eventfunc(self, pad, event):
        if event.type == gst.EVENT_FLUSH_START or\
            event.type == gst.EVENT_FLUSH_STOP:
            return False

        elif event.type == gst.EVENT_EOS:
            if pad == self.video_sinkpad:
                self.video_srcpad.push_event(gst.event_new_eos())
            else:
                self.audio_srcpad.push_event(gst.event_new_eos())
            return False

        elif event.type != gst.EVENT_NEWSEGMENT:
            return True

        # New Segment
        update, r, t, start, stop, position = event.parse_new_segment()
        if not self._file_start:
            # This is the first new segment, we use it to get the start time of
            # the file.
            self._file_start = start
            return False
        # if it's not a segment update, it's because it's a new segment comming
        # after the seek
        if not update:
            # A new segment is starting now after the seek has been
            # done, so update the values of the current segment to clip the
            # incomming buffers with the values of the next segment
            self._cur_segment[pad] = self._next_segment
            self.info("Start of new segment on %s pad %r" %
                      (pad.get_name(), self._cur_segment[pad]))
            if pad == self.video_sinkpad:
                self._video_waiting_new_segment = False
            else:
                self._audio_waiting_new_segment = False

        return False
Exemplo n.º 25
0
    def __on_bus_message(self, bus, message):
        if message.type == gst.MESSAGE_ERROR:
            error, debug = message.parse_error()
            self.stop() # this seems neccessary here
            self.emit("error", (error, debug))

        elif message.type == gst.MESSAGE_NEW_CLOCK:
            # we connect the timeout handler here
            # to be sure that further queries succeed
            interval = int((self.__stop_position - self.__start_position) / \
                (2 * gst.SECOND) + 50)
            self.__timeout_id = gobject.timeout_add(interval,
                self.__on_timeout)

        elif message.type == gst.MESSAGE_STATE_CHANGED:
            old_state, new_state, pending = message.parse_state_changed()
            if (old_state == gst.STATE_READY and
                new_state == gst.STATE_PAUSED and
                message.src == self.__playbin):
                self.__seek(self.__start_pos, self.__stop_pos, True)

        elif message.type == gst.MESSAGE_SEGMENT_DONE:
            if self.__loop:
                self.__seek(self.__start_pos, self.__stop_pos, False)
            else:
                src = self.__playbin.get_property("source")
                pad = src.get_pad('src')
                pad.push_event(gst.event_new_eos())

                # this is the good old way:
                #
                # pads = src.src_pads()
                # while True:
                #       try:
                #               pad = pads.next()
                #               pad.push_event(gst.event_new_eos())
                #       except:
                #               break

        elif message.type == gst.MESSAGE_EOS:
            self.stop()

        return True
Exemplo n.º 26
0
    def __on_bus_message(self, bus, message):
        if message.type == gst.MESSAGE_ERROR:
            error, debug = message.parse_error()
            self.stop()  # this seems neccessary here
            self.emit("error", (error, debug))

        elif message.type == gst.MESSAGE_NEW_CLOCK:
            # we connect the timeout handler here
            # to be sure that further queries succeed
            interval = int((self.__stop_position - self.__start_position) / \
                (2 * gst.SECOND) + 50)
            self.__timeout_id = gobject.timeout_add(interval,
                                                    self.__on_timeout)

        elif message.type == gst.MESSAGE_STATE_CHANGED:
            old_state, new_state, pending = message.parse_state_changed()
            if (old_state == gst.STATE_READY and new_state == gst.STATE_PAUSED
                    and message.src == self.__playbin):
                self.__seek(self.__start_pos, self.__stop_pos, True)

        elif message.type == gst.MESSAGE_SEGMENT_DONE:
            if self.__loop:
                self.__seek(self.__start_pos, self.__stop_pos, False)
            else:
                src = self.__playbin.get_property("source")
                pad = src.get_pad('src')
                pad.push_event(gst.event_new_eos())

                # this is the good old way:
                #
                # pads = src.src_pads()
                # while True:
                #       try:
                #               pad = pads.next()
                #               pad.push_event(gst.event_new_eos())
                #       except:
                #               break

        elif message.type == gst.MESSAGE_EOS:
            self.stop()

        return True
Exemplo n.º 27
0
    def on_message(self, bus, message):

        if message.type == gst.MESSAGE_EOS:
            self.player.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH,
                                    self.startpos)
            self.player.set_state(gst.STATE_READY)
            self.updatelabelduration.emit("00:00.000 / %s" % self.dur_str)
            self.updatesliderseek.emit(self.seekmin)

        elif message.type == gst.MESSAGE_ERROR:
            self.player.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH,
                                    self.startpos)
            self.player.set_state(gst.STATE_READY)
            self.updatelabelduration.emit("00:00.000 / %s" % self.dur_str)
            self.updatesliderseek.emit(self.seekmin)
            err, debug = message.parse_error()
            print 'Error: %s' % err, debug

        elif message.type == gst.MESSAGE_STATE_CHANGED:
            if not message.src == self.player:
                return
            old, new, pending = message.parse_state_changed()
            if self.loop and old == gst.STATE_READY and new == gst.STATE_PAUSED:
                self.seek(self.startpos, self.stoppos)

            self.state = new
            if new == gst.STATE_PLAYING:
                self.updatethreadtimer.setInterval(30)
                self.setbuttonpause.emit()
            else:
                self.updatethreadtimer.setInterval(200)
                self.setbuttonplay.emit()

        elif message.type == gst.MESSAGE_SEGMENT_DONE:
            src = self.player.get_property("source")
            pad = src.get_pad('src')
            pad.push_event(gst.event_new_eos())
Exemplo n.º 28
0
 def _on_eater_blocked(self, pad, blocked):
     self._on_pad_blocked(pad, blocked)
     if blocked:
         peer = pad.get_peer()
         peer.send_event(gst.event_new_eos())
Exemplo n.º 29
0
 def stop_listening( self ):
     """Stop listening"""
     if self._pipeline:
         self._pipeline.set_state(gst.STATE_NULL)
         self._pipeline.send_event( gst.event_new_eos() )
         self._pipeline = None
Exemplo n.º 30
0
 def _on_eater_blocked(self, pad, blocked):
     self._on_pad_blocked(pad, blocked)
     if blocked:
         peer = pad.get_peer()
         peer.send_event(gst.event_new_eos())
Exemplo n.º 31
0
 def teardown(self):
     if self.pipeline:
         self.pipeline.send_event(gst.event_new_eos())
         self.pipeline.set_state(gst.STATE_NULL)
Exemplo n.º 32
0
    def teardown(self):
        if self._pipeline:
#            self._pipeline.remove(self._sourceBin)
#            self._pipeline.remove(self._sinkBin)
            self._pipeline.send_event(gst.event_new_eos())
            self._pipeline.set_state(gst.STATE_NULL)
Exemplo n.º 33
0
 def stop_loop(self):
     self.pipeline.send_event(gst.event_new_eos())
     self.pipeline.set_state(gst.STATE_NULL)
     self.loop.quit()
Exemplo n.º 34
0
 def terminate(self):
     self.terminating = True
     self.el_feed.send_event(gst.event_new_eos())
Exemplo n.º 35
0
 def dec_handoff_out(self, element, buffer):
     self.output_buffers += 1
     if self.output_buffers < self.num_buffers:
         return
     self.pipeline.send_event(gst.event_new_eos())
Exemplo n.º 36
0
	def dec_handoff_out(self, element, buffer):
		self.output_buffers += 1
		if self.output_buffers < self.num_buffers:
			return
		self.pipeline.send_event(gst.event_new_eos())
Exemplo n.º 37
0
 def teardown(self):
     if self._pipeline:
         #            self._pipeline.remove(self._sourceBin)
         #            self._pipeline.remove(self._sinkBin)
         self._pipeline.send_event(gst.event_new_eos())
         self._pipeline.set_state(gst.STATE_NULL)
Exemplo n.º 38
0
 def send_eos(self, *args):
     logger.info("Sending EOS")
     event = gst.event_new_eos()
     gst.Element.send_event(self.pipeline, event)
Exemplo n.º 39
0
 def teardown(self):
     if self.pipeline:
         self.pipeline.send_event(gst.event_new_eos())
         self.pipeline.set_state(gst.STATE_NULL)
Exemplo n.º 40
0
 def stop(self):
     self.src.send_event(gst.event_new_eos())
Exemplo n.º 41
0
 def stop(self):
     self.source.send_event(gst.event_new_eos())        
Exemplo n.º 42
0
 def doControlledShutdown(self):
     logInfo("doing regular controlled shutdown")
     #self.pipeline.send_event(gst.event_new_eos())
     for pad in self.muxer.sink_pads():
         threads.deferToThread(pad.send_event, gst.event_new_eos())
Exemplo n.º 43
0
 def stop_listening(self):
     """Stop listening"""
     if self._pipeline:
         self._pipeline.set_state(gst.STATE_NULL)
         self._pipeline.send_event(gst.event_new_eos())
         self._pipeline = None
Exemplo n.º 44
0
 def EOS(self):
     self.pipeline.send_event(gst.event_new_eos())
Exemplo n.º 45
0
 def teardown(self):
     if self._videoSrc:
         self._videoSrc.send_event(gst.event_new_eos())
         self._videoSrc.set_state(gst.STATE_NULL)
         self._videoSrc = None
Exemplo n.º 46
0
 def teardown(self):
     if self._videoSrc:
         self._videoSrc.send_event(gst.event_new_eos())
         self._videoSrc.set_state(gst.STATE_NULL)
         self._videoSrc = None