Пример #1
0
    def __init__(self):
        Player.__init__(self)
        self._gst = None
        self.streaminfo = {}

        # create gst object
        self._gst = gst.element_factory_make("playbin", "player")
        self._gst.get_bus().add_watch(self._gst_message)
        self._timer = kaa.WeakTimer(self._get_position)
Пример #2
0
    def __init__(self, osd_shmkey):
        Player.__init__(self)

        self._xine = xine.Xine()
        self._vfilter = FilterChain(self._xine)
        self._stream = self._vo = self._ao = None
        self._osd_shmkey = int(osd_shmkey)
        self._osd_shmem = None
        self._driver_control = None

        self._window_size = 0, 0
        self._window_aspect = -1
        self._status = kaa.WeakTimer(self._status_output)
        self._status_last = None
        self._vo_settings = None
        self._stream_settings = {
            'pixel-aspect': 1.0,
            'scale'       : SCALE_KEEP,
            'zoom'        : 100
        }
        
        self._xine.set_config_value("effects.goom.fps", 20)
        self._xine.set_config_value("effects.goom.width", 512)
        self._xine.set_config_value("effects.goom.height", 384)
        self._xine.set_config_value("effects.goom.csc_method", "Slow but looks better")
        # self._xine.set_config_value("video.device.xv_autopaint_colorkey", True)

        # Config options for multi-threaded decoding with ffmpeg; the first
        # is needed in order for thread_count to take effect.
        try:
            self._xine.set_config_value('video.processing.ffmpeg_choose_speed_over_accuracy', True)
            try:
                cpus = kaa.utils.get_num_cpus()
                self._xine.set_config_value('video.processing.ffmpeg_thread_count', cpus)
            except RuntimeError:
                # Couldn't determine number of cpus, so we didn't set the config value.
                pass
        except xine.XineError:
            # One of the config names doesn't exist, probably an older version of
            # xine-lib.  Not a big deal.
            pass