diff options
Diffstat (limited to 'lib/python/Components/Converter')
| -rw-r--r-- | lib/python/Components/Converter/Makefile.am | 3 | ||||
| -rw-r--r-- | lib/python/Components/Converter/Streaming.py | 30 |
2 files changed, 32 insertions, 1 deletions
diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am index e754a683..b25a32d8 100644 --- a/lib/python/Components/Converter/Makefile.am +++ b/lib/python/Components/Converter/Makefile.am @@ -3,4 +3,5 @@ installdir = $(LIBDIR)/enigma2/python/Components/Converter install_PYTHON = \ __init__.py ClockToText.py Converter.py EventName.py StaticText.py EventTime.py \ Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \ - ConditionalShowHide.py ServicePosition.py ValueRange.py RadioText.py + ConditionalShowHide.py ServicePosition.py ValueRange.py RadioText.py Streaming.py + diff --git a/lib/python/Components/Converter/Streaming.py b/lib/python/Components/Converter/Streaming.py new file mode 100644 index 00000000..ece17490 --- /dev/null +++ b/lib/python/Components/Converter/Streaming.py @@ -0,0 +1,30 @@ +from Converter import Converter +from Components.Element import cached + +class Streaming(Converter): + def __init__(self, type): + Converter.__init__(self, type) + + @cached + def getText(self): + service = self.source.service + if service is None: + return "-NO SERVICE" + + streaming = service.stream() + s = streaming and streaming.getStreamingData() + + if streaming is None: + err = service.getError() + return "-1SERVICE ERROR:%d" % err + + r = streaming.getStreamingData() + if r is None: + return "-NO STREAM" + + demux = r["demux"] + pids = ','.join(["%x:%s" % (x[0], x[1]) for x in r["pids"]]) + + return "+%d:%s\n" % (demux, pids) + + text = property(getText) |
