rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
while not self.vobuReadReturn: if self.pendingCmds == []: cmds = self.collectCmds() else: cmds = self.pendingCmds self.pendingCmds = [] if cmds == []:
for cmd in self.mainItr: gst.log("Running command %s" % str(cmd)) cmd(self) if self.vobuReadReturn:
def vobuRead(self, src): """Invoked by the source element after reading a complete VOBU.""" gst.log("Vobu read")
while cmds: gst.log("Running command %s" % str(cmds[0])) cmds[0](self) cmds[0:1] = [] if self.vobuReadReturn: self.pendingCmds = cmds break
def vobuRead(self, src): """Invoked by the source element after reading a complete VOBU.""" gst.log("Vobu read")
print "Offset: ", nav.getFirstAudioOffset(self.audio + 1)
def vobuHeader(self, src, buf): """The signal handler for the source's vobu-header signal.""" gst.log("Vobu header")
cmds[0:0] = [self.__class__.flush, self.__class__.resendSubpictureClut] self.pendingCmds = cmds
for cmd in reversed(cmds): self.mainItr.push(cmd) self.mainItr.push(self.__class__.flush)
def interactiveWrapper(count): """Call the iterator and send an `EndInteractive` operation at the end.""" yield itersched.Call(itr)
for handler in self.syncHandlers: ret = handler(*args) if ret != None: return ret
try: for handler in self.syncHandlers: ret = handler(*args) if ret != None: return ret except: gst.warning('Handler raised exception')
def syncHandler(self, *args): for handler in self.syncHandlers: ret = handler(*args) if ret != None: return ret return gst.BUS_PASS
yield tasklet.WaitForSignal(self.pipeline, 'eos')
yield tasklet.WaitForSignal(self.pipeline, 'state-paused')
def stop(self): """Stop the player. This operation is asynchronous. The 'stopped' signal will be emitted when the player is actually stopped.""" if self.pipeline.getState() != gst.STATE_PLAYING: # Restart the pipeline to guarantee that the EOS event can # actually reach the sinks. self.pipeline.setState(gst.STATE_PLAYI...
self.flushing = True
def flush(self): """Flush the pipeline.""" gst.debug("flush") # Reset the highlight state. self.area = None self.button = None self.palette = None
if cellNr >= self.programChain.cellCount:
if (self.cell.blockMode == \ dvdread.CELL_BLOCK_MODE_ANGLE_FIRST or \ self.cell.blockMode == \ dvdread.CELL_BLOCK_MODE_ANGLE_MIDDLE): cellNr += 1 nextMode = self.programChain.getCell(cellNr).blockMode while nextMode != dvdread.CELL_BLOCK_MODE_ANGLE_LAST: cellNr += 1 nextMode = self.programChain.getCell(cellNr).blockM...
def linkCell(self, cellNr, sectorNr=None): """Link to the specified cell.
if (self.cell.blockMode == \ dvdread.CELL_BLOCK_MODE_ANGLE_FIRST or \ self.cell.blockMode == \ dvdread.CELL_BLOCK_MODE_ANGLE_MIDDLE): nextCellNr = cellNr + 1 nextMode = self.programChain.getCell(nextCellNr).blockMode while nextMode == dvdread.CELL_BLOCK_MODE_ANGLE_MIDDLE or \ nextMode == dvdread.CELL_BLOCK_MODE_ANGLE...
yield Chain(self.linkCell(cellNr))
def linkCell(self, cellNr, sectorNr=None): """Link to the specified cell.
playerObj = player.DVDPlayer(options)
try: playerObj = player.DVDPlayer(options) except IOError, e: main_msg = _("Cannot open DVD in path '%s'") % options.location dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, message_format=main_msg) sec_msg = _("Your DVD drive could not be found. You may try to " "use the --device command...
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage(_('Usage: %prog [options]')) optParser.set_description(_("Seamless: A DVD player based on GStreamer")) optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help=_("start ...
main()
sys.exit(main())
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage(_('Usage: %prog [options]')) optParser.set_description(_("Seamless: A DVD player based on GStreamer")) optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help=_("start ...
'segmentStop', 'ev')
'segmentStop')
def wrapper(self, *args, **keywords): self.lock.acquire() try: method(self, *args, **keywords) finally: self.lock.release()
self.ev = []
def __init__(self, machine, pipeline): self.machine = machine self.pipeline = pipeline
self.ev.append(event)
def sendEvent(self, event): """Send `event` down the pipeline.""" self.ev.append(event) self.srcPad.push_event(event)
physical = -1
logical = 0
def updateSubpicture(self): """Send a subpicture event corresponding to the current logical subpicture stream.""" programChain = self.currentProgramChain() if programChain == None: physical = -1 elif isinstance(programChain.container, dvdread.LangUnit): # We are in the menu domain. The physical subpicture is # always 0...
physical = 0
logical = 1
def updateSubpicture(self): """Send a subpicture event corresponding to the current logical subpicture stream.""" programChain = self.currentProgramChain() if programChain == None: physical = -1 elif isinstance(programChain.container, dvdread.LangUnit): # We are in the menu domain. The physical subpicture is # always 0...
streams = programChain. \ getSubpicturePhysStreams((self.subpicture \ & 0x1f) + 1) if streams == None: physical = -1
if self.getAttributeContainer(programChain). \ videoAttributes.aspectRatio == dvdread.ASPECT_RATIO_4_3: physical = streams[dvdread.SUBPICTURE_PHYS_TYPE_4_3]
def updateSubpicture(self): """Send a subpicture event corresponding to the current logical subpicture stream.""" programChain = self.currentProgramChain() if programChain == None: physical = -1 elif isinstance(programChain.container, dvdread.LangUnit): # We are in the menu domain. The physical subpicture is # always 0...
if self.getAttributeContainer(programChain). \ videoAttributes.aspectRatio == dvdread.ASPECT_RATIO_4_3: physical = streams[dvdread.SUBPICTURE_PHYS_TYPE_4_3]
if self.aspectRatio == dvdread.ASPECT_RATIO_16_9: physical = streams[dvdread. \ SUBPICTURE_PHYS_TYPE_WIDESCREEN]
def updateSubpicture(self): """Send a subpicture event corresponding to the current logical subpicture stream.""" programChain = self.currentProgramChain() if programChain == None: physical = -1 elif isinstance(programChain.container, dvdread.LangUnit): # We are in the menu domain. The physical subpicture is # always 0...
if self.aspectRatio == dvdread.ASPECT_RATIO_16_9: physical = streams[dvdread. \ SUBPICTURE_PHYS_TYPE_WIDESCREEN] else: physical = streams[dvdread. \ SUBPICTURE_PHYS_TYPE_LETTERBOX]
physical = streams[dvdread. \ SUBPICTURE_PHYS_TYPE_LETTERBOX]
def updateSubpicture(self): """Send a subpicture event corresponding to the current logical subpicture stream.""" programChain = self.currentProgramChain() if programChain == None: physical = -1 elif isinstance(programChain.container, dvdread.LangUnit): # We are in the menu domain. The physical subpicture is # always 0...
try: if self.pendingCmds == []: cmds = self.collectCmds() else: cmds = self.pendingCmds self.pendingCmds = [] if cmds == []: self.src.set_eos() self.sendEvent(events.eos()) return for cmd in cmds: cmd(self) except: traceback.print_exc() sys.exit(1)
while src.get_property('vobu-start') == -1: try: if self.pendingCmds == []: cmds = self.collectCmds() else: cmds = self.pendingCmds self.pendingCmds = [] if cmds == []: self.sendEvent(events.eos()) return for cmd in cmds: cmd(self) except: traceback.print_exc() sys.exit(1)
def vobuRead(self, src): """Invoked by the source element after reading a complete VOBU."""
audioDecoder = ''
videoDecoder = ''
def __init__(self, options, name="player"): Thread.__init__(self, name)
queue name=video
seamless-queue name=video
def __init__(self, options, name="player"): Thread.__init__(self, name)
queue name=subtitle
seamless-queue name=subtitle
def __init__(self, options, name="player"): Thread.__init__(self, name)
queue name=audio max-size-buffers=50
seamless-queue name=audio max-size-buffers=50
def __init__(self, options, name="player"): Thread.__init__(self, name)
audioDecoder = 'a52dec name=%s !' % sinkName
audioDecoder = 'a52dec name=%s ! audioconvert ! audioscale !' \ % sinkName
def __init__(self, options, name="player"): Thread.__init__(self, name)
audioconvert ! audioscale !
def __init__(self, options, name="player"): Thread.__init__(self, name)
optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer")
optParser.set_usage(_('Usage: %prog [options]')) optParser.set_description(_("Seamless: A DVD player based on GStreamer"))
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="start in full screen mode")
help=_("start in full screen mode"))
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="set path to DVD device to PATH",
help=_("set path to DVD device to PATH"),
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="enable lirc remote control support")
help=_("enable lirc remote control support"))
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="Set player's region to REGION. Possible "
help=_("Set player's region to REGION. Possible "
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
"cruise ships, etc.)",
"cruise ships, etc.)"),
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="audio sink is SINK",
help=_("audio sink is SINK"),
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="Instead of decoding audio in software, "
help=_("Instead of decoding audio in software, "
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
"configured in your machine")
"configured in your machine"))
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="video sink is SINK",
help=_("video sink is SINK"),
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
help="set pixel aspect ratio to ASPECT (default 1/1)",
help=_("set pixel aspect ratio to ASPECT " "(default 1/1)"),
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
optParser.error("invalid argument(s): %s" % string.join(args, ' '))
optParser.error(_("invalid argument(s): %s") % string.join(args, ' '))
def main(): progName = os.path.basename(sys.argv[0]) # Parse the commandline. optParser = OptionParser() optParser.set_usage('Usage: %prog [options]') optParser.set_description("Seamless: A DVD player based on GStreamer") optParser.add_option("--fullscreen", dest="fullScreen", action="store_true", help="start in full ...
self.sendEvent(events.flush_start()) self.sendEvent(events.flush_stop())
def flush(self): """Flush the pipeline.""" self.sendEvent(events.flush_start()) self.sendEvent(events.flush_stop())
self.makeSubelem('audioconvert')
self.makeSubelem('audioconvert', 'audioconvert1') self.makeSubelem('audioresample', 'audioresample1') self.makeSubelem('dvdlpcmdec') self.makeSubelem('audioconvert', 'audioconvert2') self.makeSubelem('audioresample', 'audioresample2') self.makeSubelem('capsaggreg')
def __init__(self, options, name='audiodec'):
self.link('a52dec', 'audioconvert') self.link('audioconvert', 'queue')
self.linkPads('capsselect', 'src%d', 'a52dec', 'sink') self.link('a52dec', 'audioconvert1') self.link('audioconvert1', 'audioresample1') self.linkPads('audioresample1', 'src', 'capsaggreg', 'sink%d') self.linkPads('capsselect', 'src%d', 'dvdlpcmdec', 'sink') self.link('dvdlpcmdec', 'audioconvert2') self.link('audiocon...
def __init__(self, options, name='audiodec'):
self.ghostify('a52dec', 'sink')
self.ghostify('capsselect', 'sink')
def __init__(self, options, name='audiodec'):
self.makeSubelem('capsselect')
def __init__(self, options, name='audiodec'):
self.makeSubelem('audioconvert')
self.makeSubelem('audioconvert', 'audioconvert1')
def __init__(self, options, name='audiodec'):
self.linkPads('capsselect', 'src%d', 'ac3iec958', 'sink')
def __init__(self, options, name='audiodec'):
self.link('capsfilter1', 'audioconvert') self.link('audioconvert', 'capsfilter2') self.link('capsfilter2', 'queue')
self.link('capsfilter1', 'audioconvert1') self.link('audioconvert1', 'capsfilter2') self.linkPads('capsfilter2', 'src', 'capsaggreg', 'sink%d') self.linkPads('capsselect', 'src%d', 'dvdlpcmdec', 'sink') self.link('dvdlpcmdec', 'audioconvert2') self.link('audioconvert2', 'audioresample2') self.linkPads('audioresample2'...
def __init__(self, options, name='audiodec'):
self.ghostify('ac3iec958', 'sink')
self.ghostify('capsselect', 'sink')
def __init__(self, options, name='audiodec'):
if self.audio != -1: if not self.audioShutdown and \ (nav.getFirstAudioOffset(self.audio + 1) == 0x0000 or
if not self.audioShutdown and \ (self.audio == -1 or \ nav.getFirstAudioOffset(self.audio + 1) == 0x0000 or
def vobuHeader(self, src, buf): """The signal handler for the source's vobu-header signal.""" gst.log("Vobu header")
self.shutdownAudio() elif self.audioShutdown and \ nav.getFirstAudioOffset(self.audio + 1) != 0x0000 and \ nav.getFirstAudioOffset(self.audio + 1) != 0x3fff: self.restartAudio() else: print "Beware!"
self.shutdownAudio() elif self.audioShutdown and \ self.audio != -1 and \ nav.getFirstAudioOffset(self.audio + 1) != 0x0000 and \ nav.getFirstAudioOffset(self.audio + 1) != 0x3fff: self.restartAudio()
def vobuHeader(self, src, buf): """The signal handler for the source's vobu-header signal.""" gst.log("Vobu header")
self.makeSubelem(options['audioSink'], 'audiosink')
self.makeParsedSubelem(options['audioSink'], 'audiosink')
def __init__(self, options, name='audiodec'): super(SoftwareAudio, self).__init__(name)
self.makeSubelem(options['videoSink'], 'videosink', force_aspect_ratio=True, pixel_aspect_ratio=options['pixelAspect'])
self.makeParsedSubelem(options['videoSink'], 'videosink', force_aspect_ratio=True, pixel_aspect_ratio=options['pixelAspect'])
def __init__(self, options, name='videodec'): super(SoftwareVideo, self).__init__(name)
self.__gobject_init__()
super(VideoWidget, self).__init__() self.set_double_buffered(False) self.set_app_paintable(True)
def __init__(self): self.__gobject_init__()
self.set_visible_window(False) self.set_above_child(True)
def __init__(self): self.__gobject_init__()
self.connect('size-allocate', self.sizeAllocateCb)
def __init__(self): self.__gobject_init__()
self.background = gtk.DrawingArea() self.background.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black')) self.add(self.background) self.background.show() self.background.connect('realize', self.backgroundRealizeCb) self.videoWin = None
self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black'))
def __init__(self): self.__gobject_init__()
self.overlay.set_xwindow_id(self.videoWin.xid)
self.overlay.set_xwindow_id(self.window.xid)
def prepareWindowCb(self, bus, message): if not message.structure.has_name('prepare-xwindow-id'): return None
def sizeAllocateCb(self, widget, allocation): if not self.videoWin: return self.xlock.acquire() self.videoWin.move_resize(0, 0, allocation.width, allocation.height) self.xlock.release()
def prepareWindowCb(self, bus, message): if not message.structure.has_name('prepare-xwindow-id'): return None
def backgroundRealizeCb(self, widget): self.videoWin = gtk.gdk.Window( self.background.window, self.allocation.width, self.allocation.height, gtk.gdk.WINDOW_CHILD, gtk.gdk.EXPOSURE_MASK, gtk.gdk.INPUT_OUTPUT, "", 0, 0) self.videoWin.add_filter(self.videoEventFilterCb) self.videoWin.show()
def realizeCb(self, widget):
def backgroundRealizeCb(self, widget): # Create the video window. self.videoWin = gtk.gdk.Window( self.background.window, self.allocation.width, self.allocation.height, gtk.gdk.WINDOW_CHILD, gtk.gdk.EXPOSURE_MASK, gtk.gdk.INPUT_OUTPUT, "", 0, 0)
def videoEventFilterCb(self, event): self.xlock.acquire() self.overlay.expose() self.xlock.release() return gtk.gdk.FILTER_CONTINUE
def backgroundRealizeCb(self, widget): # Create the video window. self.videoWin = gtk.gdk.Window( self.background.window, self.allocation.width, self.allocation.height, gtk.gdk.WINDOW_CHILD, gtk.gdk.EXPOSURE_MASK, gtk.gdk.INPUT_OUTPUT, "", 0, 0)
self.makeSubelem('queue', max_size_buffers=0, max_size_bytes=0,
self.makeSubelem('queue', max_size_buffers=0, max_size_bytes=192000,
def __init__(self, options, name='audiodec'):
yield Call(self.machine.callFirstPlay(cmd[4], 0))
yield Call(self.machine.callFirstPlay(cmd[4]))
def perform3(self, cmd): if not self.openCondition(cmd): return
yield Call(self.machine.callTitleMenu(cmd[4], 0))
yield Call(self.machine.callTitleMenu(cmd[4]))
def perform3(self, cmd): if not self.openCondition(cmd): return
self.makeSubelem('queue')
self.makeSubelem('queue', max_size_buffers=0, max_size_bytes=0, max_size_time=gst.SECOND)
def __init__(self, options, name='audiodec'):
max_size_bytes=1024 * 1024 * 32)
max_size_buffers=0, max_size_bytes=0, max_size_time=gst.SECOND)
def __init__(self, options, name='videodec'):
'flushing')
'flushing', 'showingStill')
def push(self, value): """Push back 'value' into the iterator""" self.pushedBack.append(value)
dvdblocksrc name=dvdblocksrc !
dvdblocksrc name=dvdblocksrc location=%s !
def __init__(self, options, name="player"): Thread.__init__(self, name)
""" % videoDecoder)
""" % (options.location, videoDecoder))
def __init__(self, options, name="player"): Thread.__init__(self, name)
assert 1 <= cellNr <= self.programChain.cellCount self.cell = self.programChain.getCell(cellNr) self.machine.clearNavState() yield Call(CellPlayer(self.machine).playCell(self.cell, sectorNr)) if self.cell.commandNr != 0: yield Call(CommandBlockPlayer(self.machine). \ playBlock(self.programChain.cellCommands, se...
if 1 <= cellNr <= self.programChain.cellCount: self.cell = self.programChain.getCell(cellNr) self.machine.clearNavState() yield Call(CellPlayer(self.machine).playCell(self.cell, sectorNr)) if self.cell.commandNr != 0: yield Call(CommandBlockPlayer(self.machine). \ playBlock(self.programChain.cellCommands, self.c...
def linkCell(self, cellNr, sectorNr=None): """Link to the specified cell.
'interactive']
'interactive', 'cellCurrentTime']
def ISO639ToStr(iso639): return chr(iso639 >> 8) + chr(iso639 & 0xff)
time = self.cell.startSeconds if self.nav != None: time += self.nav.cellElapsedTime.seconds return time
return self.cell.startSeconds + self.cellCurrentTime
def getCurrentTime(self): if self.programChain == None: raise PlayerException, \ 'No program chain currently playing'
print 'Current time: %d' % self.location.currentTime
def timeJumpRelative(self, seconds): print 'Current time: %d' % self.location.currentTime self.timeJump(self.location.currentTime + seconds)
'clock')
'syncHandlers')
def padAdded(self, dvddemux, pad): print "+++ New dvddemux pad:", pad.get_name()
if __name__ == '__main__': p = Pipeline({'location': '/dev/hdd'}) p.set_state(gst.STATE_PLAYING) gobject.MainLoop().run() if __name__ == '__main__': p = Pipeline({'location': '/dev/hdd'}) p.set_state(gst.STATE_PLAYING) gobject.MainLoop().run()
def waitForStop(self): """Wait for the pipeline to actually stop. If waiting time is too long, just force a stop.""" maxIter = 40 while maxIter > 0 and self.get_state() == gst.STATE_PLAYING: time.sleep(0.1) maxIter -= 1
'pipeline': player.shell.pipeline, 'machine': player.shell.machine})
'info': player.info, 'machine': player.machine, 'pipeline': player.pipeline, 'manager': player.manager})
def debugConsole(player): """Start a debug Python console in the controlling terminal. The program execution is suspended during the execution of the console. Once the console terminates the program continues executing normally.""" code.interact('Seamless debug console', None, {'player': player, 'pipeline': player.she...
self.connect('realize', self.realizeCb)
self.connect('map-event', self.mapCb)
def __init__(self): super(VideoWidget, self).__init__()
def realizeCb(self, widget):
def mapCb(self, widget, event):
def realizeCb(self, widget): # Start the cursor task. self.cursorTask = tasklet.run(self.updateCursor())
ret = handler(args)
ret = handler(*args)
def syncHandler(self, *args): for handler in self.syncHandlers: ret = handler(args) if ret != None: return ret return gst.BUS_PASS
self.pipeline.set_state(gst.STATE_PAUSED) self.pipeline.get_state(gst.CLOCK_TIME_NONE)
origState = self.pipeline.get_state(gst.CLOCK_TIME_NONE)[1] if origState == gst.STATE_PLAYING: self.pipeline.set_state(gst.STATE_PAUSED) self.pipeline.get_state(gst.CLOCK_TIME_NONE)
def flush(self): """Flush the pipeline.""" gst.debug("flushing") # Don't allow interactive operations until the flush # completes. self.flushing = True
self.pipeline.get_bus().add_watch(self.flushMsgHandler) self.pipeline.set_state(gst.STATE_PLAYING)
if origState == gst.STATE_PLAYING: self.pipeline.get_bus().add_watch(self.flushMsgHandler) self.pipeline.set_state(gst.STATE_PLAYING) else: self.pipeline.closeFlush() self.flushing = False gst.debug("flush completed")
def flush(self): """Flush the pipeline.""" gst.debug("flushing") # Don't allow interactive operations until the flush # completes. self.flushing = True
self.link('mpeg2dec', 'ffmpegcolorspace')
self.linkPads('mpeg2dec', 'src', 'mpeg2subt', 'video') self.link('mpeg2subt', 'ffmpegcolorspace')
def __init__(self, options, name='videodec'):
self.backPlayer.link_pads('subtitle', self.videoSink, 'subtitle')
def __init__(self, options, name="dvdplayer"): super(Pipeline, self).__init__(name)
def resendSubpictureClut(self): """Resend the subpicture color lookup table down the pipeline. This is needed after a flush.""" gst.debug("resend subpicture CLUT") if self.clut != None: self.sendEvent(events.subpictureClut(self.clut))
def resendSubpictureClut(self): """Resend the subpicture color lookup table down the pipeline.
self.mainItr.push(self.__class__.resendSubpictureClut)
def flush(self): """Flush the pipeline.""" gst.debug("flush") # Reset the highlight state. self.area = None self.button = None self.palette = None
audioDecoder = 'a52dec name=%s ! audioconvert ! audioscale !' \ % sinkName
audioDecoder = 'seamless-a52dec name=%s ! audioconvert ! ' \ 'audioscale !' % sinkName
def __init__(self, options, name="player"): gst.Thread.__init__(self, name)
if os.fork() == 0:
pid = os.fork() if pid == 0:
def timeout(self): # Do any significant work in other process. if os.fork() == 0: # Redirect standard output to /dev/null to prevent # xscreensaver-command from cluterring the output. descr = os.open('/dev/null', os.O_WRONLY) os.dup2(descr, 1) try: os.execlp('xscreensaver-command', 'xscreensaver-command', '-deactivate...
setattr(self, func.__name__, action)
setattr(uiManager, func.__name__, action)
def __init__(self, uiManager, name=None): if name == None: name = self.__class__.__name__
setattr(self, name, action)
setattr(uiManager, name, action)
def __init__(self, uiManager, name=None): if name == None: name = self.__class__.__name__
dummyUi = "dummy UI manager"
class DummyUi: pass dummyUi = DummyUi()
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
a = ag.quit
a = dummyUi.quit
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
a = ag.special
a = dummyUi.special
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
a = ag.flipflop
a = dummyUi.flipflop
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
a = ag.yin
a = dummyUi.yin
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
a2 = ag.yan
a2 = dummyUi.yan
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
def quit(ui, action):
def quit2(ui, action):
def quit(ui, action): global obj, cb, aa obj = ui cb = 'ui_quit2' aa = action
uim.actionGroup1.quit.activate()
uim.quit.activate()
def quit(ui, action): global obj, cb, aa obj = ui cb = 'ui_quit2' aa = action
assert aa == uim.actionGroup1.quit
assert aa == uim.quit
def quit(ui, action): global obj, cb, aa obj = ui cb = 'ui_quit2' aa = action
startTime, endTime, 0)
startTime, endTime, startTime)
def newsegment(update, startTime, endTime): """Create and return a newsegment event for the specified start and end times. Times are specified in nanoseconds.""" return gst.event_new_new_segment(update, 1.0, gst.FORMAT_TIME, startTime, endTime, 0)
'flushing')
'flushing', 'showingStill', 'stillCancelCond')
def push(self, value): """Push back 'value' into the iterator""" self.pushedBack.append(value)
it to play silence for the specified number of seconds.""" gst.debug("still frame: %d" % seconds)
it to play silence for the specified number of seconds. Warning: This method temporarily releases the object's lock""" gst.debug("still frame: %s" % str(seconds))
def stillFrame(self, seconds): """Tell the pipeline that a still frame was sent, and direct it to play silence for the specified number of seconds.""" gst.debug("still frame: %d" % seconds)
self.sendEvent(events.newsegment(True, self.segmentStart, self.segmentStop + seconds * gst.SECOND)) blockSize = gst.SECOND / self.SILENCE_BLOCKS_PER_SECOND for i in xrange(seconds * self.SILENCE_BLOCKS_PER_SECOND):
if seconds != None: self.sendEvent(events.newsegment(True, self.segmentStart, self.segmentStop + seconds * gst.SECOND)) remainingBlocks = seconds * self.SILENCE_BLOCKS_PER_SECOND else: remainingBlocks = None blockDuration = gst.SECOND / self.SILENCE_BLOCKS_PER_SECOND self.showingStill = True while remainingBlocks...
def stillFrame(self, seconds): """Tell the pipeline that a still frame was sent, and direct it to play silence for the specified number of seconds.""" gst.debug("still frame: %d" % seconds)