[vlma-devel] commit: Prepare the management of SAP announces. (Adrien Grand )
git version control
git at videolan.org
Sat Dec 26 14:53:54 CET 2009
vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Fri Dec 25 22:52:19 2009 +0100| [d6bc202cf44e2da85cb1981666df88c2a581b24f] | committer: Adrien Grand
Prepare the management of SAP announces.
> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=d6bc202cf44e2da85cb1981666df88c2a581b24f
---
vlma-watchdog/src/serialization.py | 17 ++++++++++++++---
vlma-watchdog/src/streamer/api.py | 12 +++++++++++-
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/vlma-watchdog/src/serialization.py b/vlma-watchdog/src/serialization.py
index 3ab0440..673b7bd 100644
--- a/vlma-watchdog/src/serialization.py
+++ b/vlma-watchdog/src/serialization.py
@@ -105,7 +105,6 @@ def order_from_xml(s):
dest.streaming = streaming
elif nodeName == "transcoding":
transcoding = Transcoding()
- streaming = Streaming()
for transcoding_content in dest_content.childNodes:
if transcoding_content.nodeType == xml.TEXT_NODE:
continue
@@ -116,12 +115,24 @@ def order_from_xml(s):
elif nodeName in ["ab", "vb"]:
setattr(transcoding, nodeName, int(nodeValue))
elif nodeName == "scale":
- streaming.scale = float(nodeValue)
+ transcoding.scale = float(nodeValue)
elif nodeName == "deinterlace":
- streaming.deinterlace = (nodeValue == "true")
+ transcoding.deinterlace = (nodeValue == "true")
else:
raise SerializationException("Did not expect " + nodeName + " under the 'transcoding' node")
dest.transcoding = transcoding
+ elif nodeName == "announcing":
+ announcing = Announcing()
+ for announcing_content in dest_content.childNodes:
+ if announcing_content.nodeType == xml.TEXT_NODE:
+ continue
+ nodeName = announcing_content.nodeName
+ nodeValue = announcing_content.childNodes[0].nodeValue
+ if nodeName in ["type", "name", "group"]:
+ setattr(announcing, nodeName, nodeValue)
+ else:
+ raise SerializationException("Did not expect " + nodeName + " under the 'announcing' node")
+ dest.announcing = announcing
else:
raise SerializationException("Did not expect " + nodeName + " under the 'dest' node")
dests.append(dest)
diff --git a/vlma-watchdog/src/streamer/api.py b/vlma-watchdog/src/streamer/api.py
index 2fba4af..22d8232 100644
--- a/vlma-watchdog/src/streamer/api.py
+++ b/vlma-watchdog/src/streamer/api.py
@@ -319,8 +319,9 @@ class Dest:
def __init__(self, ip="0.0.0.0", port=1234):
self.ip = ip
self.port = port
- self.streaming = Streaming()
+ self.streaming = Streaming()
self.transcoding = None
+ self.announcing = None
class Streaming:
@@ -345,6 +346,15 @@ class Transcoding:
self.deinterlace = False
+class Announcing:
+ """Describes how the stream should be announced"""
+
+ def __init__(self, type="sap", name="", group=None):
+ self.type = type
+ self.name = name
+ self.group = group
+
+
class DVBOrder(Order):
"""Base class for DVB orders"""
More information about the vlma-devel
mailing list