def requestKeyframe(self): print "request keyframe" self.pipelines['main'].send_event( GstVideo.video_event_new_upstream_force_key_unit( Gst.CLOCK_TIME_NONE, True, self.cnt)) return True
def send_event(self): self.count = self.count + 1 #if self.count > 2147483640: #self.count = 0 pushed = self.appsink_pad.push_event( GstVideo.video_event_new_upstream_force_key_unit( Gst.CLOCK_TIME_NONE, True, self.count)) print "key unit event sent... {0}".format(pushed)
def blockOnNextKeyframe(self): tp = self.elements["srcQueue"].get_static_pad("sink") # tp = self.elements["queue_preview"].get_static_pad("sink") self.pipelines['main'].send_event(GstVideo.video_event_new_upstream_force_key_unit(Gst.CLOCK_TIME_NONE, True, self.cnt)) tp.add_probe(Gst.PadProbeType.BUFFER, blockActiveQueuePad, self) return True
def blockOnNextKeyframe(self): tp = self.elements["srcQueue"].get_static_pad("sink") # tp = self.elements["queue_preview"].get_static_pad("sink") self.pipelines['main'].send_event( GstVideo.video_event_new_upstream_force_key_unit( Gst.CLOCK_TIME_NONE, True, self.cnt)) tp.add_probe(Gst.PadProbeType.BUFFER, blockActiveQueuePad, self) return True
def blockOnNextKeyframe(self): if self.selfTermination: if self.cnt >= self.selfTermination: self.exitByTimer = True self.window.destroy() tp = self.elements["srcQueue"].get_static_pad("sink") # tp = self.elements["queue_preview"].get_static_pad("sink") self.pipelines['main'].send_event(GstVideo.video_event_new_upstream_force_key_unit(Gst.CLOCK_TIME_NONE, True, self.cnt)) tp.add_probe(Gst.PadProbeType.BUFFER, blockActiveQueuePad, self) self.updateLight() return True
def blockOnNextKeyframe(self): if self.selfTermination: if self.cnt >= self.selfTermination: self.exitByTimer = True self.window.destroy() tp = self.elements["srcQueue"].get_static_pad("sink") # tp = self.elements["queue_preview"].get_static_pad("sink") self.pipelines['main'].send_event(GstVideo.video_event_new_upstream_force_key_unit(Gst.CLOCK_TIME_NONE, True, self.cnt)) tp.add_probe(Gst.PadProbeType.BUFFER, blockActiveQueuePad, self) self.updateLight() return True
def on_file_change(self, bus, msg): if msg.type == Gst.MessageType.ELEMENT: structure = msg.get_structure() #logger.debug("Message received from:%s",msg.src.get_name()) #logger.debug("Structure: %s",structure.to_string()) #GST_LOG("structure is %" GST_PTR_FORMAT,structure) if msg.src.get_name() == "tsdemux": logger.debug("Structure:%s", structure.to_string()) if msg.src.get_name() == "splitmuxsink": logger.debug("Structure:%s", structure.get_name()) if structure.get_name() == "splitmuxsink-fragment-closed": filename = os.path.basename( structure.get_string("location")) #(result,index)=structure.get_int("index") index = 0 (result, running_time) = structure.get_clock_time("running-time") logger.debug(filename + " received. Running-time:" + str(convert_ns(running_time))) self.playlist.append_segment({ "segment_name": self.urlroot + '/' + self.channel + '/' + filename, "seq_num": index }) self.playlist.renderPlaylist() if msg.src.get_name() == "tsparse" and structure.get_name( ) == "sit": section = GstMpegts.message_parse_mpegts_section(msg) if section: spliceinfo = section.get_scte_splice_info() if spliceinfo.splice_command_type == 5: logger.info( "Splice Insert received. EventID:%#5.8x, In/~Out:%s, PCR:%s", spliceinfo.splice_insert.splice_event_id, spliceinfo.splice_insert.out_of_network_indicator, convert_ns(spliceinfo.splice_insert.pts_time, 90000)) force_key_unit_event = GstVideo.video_event_new_upstream_force_key_unit( spliceinfo.splice_insert.pts_time, True, spliceinfo.splice_insert.splice_event_id) result = self.splitmuxsink.get_property( "sink").send_event(force_key_unit_event) logger.info( "GstForceKeyUnit event sent downstream with result:%s.", result)
def send_event(self): self.count = self.count + 1 pushed = self.appsink_pad.push_event(GstVideo.video_event_new_upstream_force_key_unit(Gst.CLOCK_TIME_NONE,True,self.count)) print "key unit event sent... {0}".format(pushed)
def send_event(self): self.count = self.count+1 #if self.count > 2147483640: #self.count = 0 pushed = self.hlssink_pad.push_event(GstVideo.video_event_new_upstream_force_key_unit(Gst.CLOCK_TIME_NONE,True,self.count)) print "pushed... {0}".format(pushed)
def requestKeyframe(self): print "request keyframe" self.pipelines['main'].send_event(GstVideo.video_event_new_upstream_force_key_unit(Gst.CLOCK_TIME_NONE, True, self.cnt)) return True