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):
12 def __init__(self, type):
13 Converter.__init__(self, type)
17 service = self.source.service
19 return "-NO SERVICE\n"
21 streaming = service.stream()
22 s = streaming and streaming.getStreamingData()
25 err = service.getError()
27 return "-SERVICE ERROR:%d\n" % err
32 pids = ','.join(["%x:%s" % (x[0], x[1]) for x in s["pids"]])
34 return "+%d:%s\n" % (demux, pids)
36 text = property(getText)