Exemplo n.º 1
0
    def __convert_stream(self, stream: IStream) -> IStreamObject:
        if not stream:
            return

        stream_type = stream.get_type()
        if stream_type == constants.StreamType.PROXY:
            return ProxyStreamObject(stream, self._settings)
        elif stream_type == constants.StreamType.VOD_PROXY:
            return ProxyVodStreamObject(stream, self._settings)
        elif stream_type == constants.StreamType.RELAY:
            return RelayStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.ENCODE:
            return EncodeStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.TIMESHIFT_PLAYER:
            return TimeshiftPlayerStreamObject(stream, self._settings,
                                               self._client)
        elif stream_type == constants.StreamType.TIMESHIFT_RECORDER:
            return TimeshiftRecorderStreamObject(stream, self._settings,
                                                 self._client)
        elif stream_type == constants.StreamType.CATCHUP:
            return CatchupStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.TEST_LIFE:
            return TestLifeStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.VOD_RELAY:
            return VodRelayStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.VOD_ENCODE:
            return VodEncodeStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.COD_RELAY:
            return CodRelayStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.COD_ENCODE:
            return CodEncodeStreamObject(stream, self._settings, self._client)
        elif stream_type == constants.StreamType.EVENT:
            return EventStreamObject(stream, self._settings, self._client)
        else:
            return None  #
Exemplo n.º 2
0
 def make_timeshift_recorder_stream(self) -> TimeshiftRecorderStreamObject:
     return TimeshiftRecorderStreamObject.make_stream(
         self._settings, self._client)