Comments (1)
In case it helps anyone, I solved it as follows in the application code. Note this only considers the BinaryType
child type ie urn:scte:scte35:2014:xml+bin
for Signal
, not SpliceInfoSectionType
as we had no need for that.
def __init__(self):
self.signals = None # Signal
self.message_data = None # xs:string
self.presentation_time = None # xs:unsignedLong
self.duration = None # xs:unsignedLong
self.id = None # xs:unsignedInt
def parse(self, xmlnode):
self.signals = parse_child_nodes(xmlnode, 'Signal', Signal)
self.message_data = parse_attr_value(xmlnode, 'messageData', str)
self.presentation_time = parse_attr_value(xmlnode, 'presentationTime', int)
self.duration = parse_attr_value(xmlnode, 'duration', int)
self.id = parse_attr_value(xmlnode, 'id', int)
def write(self, xmlnode):
write_child_node(xmlnode, 'Signal', self.signals)
write_attr_value(xmlnode, 'messageData', self.message_data)
write_attr_value(xmlnode, 'presentationTime', self.presentation_time)
write_attr_value(xmlnode, 'duration', self.duration)
write_attr_value(xmlnode, 'id', self.id)
class Binary:
def __init__(self):
self.binary_value = None
self.signal_type = None
def parse(self, xmlnode):
self.binary_value = parse_node_value(xmlnode, str)
self.signal_type = parse_attr_value(xmlnode, "signalType", str)
def write(self, xmlnode):
write_node_value(xmlnode, self.binary_value)
write_attr_value(xmlnode, 'signalType', self.signal_type)
class Signal:
def __init__(self):
self.xmlns = None
self.binarys = None
def parse(self, xmlnode):
self.xmlns = parse_attr_value(xmlnode, 'xmlns', str)
self.binarys = parse_child_nodes(xmlnode, 'Binary', XsStringElement)
def write(self, xmlnode):
write_attr_value(xmlnode, 'xmlns', self.xmlns)
write_child_node(xmlnode, 'Binary', self.binarys)
Event.__init__ == __init__
Event.parse = parse
Event.write = write
from python-mpegdash.
Related Issues (20)
- upload to python package index HOT 5
- Python 3 Compatibility HOT 4
- parse_child_nodes bug for str node_type HOT 5
- write_child_node need to help str node_type HOT 3
- ProgramInformation writing throws exception HOT 1
- xs:boolean types are not cased correctly when written
- MPEGDASHParser write to file throws error HOT 1
- New version for PyPi? HOT 1
- Support label non-standard dash attribute
- Respect AdaptationSet selectionPriority HOT 1
- AdaptationSet should have the "profiles" attribute
- About viedo mpd HOT 3
- Wrong type of SubRepresentation.content_component HOT 3
- ContentProtection's most likely don't use `@value`, e.g. `@cenc:pssh` HOT 4
- ContentProtection's key_id can be more than ns2:default_KID HOT 1
- Enable CI
- Applying the latest MPD schema
- Add typing HOT 1
- Decode signal SCTE-35 <binary> strings with threefive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-mpegdash.