Exemplo n.º 1
0
 def __init__(self, min_queue_time=10):
     BaseMediaEngine.__init__(self, min_queue_time)
     self.queue = dict(byte=0,
                       sec=0)  #Initialized playout buffer at 0B and 0s
     self.pushed_segments = []
     self.current_time = 0
     self.min_queue_time = min_queue_time
Exemplo n.º 2
0
    def start(self):
        BaseMediaEngine.start(self)
        #
        q = 0 #int(self.min_queue_time*1e9)   #min-threshold-time
        v_sink = 'fakesink sync=true'
        if self.getVideoContainer() == 'MP4':
            demux = self.DEMUX_MP4
            parse = self.PARSE_H264
        elif self.getVideoContainer() == 'MPEGTS':
            demux = self.DEMUX_MPEGTS
            parse = self.PARSE_H264
        elif self.getVideoContainer() == 'WEBM':
            demux = self.DEMUX_WEBM
            parse = self.PARSE_WEBM
        else:
            debug(0, '%s Cannot play: video/%s', self, self.getVideoContainer())
            return
        debug(DEBUG, '%s Playing type: video/%s', self, self.getVideoContainer())

        if self.decode_video:
            if not self.getVideoContainer() == 'WEBM':
                v_sink = self.DEC_VIDEO_H264
            else:
                v_sink = self.DEC_VIDEO_VP8
            desc = self.PIPELINE %(demux) + self.VIDEO_DEC %(parse, q, v_sink)
        else:
            desc = self.PIPELINE %(demux) + self.VIDEO_NODEC %(q, v_sink)
        debug(DEBUG, '%s pipeline: %s', self, desc)
        self.pipeline = gst.parse_launch(desc)
        self.queue = self.pipeline.get_by_name('queue_v')
        self.status = self.PAUSED
        self.pipeline.set_state(gst.STATE_PAUSED)
        self.onRunning()
Exemplo n.º 3
0
    def start(self):
        BaseMediaEngine.start(self)
        #
        q = 0 #int(self.min_queue_time*1e9)   #min-threshold-time
        v_sink = 'fakesink sync=true'
        if self.getVideoContainer() == 'MP4':
            demux = self.DEMUX_MP4
            parse = self.PARSE_H264
        elif self.getVideoContainer() == 'MPEGTS':
            demux = self.DEMUX_MPEGTS
            parse = self.PARSE_H264
        elif self.getVideoContainer() == 'WEBM':
            demux = self.DEMUX_WEBM
            parse = self.PARSE_WEBM
        else:
            debug(0, '%s Cannot play: video/%s', self, self.getVideoContainer())
            return
        debug(DEBUG, '%s Playing type: video/%s', self, self.getVideoContainer())

        if self.decode_video:
            if not self.getVideoContainer() == 'WEBM':
                v_sink = self.DEC_VIDEO_H264
            else:
                v_sink = self.DEC_VIDEO_VP8
            desc = self.PIPELINE %(demux) + self.VIDEO_DEC %(parse, q, v_sink)
        else:
            desc = self.PIPELINE %(demux) + self.VIDEO_NODEC %(q, v_sink)
        debug(DEBUG, '%s pipeline: %s', self, desc)
        self.pipeline = gst.parse_launch(desc)
        self.queue = self.pipeline.get_by_name('queue_v')
        self.status = self.PAUSED
        self.pipeline.set_state(gst.STATE_PAUSED)
        self.onRunning()
Exemplo n.º 4
0
 def stop(self):
     BaseMediaEngine.stop(self)
Exemplo n.º 5
0
 def start(self):
     BaseMediaEngine.start(self)
     self.fakePlay(-1)
Exemplo n.º 6
0
 def __init__(self, min_queue_time=10):
     BaseMediaEngine.__init__(self, min_queue_time)
     self.queue =  dict(byte=0, sec=0)  #Initialized playout buffer at 0B and 0s
     self.pushed_segments = []
     self.current_time = 0
     self.min_queue_time = min_queue_time
Exemplo n.º 7
0
 def __init__(self, decode_video=True, min_queue_time=10):
     BaseMediaEngine.__init__(self, min_queue_time)
     self.decode_video = decode_video
     self.pipeline = None
Exemplo n.º 8
0
 def stop(self):
     BaseMediaEngine.stop(self)
     #
     if self.pipeline:
         self.pipeline.set_state(gst.STATE_PAUSED)
         self.pipeline = None
Exemplo n.º 9
0
 def stop(self):
     BaseMediaEngine.stop(self)
Exemplo n.º 10
0
 def start(self):
     BaseMediaEngine.start(self)
     self.fakePlay(-1)
Exemplo n.º 11
0
 def __init__(self, decode_video=True, min_queue_time=10):
     BaseMediaEngine.__init__(self, min_queue_time)
     self.decode_video = decode_video
     self.pipeline = None
Exemplo n.º 12
0
 def stop(self):
     BaseMediaEngine.stop(self)
     #
     if self.pipeline:
         self.pipeline.set_state(gst.STATE_PAUSED)
         self.pipeline = None