示例#1
0
    def _SetPixelMode(self):
        """Sets the pixel mode based on the pixel clock of the input signal.

    Returns:
      True if pixel mode is changed; False if nothing is changed.
    """
        pclk = self._rx.GetPixelClock()
        logging.info('PCLK = %s', pclk)
        if (self._PIXEL_MODE_PCLK_THRESHOLD_LOW <= pclk <=
                self._PIXEL_MODE_PCLK_THRESHOLD_HIGH):
            # Hysteresis: do not change mode if pclk is in this buffer zone.
            return False
        dual_pixel_mode = pclk >= self._PIXEL_MODE_PCLK_THRESHOLD_HIGH
        if self._is_dual_pixel_mode != dual_pixel_mode:
            self._is_dual_pixel_mode = dual_pixel_mode
            if dual_pixel_mode:
                self._rx.SetDualPixelMode()
                logging.info('Changed to dual pixel mode')
            else:
                self._rx.SetSinglePixelMode()
                logging.info('Changed to single pixel mode')
            self._frame_manager = frame_manager.FrameManager(
                self._input_id, self._rx, self._GetEffectiveVideoDumpers())
            self.Select()
            return True
        return False
示例#2
0
    def __init__(self, input_id, main_i2c_bus, fpga_ctrl):
        """Constructs a FpgaInputFlow object.

    Args:
      input_id: The ID of the input connector. Check the value in ids.py.
      main_i2c_bus: The main I2cBus object.
      fpga_ctrl: The FpgaController object.
    """
        super(FpgaInputFlow, self).__init__()
        self._input_id = input_id
        self._main_bus = main_i2c_bus
        self._fpga = fpga_ctrl
        self._power_io = self._main_bus.GetSlave(io.PowerIo.SLAVE_ADDRESSES[0])
        self._mux_io = self._main_bus.GetSlave(io.MuxIo.SLAVE_ADDRESSES[0])
        self._rx = self._main_bus.GetSlave(self._RX_SLAVES[self._input_id])
        self._frame_manager = frame_manager.FrameManager(
            input_id, self._rx, self._GetEffectiveVideoDumpers())
        self._edid = None  # be overwitten by a subclass.
        self._edid_enabled = True
        self._ddc_enabled = True
        self._timer = None