X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1e14cd894335a4f97c588f4b0522627337cdec6e..2c9a0e18d4ad0b5a73abb5466ea2f70b61daf7fa:/lib/python/Components/Converter/Streaming.py diff --git a/lib/python/Components/Converter/Streaming.py b/lib/python/Components/Converter/Streaming.py index ece17490..2746ee84 100644 --- a/lib/python/Components/Converter/Streaming.py +++ b/lib/python/Components/Converter/Streaming.py @@ -1,6 +1,13 @@ from Converter import Converter from Components.Element import cached +# the protocol works as the following: + +# lines starting with '-' are fatal errors (no recovery possible), +# lines starting with '=' are progress notices, +# lines starting with '+' are PIDs to record: +# "+d:[p:t[,p:t...]]" with d=demux nr, p: pid, t: type + class Streaming(Converter): def __init__(self, type): Converter.__init__(self, type) @@ -9,21 +16,20 @@ class Streaming(Converter): def getText(self): service = self.source.service if service is None: - return "-NO SERVICE" + return "-NO SERVICE\n" streaming = service.stream() s = streaming and streaming.getStreamingData() - if streaming is None: + if s is None: err = service.getError() - return "-1SERVICE ERROR:%d" % err - - r = streaming.getStreamingData() - if r is None: - return "-NO STREAM" + if err: + return "-SERVICE ERROR:%d\n" % err + else: + return "=NO STREAM\n" - demux = r["demux"] - pids = ','.join(["%x:%s" % (x[0], x[1]) for x in r["pids"]]) + demux = s["demux"] + pids = ','.join(["%x:%s" % (x[0], x[1]) for x in s["pids"]]) return "+%d:%s\n" % (demux, pids)