1 from Converter import Converter
2 from Components.Element import cached
4 # the protocol works as the following:
6 # lines starting with '-' are fatal errors (no recovery possible),
7 # lines starting with '=' are progress notices,
8 # lines starting with '+' are PIDs to record:
9 # "+d:[p:t[,p:t...]]" with d=demux nr, p: pid, t: type
11 class Streaming(Converter):
14 service = self.source.service
16 return "-NO SERVICE\n"
18 streaming = service.stream()
19 s = streaming and streaming.getStreamingData()
22 err = service.getError()
24 return "-SERVICE ERROR:%d\n" % err
29 pids = ','.join(["%x:%s" % (x[0], x[1]) for x in s["pids"]])
31 return "+%d:%s\n" % (demux, pids)
33 text = property(getText)