示例#1
0
	def __init__(self, session, args = None):
		Screen.__init__(self, session)
		self["video_caption"] = StaticText(_("Video:"))
		self["audio_caption"] = StaticText(_("Audio:"))
		self["video"] = StaticText()
		self["audio"] = StaticText()
		self["actions"] = ActionMap(["WizardActions"],
		{
			"back": self.close,
			"ok": self.close,
			"right": self.close,
			"left": self.close,
			"down": self.close,
			"up": self.close,

		}, -1)
		ref = session.nav.getCurrentlyPlayingServiceReference()
		vpid = apid = dvbnamespace = tsid = onid = -1
		if ref and not ref.getPath():
			tsid = ref.getData(2)
			onid = ref.getData(3)
			dvbnamespace = ref.getData(4)
			service = session.nav.getCurrentService()
			if service:
				serviceInfo = service.info()
				vpid = serviceInfo.getInfo(iServiceInformation.sVideoPID)
				apid = serviceInfo.getInfo(iServiceInformation.sAudioPID)
			if vpid:
				self.videoBitrate = eBitrateCalculator(vpid, dvbnamespace, tsid, onid, 1000, 1024*1024) # pid, dvbnamespace, tsid, onid, refresh intervall, buffer size
				self.videoBitrate.callback.append(self.getVideoBitrateData)
			if apid:
				self.audioBitrate = eBitrateCalculator(apid, dvbnamespace, tsid, onid, 1000, 64*1024)
				self.audioBitrate.callback.append(self.getAudioBitrateData)
		else:
			self.close()
示例#2
0
	def initBitrateCalc(self):
		service = self.source.service
		vpid = apid = dvbnamespace = tsid = onid = -1
		if service:
			serviceInfo = service.info()
			vpid = serviceInfo.getInfo(iServiceInformation.sVideoPID)
			apid = serviceInfo.getInfo(iServiceInformation.sAudioPID)
			tsid = serviceInfo.getInfo(iServiceInformation.sTSID)
			onid = serviceInfo.getInfo(iServiceInformation.sONID)
			dvbnamespace = serviceInfo.getInfo(iServiceInformation.sNamespace)
		if vpid > 0 and (self.type == self.VPID or (self.type == self.FORMAT and "%V" in self.sfmt)):
			self.videoBitrate = eBitrateCalculator(vpid, dvbnamespace, tsid, onid, 1000, 1024*1024) # pid, dvbnamespace, tsid, onid, refresh intervall, buffer size
			self.videoBitrate.callback.append(self.getVideoBitrateData)
		if apid > 0 and (self.type == self.APID or (self.type == self.FORMAT and "%A" in self.sfmt)):
			self.audioBitrate = eBitrateCalculator(apid, dvbnamespace, tsid, onid, 1000, 64*1024)
			self.audioBitrate.callback.append(self.getAudioBitrateData)
示例#3
0
	def BitCalc(self):
		ref = self.session.nav.getCurrentlyPlayingServiceReference()
		if ref:
			vpid = apid = dvbnamespace = tsid = onid = -1
			service = self.session.nav.getCurrentService()
			if service:
				serviceInfo = service.info()
				vpid = serviceInfo.getInfo(iServiceInformation.sVideoPID)
				apid = serviceInfo.getInfo(iServiceInformation.sAudioPID)
			if not ref.getPath():
				tsid = ref.getData(2)
				onid = ref.getData(3)
				dvbnamespace = ref.getData(4)
			if vpid:
				self.videoBitrate = eBitrateCalculator(vpid, dvbnamespace, tsid, onid, 1000, 1024*1024) # pid, dvbnamespace, tsid, onid, refresh intervall, buffer size
				self.videoBitrate.callback.append(self.getVideoBitrateData)
			if apid:
				self.audioBitrate = eBitrateCalculator(apid, dvbnamespace, tsid, onid, 1000, 64*1024)
				self.audioBitrate.callback.append(self.getAudioBitrateData)
示例#4
0
	def initBitrateCalc(self):
		service = self.source.service
		vpid = apid = dvbnamespace = tsid = onid = -1
		if service:
			serviceInfo = service.info()
			vpid = serviceInfo.getInfo(iServiceInformation.sVideoPID)
			apid = serviceInfo.getInfo(iServiceInformation.sAudioPID)
			tsid = serviceInfo.getInfo(iServiceInformation.sTSID)
			onid = serviceInfo.getInfo(iServiceInformation.sONID)
			dvbnamespace = serviceInfo.getInfo(iServiceInformation.sNamespace)
		if vpid > 0 and self.type == self.bitrate:
			try:
				self.videoBitrate = eBitrateCalculator(vpid, dvbnamespace, tsid, onid, 1000, 1024*1024) 
				self.videoBitrate.callback.append(self.getVideoBitrateData)
			except:
				pass
		if apid > 0 and self.type == self.bitrate:
			try:
				self.audioBitrate = eBitrateCalculator(apid, dvbnamespace, tsid, onid, 1000, 64*1024)
				self.audioBitrate.callback.append(self.getAudioBitrateData)
			except:
				pass