Beispiel #1
0
    def loadConfig(self):
        cfg = Config()
        xmlRoot = ET.parse(self.folder+'/config.xml').getroot()

        # Load audio config
        cfg.audioCodecs = [str(codec.text) for codec 
                           in xmlRoot.find('audiocodecs').iter('audiocodec')]
        cfg.curAudioCodec = str(xmlRoot.find('audiocodecs').get('cur'))
        cfg.audioRates  = [int(rate.text) for rate
                           in xmlRoot.find('audiorates').iter('audiorate')]
        cfg.curAudioRate = str(xmlRoot.find('audiorates').get('cur'))

        # Load video config
        cfg.videoCodecs = [str(codec.text) for codec 
                           in xmlRoot.find('videocodecs').iter('videocodec')]
        cfg.curVideoCodec = str(xmlRoot.find('videocodecs').get('cur'))
        cfg.videoRates  = [int(rate.text) for rate
                           in xmlRoot.find('videorates').iter('videorate')]
        cfg.curVideoRate = int(xmlRoot.find('videorates').get('cur'))
        cfg.videoSizes  = [int(size.text) for size
                           in xmlRoot.find('videosizes').iter('videosize')]
        cfg.curVideoSize = int(xmlRoot.find('videosizes').get('cur'))

        # Load stream Config
        cfg.streamEncryptions = [str(enc.text) for enc
                                in xmlRoot.find('streamencryptions')
                                          .iter('streamencryption')]
        cfg.curStreamEncryption = str(xmlRoot.find('streamencryptions')
                                             .get('cur'))
        cfg.curEncryptionKey = str(xmlRoot.find('streamencryptions')
                                          .get('key'))

        return cfg
Beispiel #2
0
 def loadConfig(self):
     cfg = Config()
     cfg.audioCodecs = ['MP3','WAV','OGG']
     cfg.curAudioCodec = 'WAV'
     cfg.audioRates = [56,96,128,196,256,312]
     cfg.curAudioRate = 128
     cfg.videoCodecs = ['MPEG-I', 'MPEG-II', 'DIVx', 'XVid', 'MP4', 'VOB']
     cfg.curVideoCodec = 'MP4'
     cfg.videoRates = [576,648,720,850,1024]
     cfg.curVideoRate = 648
     cfg.videoSizes = [33,50,66,75,100]
     cfg.curVideoSize = 66
     cfg.streamEncryptions = ['None', 'AES', 'Blowfish', 'CSMA']
     cfg.curStreamEncryption = 'AES'
     cfg.curEncryptionKey = ''
     return cfg