Added a simple FLUTE implementation.

This commit is contained in:
feyris-tan 2025-06-14 22:24:07 +02:00
parent 3c1c28c4be
commit 324ba789d5
38 changed files with 6753 additions and 1 deletions

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3gpp:metadata:2005:MBMS:associatedProcedure" version="2"
xmlns="urn:3gpp:metadata:2005:MBMS:associatedProcedure"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:r12="urn:3gpp:metadata:2005:MBMS:associatedProcedure-rel-12-extension"
xmlns:r13="urn:3gpp:metadata:2005:MBMS:associatedProcedure-rel-13-extension"
xmlns:r14="urn:3gpp:metadata:2005:MBMS:associatedProcedure-rel-14-extension"
xmlns:sv="urn:3gpp:metadata:2009:MBMS:schemaVersion"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS Associated Delivery Procedures Description schema</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 9.5.1</xs:documentation>
<xs:documentation>Copyright © 2005, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:import namespace="urn:3gpp:metadata:2009:MBMS:schemaVersion" schemaLocation="TS26346_SchemaVersion.xsd"/>
<xs:import namespace="urn:3gpp:metadata:2005:MBMS:associatedProcedure-rel-12-extension" schemaLocation="TS26346_AssociatedDeliveryProceduresDescription_Extensions_Rel-12.xsd"/>
<xs:import namespace="urn:3gpp:metadata:2005:MBMS:associatedProcedure-rel-13-extension" schemaLocation="TS26346_AssociatedDeliveryProceduresDescription_Extensions_Rel-13.xsd"/>
<xs:import namespace="urn:3gpp:metadata:2005:MBMS:associatedProcedure-rel-14-extension" schemaLocation="TS26346_AssociatedDeliveryProceduresDescription_Extensions_Rel-14.xsd"/>
<xs:element name="associatedProcedureDescription" type="associatedProcedureType"/>
<xs:complexType name="associatedProcedureType">
<xs:sequence>
<xs:element name="postFileRepair" type="basicProcedureType" minOccurs="0"/>
<xs:element name="bmFileRepair" type="bmFileRepairType" minOccurs="0"/>
<xs:element name="postReceptionReport" type="reportProcedureType" minOccurs="0"/>
<xs:element ref="r12:consumptionReport" minOccurs="0"/>
<xs:element ref="sv:schemaVersion"/>
<xs:element ref="r13:DASHQoEProcedure" minOccurs="0"/>
<xs:element ref="sv:delimiter"/>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="basicProcedureType">
<xs:sequence>
<xs:element name="serviceURI" type="xs:anyURI" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="offsetTime" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="randomTimePeriod" type="xs:unsignedLong" use="required"/>
</xs:complexType>
<xs:complexType name="bmFileRepairType">
<xs:attribute name="sessionDescriptionURI" type="xs:anyURI" use="required"/>
</xs:complexType>
<xs:complexType name="reportProcedureType">
<xs:complexContent>
<xs:extension base="basicProcedureType">
<xs:attribute name="samplePercentage" type="xs:decimal" use="optional" default="100"/>
<xs:attribute name="forceTimeIndependence" type="xs:boolean" use="optional" default="false"/>
<xs:attribute name="reportType" use="optional" default="RAck">
<xs:simpleType>
<xs:union memberTypes="knownReportType xs:string"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute ref="r14:reportInterval" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="knownReportType">
<xs:restriction base="xs:string">
<xs:enumeration value="RAck"/>
<xs:enumeration value="StaR"/>
<xs:enumeration value="StaR-all"/>
<xs:enumeration value="StaR-only"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:IETF:metadata:2005:FLUTE:FDT" version="4"
xmlns="urn:IETF:metadata:2005:FLUTE:FDT"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mbms2005="urn:3GPP:metadata:2005:MBMS:FLUTE:FDT"
xmlns:mbms2007="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT"
xmlns:mbms2008="urn:3GPP:metadata:2008:MBMS:FLUTE:FDT_ext"
xmlns:mbms2009="urn:3GPP:metadata:2009:MBMS:FLUTE:FDT_ext"
xmlns:mbms2012="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT"
xmlns:mbms2015="urn:3GPP:metadata:2015:MBMS:FLUTE:FDT"
xmlns:sv="urn:3gpp:metadata:2009:MBMS:schemaVersion"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>Consolidated MBMS FLUTE File Delivery Table schema</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.1</xs:documentation>
<xs:documentation>Copyright © 2005, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:import namespace="urn:3GPP:metadata:2005:MBMS:FLUTE:FDT"
schemaLocation="TS26346_FLUTE-FDT_Extensions_Rel-6.xsd"/>
<xs:import namespace="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT"
schemaLocation="TS26346_FLUTE-FDT_Extensions_Rel-7.xsd"/>
<xs:import namespace="urn:3GPP:metadata:2008:MBMS:FLUTE:FDT_ext"
schemaLocation="TS26346_FLUTE-FDT_Extensions_Rel-8.xsd"/>
<xs:import namespace="urn:3GPP:metadata:2009:MBMS:FLUTE:FDT_ext"
schemaLocation="TS26346_FLUTE-FDT_Extensions_Rel-9.xsd"/>
<xs:import namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT"
schemaLocation="TS26346_FLUTE-FDT_Extensions_Rel-11.xsd"/>
<xs:import namespace="urn:3GPP:metadata:2015:MBMS:FLUTE:FDT"
schemaLocation="TS26346_FLUTE-FDT_Extensions_Rel-13.xsd"/>
<xs:import namespace="urn:3gpp:metadata:2009:MBMS:schemaVersion"
schemaLocation="TS26346_SchemaVersion.xsd"/>
<xs:element name="FDT-Instance" type="FDT-InstanceType"/>
<xs:complexType name="FDT-InstanceType">
<xs:sequence>
<xs:element name="File" type="FileType" maxOccurs="unbounded"/>
<xs:element ref="sv:schemaVersion"/>
<xs:element ref="mbms2012:Base-URL-1" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="mbms2012:Base-URL-2" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="sv:delimiter"/>
<xs:element name="Group" type="mbms2005:groupIdType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="MBMS-Session-Identity-Expiry" type="mbms2005:MBMS-Session-Identity-Expiry-Type" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Expires" type="xs:string" use="required"/>
<xs:attribute name="Complete" type="xs:boolean" use="optional"/>
<xs:attribute name="Content-Type" type="xs:string" use="optional"/>
<xs:attribute name="Content-Encoding" type="xs:string" use="optional"/>
<xs:attribute name="FEC-OTI-FEC-Encoding-ID" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-FEC-Instance-ID" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Maximum-Source-Block-Length" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Encoding-Symbol-Length" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Max-Number-of-Encoding-Symbols" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Scheme-Specific-Info" type="xs:base64Binary" use="optional"/>
<xs:attribute ref="mbms2008:FullFDT" use="optional" default="false"/>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<xs:complexType name="FileType">
<xs:sequence>
<xs:element ref="mbms2007:Cache-Control" minOccurs="0"/>
<xs:element ref="sv:delimiter"/>
<xs:element ref="mbms2012:Alternate-Content-Location-1" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="mbms2012:Alternate-Content-Location-2" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="sv:delimiter"/>
<xs:element name="Group" type="mbms2005:groupIdType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="MBMS-Session-Identity" type="mbms2005:MBMS-Session-Identity-Type" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Content-Location" type="xs:anyURI" use="required"/>
<xs:attribute name="TOI" type="xs:positiveInteger" use="required"/>
<xs:attribute name="Content-Length" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="Transfer-Length" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="Content-Type" type="xs:string" use="optional"/>
<xs:attribute name="Content-Encoding" type="xs:string" use="optional"/>
<xs:attribute name="Content-MD5" type="xs:base64Binary" use="optional"/>
<xs:attribute name="FEC-OTI-FEC-Encoding-ID" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-FEC-Instance-ID" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Maximum-Source-Block-Length" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Encoding-Symbol-Length" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Max-Number-of-Encoding-Symbols" type="xs:unsignedLong" use="optional"/>
<xs:attribute name="FEC-OTI-Scheme-Specific-Info" type="xs:base64Binary" use="optional"/>
<xs:attribute ref="mbms2009:Decryption-KEY-URI" use="optional"/>
<xs:attribute ref="mbms2012:FEC-Redundancy-Level" use="optional"/>
<xs:attribute ref="mbms2012:File-ETag" use="optional"/>
<xs:attribute ref="mbms2015:IndependentUnitPositions" use="optional"/>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
</xs:schema>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT"
xmlns="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS FLUTE FDT schema extensions (Release 11)</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.2</xs:documentation>
<xs:documentation>Copyright © 2012, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:element name="Alternate-Content-Location-1" type="Alternative-Content-LocationType"/>
<xs:element name="Alternate-Content-Location-2" type="Alternative-Content-LocationType"/>
<xs:complexType name="Alternative-Content-LocationType">
<xs:sequence>
<xs:element name="Alternate-Content-Location" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Availability-Time" type="xs:dateTime"/>
</xs:complexType>
<xs:element name="Base-URL-1" type="xs:anyURI"/>
<xs:element name="Base-URL-2" type="xs:anyURI"/>
<xs:attribute name="FEC-Redundancy-Level" type="xs:unsignedInt"/>
<xs:attribute name="File-ETag" type="xs:string"/>
</xs:schema>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3GPP:metadata:2015:MBMS:FLUTE:FDT"
xmlns="urn:3GPP:metadata:2015:MBMS:FLUTE:FDT"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS FLUTE FDT schema extensions (Release 13)</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.2</xs:documentation>
<xs:documentation>Copyright © 2015, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:attribute name="IndependentUnitPositions" type="IndependentUnitPositionsType"/>
<xs:simpleType name="IndependentUnitPositionsType">
<xs:list itemType="xs:unsignedLong"/>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3GPP:metadata:2005:MBMS:FLUTE:FDT"
xmlns="urn:3GPP:metadata:2005:MBMS:FLUTE:FDT"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS FLUTE FDT schema extensions (Release 6)</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.2</xs:documentation>
<xs:documentation>Copyright © 2005, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:complexType name="MBMS-Session-Identity-Expiry-Type">
<xs:simpleContent>
<xs:extension base="MBMS-Session-Identity-Type">
<xs:attribute name="value" type="xs:unsignedInt" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="MBMS-Session-Identity-Type">
<xs:restriction base="xs:unsignedByte"/>
</xs:simpleType>
<xs:simpleType name="groupIdType">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT"
xmlns="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS FLUTE FDT schema extensions (Release 7)</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.2</xs:documentation>
<xs:documentation>Copyright © 2007, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:element name="Cache-Control">
<xs:complexType>
<xs:choice>
<xs:element name="no-cache" type="xs:boolean" fixed="true"/>
<xs:element name="max-stale" type="xs:boolean" fixed="true"/>
<xs:element name="Expires" type="xs:unsignedInt"/>
</xs:choice>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3GPP:metadata:2008:MBMS:FLUTE:FDT_ext"
xmlns="urn:3GPP:metadata:2008:MBMS:FLUTE:FDT_ext"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS FLUTE FDT schema extensions (Release 8)</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.2</xs:documentation>
<xs:documentation>Copyright © 2008, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:attribute name="FullFDT" type="xs:boolean"/>
</xs:schema>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3GPP:metadata:2009:MBMS:FLUTE:FDT_ext"
xmlns="urn:3GPP:metadata:2009:MBMS:FLUTE:FDT_ext"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS FLUTE FDT schema extensions (Release 9)</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause 7.2.10.2</xs:documentation>
<xs:documentation>Copyright © 2009, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:attribute name="Decryption-KEY-URI" type="xs:anyURI"/>
</xs:schema>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:3gpp:metadata:2009:MBMS:schemaVersion"
xmlns="urn:3gpp:metadata:2009:MBMS:schemaVersion"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>MBMS Version and Delimiter schema</xs:documentation>
<xs:documentation>3GPP TS 26.346 clause J.2</xs:documentation>
<xs:documentation>Copyright © 2009, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.</xs:documentation>
</xs:annotation>
<xs:element name="schemaVersion" type="xs:unsignedInt"/>
<xs:element name="delimiter" type="xs:byte"/>
</xs:schema>

View File

@ -0,0 +1 @@
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\x64\xsd.exe" /classes FLUTE-FDT.xsd FLUTE-FDT_Extensions_Rel-7.xsd SchemaVersion.xsd FLUTE-FDT_Extensions_Rel-11.xsd FLUTE-FDT_Extensions_Rel-6.xsd FLUTE-FDT_Extensions_Rel-9.xsd FLUTE-FDT_Extensions_Rel-13.xsd FLUTE-FDT_Extensions_Rel-8.xsd /out:C:\Temp\ /namespace:skyscraper8.Ietf.FLUTE

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Richard Bradbury, BBC Research & Development -->
<!-- Copyright (c) 2024 British Broadcasting Corporation -->
<xs:schema xmlns="urn:dvb:metadata:Extensibility:2024" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:dvb:metadata:Extensibility:2024" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:attribute name="schemaVersion" type="xs:unsignedInt"/>
<xs:element name="NamespaceDelimiter">
<xs:complexType/>
</xs:element>
</xs:schema>

View File

@ -0,0 +1 @@
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools\x64\xsd.exe" /classes multicast-session-configuration_phase-2_2024-05-28.xsd mpeg7_subset.xsd extensibility_2024-04-24.xsd /namespace:skyscraper8.DvbNip

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ********************************************************************************
This XML document was originally developed in the course of development of the ISO/IEC
15938 standard (MPEG-7). This XML document contains either a part of the MPEG-7 schema
implementation for one or more MPEG-7 tools as specified by the MPEG-7 Requirements or
MPEG-7 description examples conformant to the MPEG-7 schema.
ISO/IEC gives users of MPEG-7 free license to this XML document or modifications thereof
for use in hardware or software products claiming conformance to MPEG-7.
Those intending to use this XML document in hardware or software products are advised that
its use may infringe existing patents. The original developers of this XML document and his/her
company, the subsequent editors and their companies, and ISO/IEC have no liability for use of
this XML document or modifications thereof in an implementation.
Copyright is not released for non MPEG-7 conforming products. The organizations who
contributed to this XML document retain the full right to use the code for their own purpose,
assign or donate their contribution to a third party and inhibit third parties from using their
contribution for non MPEG-7 conforming products.
Copyright (c) 1999-2002 ISO/IEC.
This XML document is provided for informative purposes only. If any parts of this XML
document contradict the normative part of the corresponding standard document then the
normative part should be used as the definitive specification.
This notice must be included in all copies or derivative works.
************************************************************************************* -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" targetNamespace="urn:mpeg:mpeg7:schema:2001" elementFormDefault="qualified" attributeFormDefault="unqualified">
<annotation>
<documentation>This schema is composed of a subset of MPEG-7 tools in the proposed MPEG-7 User Description (UD) Profile that are used by the DVB BlueBook A176 Multicast session configuration schema. Global attribute groups are defined first, followed by simple types and then complex types (ordered alphabetically within each category).</documentation>
</annotation>
<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="./xml_2001.xsd"/>
<!-- #################################################################### -->
<annotation>
<documentation>MODULE 1A. GLOBAL ATTRIBUTE GROUPS</documentation>
</annotation>
<!-- Definition of mediaTimeProperty attribute group (ISO/IEC 15938-5: 6.4.16) -->
<attributeGroup name="mediaTimePropertyGrp">
<attribute name="mediaTimeBase" type="mpeg7:xPathRefType" use="optional"/>
<attribute name="mediaTimeUnit" type="mpeg7:mediaDurationType" use="optional"/>
</attributeGroup>
<!-- Definition of referenceGrp attribute group (ISO/IEC 15938-5: 6.2.1) -->
<attributeGroup name="referenceGrp">
<attribute name="idref" type="IDREF" use="optional"/>
<attribute name="xpath" type="mpeg7:xPathRefType" use="optional"/>
<attribute name="href" type="anyURI" use="optional"/>
</attributeGroup>
<!-- Definition of timePropertyGrp attribute group (ISO/IEC 15938-5: 6.4.8) -->
<attributeGroup name="timePropertyGrp">
<attribute name="timeBase" type="mpeg7:xPathRefType" use="optional"/>
<attribute name="timeUnit" type="mpeg7:durationType" use="optional"/>
</attributeGroup>
<!-- #################################################################### -->
<annotation>
<documentation>MODULE 1B. SIMPLE TYPES</documentation>
</annotation>
<!-- definition of basicDuration datatype (ISO/IEC 15938-2) -->
<simpleType name="basicDurationType">
<restriction base="string">
<pattern value="\-?P(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?(\d+N)?(\d{2}f)?)?(\d+F)?((\-|\+)\d{2}:\d{2}Z)?"/>
</restriction>
</simpleType>
<!-- definition of basicTimePoint datatype (ISO/IEC 15938-2) -->
<simpleType name="basicTimePointType">
<restriction base="string">
<pattern value="\-?(\d+(\-\d{2}(\-\d{2})?)?)?(T\d{2}(:\d{2}(:\d{2}(:\d+(\.\d{2})?)?)?)?)?(F\d+)?((\-|\+)\d{2}:\d{2})?"/>
</restriction>
</simpleType>
<!-- Definition of countryCode datatype (ISO/IEC 15938-5: 5.6.3) -->
<simpleType name="countryCode">
<restriction base="string">
<whiteSpace value="collapse"/>
<pattern value="[a-zA-Z]{2}"/>
</restriction>
</simpleType>
<!-- Definition of duration datatype (ISO/IEC 15938-5: 6.4.4) -->
<simpleType name="durationType">
<restriction base="mpeg7:basicDurationType">
<pattern value="\-?P(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?(\d+N)?)?(\d+F)?((\-|\+)\d{2}:\d{2}Z)?"/>
</restriction>
</simpleType>
<!-- Definition of mediaDuration datatype (ISO/IEC 15938-5: 6.4.12) -->
<simpleType name="mediaDurationType">
<restriction base="mpeg7:basicDurationType">
<pattern value="\-?P(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?(\d+N)?)?(\d+F)?"/>
</restriction>
</simpleType>
<!-- Definition of mediaTimeOffset datatype (ISO/IEC 15938-5: 6.4.14) -->
<simpleType name="mediaTimeOffsetType">
<restriction base="mpeg7:basicDurationType">
<pattern value="\-?P(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?(\d+N)?)?(\d+F)?"/>
</restriction>
</simpleType>
<!-- Definition of mediaTimePoint datatype (ISO/IEC 15938-5: 6.4.11) -->
<simpleType name="mediaTimePointType">
<restriction base="mpeg7:basicTimePointType">
<pattern value="(\-?\d+(\-\d{2}(\-\d{2})?)?)?(T\d{2}(:\d{2}(:\d{2}(:\d+)?)?)?)?(F\d+)?"/>
</restriction>
</simpleType>
<!-- Definition of mimeType datatype (ISO/IEC 15938-5: 5.6.2) -->
<simpleType name="mimeType">
<restriction base="string">
<whiteSpace value="collapse"/>
<pattern value='[&#x21;-&#x7f;-[\(\)&lt;&gt;@,;:\\"/\[\]\?=]]+/[&#x21;-&#x7f;-[\(\)&lt;&gt;@,;:\\"/\[\]\?=]]+'/>
</restriction>
</simpleType>
<!-- Definition of regionCode datatype (ISO/IEC 15938-5: 5.6.4) -->
<simpleType name="regionCode">
<restriction base="string">
<whiteSpace value="collapse"/>
<pattern value="[a-zA-Z]{2}(-[a-zA-Z0-9]{1,3})?"/>
</restriction>
</simpleType>
<!-- Definition of termReference datatype (ISO/IEC 15938-5: 7.3.6) -->
<simpleType name="termReferenceType">
<union>
<simpleType>
<restriction base="NMTOKEN">
<whiteSpace value="collapse"/>
<pattern value=":[^:]+:[^:]+"/>
</restriction>
</simpleType>
<simpleType>
<restriction base="anyURI"/>
</simpleType>
</union>
</simpleType>
<!-- Definition of timePoint datatype (ISO/IEC 15938-5: 6.4.3) -->
<simpleType name="timePointType">
<restriction base="mpeg7:basicTimePointType">
<pattern value="(\-?\d+(\-\d{2}(\-\d{2})?)?)?(T\d{2}(:\d{2}(:\d{2}(:\d+)?)?)?)?(F\d+)?((\-|\+)\d{2}:\d{2})?"/>
</restriction>
</simpleType>
<!-- Definition of xPathAbsoluteSelector datatype (ISO/IEC 15938-5: 6.2.2) -->
<simpleType name="xPathAbsoluteSelectorType">
<restriction base="mpeg7:xPathSelectorType">
<pattern value="(/|((//|/)(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)(\|(/|((//|/)(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*))*"/>
</restriction>
</simpleType>
<!-- Definition of xPathRef datatype (ISO/IEC 15938-5: 6.2.2) -->
<simpleType name="xPathRefType">
<restriction base="mpeg7:xPathType">
<pattern value="/?((((child::)?((\i\c*:)?(\i\c*)(\[\d+\])?))|\.|(\.\.))/)*((((child::)?((\i\c*:)?(\i\c*)(\[\d+\])?))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))"/>
</restriction>
</simpleType>
<!-- Definition of xPathSelector datatype (ISO/IEC 15938-5: 6.2.2) -->
<simpleType name="xPathSelectorType">
<restriction base="mpeg7:xPathType">
<pattern value="(/|((//|/)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.|\.\.)((//|/)(((child::)?((\i\c*:)?(\i\c*|\*)))|\.|\.\.))*))(\|/|((//|/)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.|\.\.)((//|/)(((child::)?((\i\c*:)?(\i\c*|\*)))|\.|\.\.))*))*"/>
</restriction>
</simpleType>
<!-- Definition of xPath datatype (ISO/IEC 15938-5: 6.2.2) -->
<simpleType name="xPathType">
<restriction base="token"/>
</simpleType>
</schema>

View File

@ -0,0 +1,661 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="urn:dvb:metadata:MulticastSessionConfiguration:2024" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mpeg7="urn:mpeg:mpeg7:schema:2001" xmlns:ext="urn:dvb:metadata:Extensibility:2024" targetNamespace="urn:dvb:metadata:MulticastSessionConfiguration:2024" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1">
<xs:import namespace="urn:mpeg:mpeg7:schema:2001" schemaLocation="mpeg7_subset.xsd"/>
<xs:import namespace="urn:dvb:metadata:Extensibility:2024" schemaLocation="extensibility_2024-04-24.xsd"/>
<!-- -->
<xs:simpleType name="decimalFraction">
<xs:annotation>
<xs:documentation>A fraction expressed as a decimal between 0.0 and 1.0</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:minExclusive value="0.0"/>
<xs:maxInclusive value="1.0"/>
</xs:restriction>
</xs:simpleType>
<!-- -->
<xs:simpleType name="stringNoWhitespaceType">
<xs:restriction base="xs:string">
<xs:pattern value="[^\r\n\t \p{Z}]*"/>
</xs:restriction>
</xs:simpleType>
<!-- -->
<xs:simpleType name="IPAddressType">
<xs:annotation>
<xs:documentation>TODO: Restrict this with a regular expression that matches IPv4 and IPv6 addresses in their respective textual notations.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<!-- -->
<xs:simpleType name="PortNumberType">
<xs:restriction base="xs:positiveInteger">
<xs:maxInclusive value="65535"/>
</xs:restriction>
</xs:simpleType>
<!-- -->
<xs:simpleType name="contentAcquisitionMethodType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="push"/>
<xs:enumeration value="pull"/>
</xs:restriction>
</xs:simpleType>
<!-- -->
<xs:simpleType name="transmissionModeType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="resource"/>
<xs:enumeration value="chunked"/>
</xs:restriction>
</xs:simpleType>
<!-- -->
<xs:simpleType name="transportSecurityType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="none">
<xs:annotation>
<xs:documentation/>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="integrity">
<xs:annotation>
<xs:documentation>A digest of the multicast transport object is present in the metadata describing it, enabling its integrity to be verified by the Multicast gateway.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="integrityAndAuthenticity">
<xs:annotation>
<xs:documentation>A digest of the multicast transport object is present in the metadata describing it, enabling its integrity to be verified by the Multicast gateway. A digital signature is also provided, enabling the authenticity of (key fields within) the multicast transport object metadata to be verified by the Multicast gateway.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<!-- -->
<xs:simpleType name="tagAttrType">
<xs:list itemType="xs:anyURI"/>
</xs:simpleType>
<!-- -->
<xs:attributeGroup name="validityAttrs">
<xs:attribute name="validityPeriod" type="xs:duration">
<xs:annotation>
<xs:documentation>The period of time after receiving this document that it may no longer be valid.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="validUntil" type="mpeg7:timePointType">
<xs:annotation>
<xs:documentation>The absolute point in time after which this document may no longer be valid.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:attributeGroup>
<!-- -->
<xs:attributeGroup name="transportSessionRefAttrs">
<xs:attribute name="serviceIdRef" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>A reference to a service identifier in this multicast session configuration.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transportSessionIdRef" type="xs:NMTOKEN" use="optional">
<xs:annotation>
<xs:documentation>A reference to a transport session identifier within the scope of the indicated multicast session.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<!-- -->
<xs:attributeGroup name="targetAcquisitionLatencyAttrs">
<xs:attribute name="targetAcquisitionLatency" type="xs:duration" use="optional">
<xs:annotation>
<xs:documentation>The maximum period of time between transmissions of a multicast transport object as part of a carousel.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<!-- -->
<xs:attributeGroup name="revalidationPeriodAttrs">
<xs:attribute name="revalidationPeriod" type="xs:duration" use="optional">
<xs:annotation>
<xs:documentation>The maximum period of time between revalidation of a resource with its origin server.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<!-- -->
<xs:attributeGroup name="compressionAttrs">
<xs:attribute name="compressionPreferred" type="xs:boolean" use="optional" default="false">
<xs:annotation>
<xs:documentation>Expression of preference to the Multicast server that compression is desired by the Provisioning function.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<!-- -->
<xs:attributeGroup name="carouselSizeAttrs">
<xs:attribute name="aggregateTransportSize" type="xs:positiveInteger" use="optional">
<xs:annotation>
<xs:documentation>The combined size of all transport objects described by this carousel, excluding any associated metadata and transport protocol overhead.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="aggregateContentSize" type="xs:positiveInteger" use="optional">
<xs:annotation>
<xs:documentation>The combined size of all transport objects described by this carousel once any content encoding (such as compression) has been removed from the objects, excluding any associated metadata and transport protocol overhead.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
<!-- -->
<xs:complexType name="ServiceComponentIdentifierType" abstract="true">
<xs:attribute name="manifestIdRef" type="xs:NMTOKEN" use="required">
<xs:annotation>
<xs:documentation>A cross-reference to a PresentationManifestLocator element in the parent MulticastSession with a manifestId of the same value.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="DASHComponentIdentifierType">
<xs:complexContent>
<xs:extension base="ServiceComponentIdentifierType">
<xs:attribute name="periodIdentifier" type="xs:string" use="required"/>
<xs:attribute name="adaptationSetIdentifier" type="xs:unsignedInt" use="required"/>
<xs:attribute name="representationIdentifier" type="stringNoWhitespaceType" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<xs:complexType name="HLSComponentIdentifierType">
<xs:complexContent>
<xs:extension base="ServiceComponentIdentifierType">
<xs:attribute name="mediaPlaylistLocator" type="xs:anyURI" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<xs:complexType name="GenericComponentIdentifierType">
<xs:complexContent>
<xs:extension base="ServiceComponentIdentifierType">
<xs:attribute name="componentIdentifier" type="xs:NMTOKEN" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastTransportProtocolType">
<xs:attribute name="protocolIdentifier" type="mpeg7:termReferenceType" use="required"/>
<xs:attribute name="protocolVersion" type="xs:positiveInteger" use="required"/>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastEndpointAddressType">
<xs:sequence>
<xs:element name="NetworkSourceAddress" type="IPAddressType" minOccurs="0"/>
<xs:element name="NetworkDestinationGroupAddress" type="IPAddressType"/>
<xs:element name="TransportDestinationPort" type="PortNumberType"/>
<xs:element name="MediaTransportSessionIdentifier" type="xs:positiveInteger" minOccurs="0">
<xs:annotation>
<xs:documentation>Uniquely identifying the stream of packets in the multicast group that corresponds to this multicast transport session, e.g. the LCT Channel identifier. (Some multicast media transport protocols do not require this additional demultiplexing identifier.)</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="BitRateType">
<xs:attribute name="average" type="xs:positiveInteger" use="optional"/>
<xs:attribute name="maximum" type="xs:positiveInteger" use="required"/>
</xs:complexType>
<!-- -->
<xs:complexType name="ForwardErrorCorrectionParametersType">
<xs:annotation>
<xs:documentation>A set of parameters describing an Application Level Forward Error Correction configuration.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="SchemeIdentifier" type="mpeg7:termReferenceType">
<xs:annotation>
<xs:documentation>A term identifier from ForwardErrorCorrectionSchemeCS identifying the AL-FEC scheme in use.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="OverheadPercentage" type="xs:positiveInteger">
<xs:annotation>
<xs:documentation>The percentage AL-FEC overhead for the repair stream described by this set of Forward Error Correction parameters.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="EndpointAddress" type="MulticastEndpointAddressType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>The endpoint address to which AL-FEC repair packets are transmitted. May be omitted in cases where AL-FEC is transmitted in band to the same endpoint address as the enclosing multicast transport session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="WeightedURIType">
<xs:annotation>
<xs:documentation>A URI with an associated weighting attribute.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="relativeWeight" type="xs:nonNegativeInteger" default="1"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- -->
<xs:complexType name="UnicastRepairParametersType">
<xs:annotation>
<xs:documentation>An element describing the parameters to be used by a Multicast gateway when performing unicast repair. One or more base paths may be specified here, each with an optional weighting. If the weighting is omitted, all base paths are assumed to have an equal weighting of 1.0.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="BaseURL" type="WeightedURIType" minOccurs="0" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="transportObjectReceptionTimeout" type="xs:unsignedInt" use="required">
<xs:annotation>
<xs:documentation>The time (expressed in milliseconds) that a Multicast gateway should wait for a packet relating to a particular multicast transport object before it can assume that the object transmission is over, and commence object repair using Forward Error Correction or unicast patching procedures.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="fixedBackOffPeriod" type="xs:unsignedInt" default="0">
<xs:annotation>
<xs:documentation>The minimum number of milliseconds that the Multicast gateway shall back off after the mutlicast transport object timeout before attempting a unicast repair.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="randomBackOffPeriod" type="xs:unsignedInt" default="0">
<xs:annotation>
<xs:documentation>An additional period that the Multicast gateway shall wait after the fixed back-off period before attempting a unicast repair. It shall be a randomly selected number of milliseconds between zero and the value specified in this attribute. The Multicast gateway shall choose a different random back-off period for each multicast transport object.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transportObjectBaseURI" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>The base path of all multicast transport objects conveyed in this multicast transport session. This prefix string is substituated by the Multicast gateway with a unicast repair base path when performing unicast repair.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="TypedLocatorType">
<xs:annotation>
<xs:documentation>A URL and accompanying MIME content type.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="contentType" type="mpeg7:mimeType" use="required">
<xs:annotation>
<xs:documentation>The MIME content type of the resource pointed to by the content of this element.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- -->
<xs:complexType name="ReportingLocatorType">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="proportion" type="decimalFraction" default="1.0">
<xs:annotation>
<xs:documentation>The proportion of Multicast gateways that should send reports to the specified endpoint. At the start of a multicast transport session, each Multicast gateway shall randomly decide whether or not to send reports based on this value.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="period" type="xs:duration" use="required">
<xs:annotation>
<xs:documentation>The period of time for the Multicast gateway to wait between sending reports to the specified endpoint.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="randomDelay" type="xs:unsignedInt" use="required">
<xs:annotation>
<xs:documentation>An additional period that the Multicast gateway shall delay when sending reports to the specified endpoint. It shall be a randomly selected number of milliseconds between zero and the value specified in this attribute. The Multicast gateway shall choose a different random delay for each report it sends.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="reportSessionRunningEvents" type="xs:boolean" use="optional" default="false">
<xs:annotation>
<xs:documentation>Controls whether Playback session running events are included in reports.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- -->
<xs:complexType name="SessionReportingType">
<xs:sequence>
<xs:annotation>
<xs:documentation>Parameters used by the Multicast gateway to report statistics about the session.</xs:documentation>
</xs:annotation>
<xs:element name="ReportingLocator" type="ReportingLocatorType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="CarouselMediaPresentationResourceType">
<xs:annotation>
<xs:documentation>The parameters for carouselling a resource related to a media presentation.</xs:documentation>
</xs:annotation>
<xs:attributeGroup ref="targetAcquisitionLatencyAttrs"/>
<xs:attributeGroup ref="compressionAttrs"/>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="ReferencingCarouselMediaPresentationResourceType">
<xs:annotation>
<xs:documentation>The parameters for carouselling a resource related to a media presentation with reference to an multicast transport session described in a different document.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="CarouselMediaPresentationResourceType">
<xs:attributeGroup ref="transportSessionRefAttrs"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<xs:complexType name="CarouselResourceLocatorType">
<xs:annotation>
<xs:documentation>A URL and the parameters for carouselling it.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attributeGroup ref="targetAcquisitionLatencyAttrs">
<xs:annotation>
<xs:documentation>The target acquisition period from the carousel for this resource.</xs:documentation>
</xs:annotation>
</xs:attributeGroup>
<xs:attributeGroup ref="revalidationPeriodAttrs">
<xs:annotation>
<xs:documentation>The revalidation period with the origin server for this resource.</xs:documentation>
</xs:annotation>
</xs:attributeGroup>
<xs:attributeGroup ref="compressionAttrs">
<xs:annotation>
<xs:documentation>Compression of this resource by the Multicast server is desired.</xs:documentation>
</xs:annotation>
</xs:attributeGroup>
<xs:anyAttribute processContents="skip"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- -->
<xs:complexType name="ObjectCarouselType">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="PresentationManifests" type="CarouselMediaPresentationResourceType"/>
<xs:element name="InitSegments" type="CarouselMediaPresentationResourceType"/>
<xs:element name="ResourceLocator" type="CarouselResourceLocatorType"/>
</xs:choice>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attributeGroup ref="carouselSizeAttrs"/>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="ReferencingObjectCarouselType">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="PresentationManifests" type="ReferencingCarouselMediaPresentationResourceType"/>
<xs:element name="InitSegments" type="ReferencingCarouselMediaPresentationResourceType"/>
<xs:element name="ResourceLocator" type="CarouselResourceLocatorType"/>
</xs:choice>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attributeGroup ref="carouselSizeAttrs"/>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="MacroDefinitionType">
<xs:annotation>
<xs:documentation>Definition of a macro expansion.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="key" type="xs:NMTOKEN" use="required">
<xs:annotation>
<xs:documentation>The macro key to be expanded.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- -->
<xs:complexType name="BaseMulticastTransportSessionType">
<xs:sequence>
<xs:element name="TransportProtocol" type="MulticastTransportProtocolType"/>
<xs:element name="EndpointAddress" type="MulticastEndpointAddressType" maxOccurs="unbounded"/>
<xs:element name="BitRate" type="BitRateType"/>
<xs:element name="ForwardErrorCorrectionParameters" type="ForwardErrorCorrectionParametersType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="UnicastRepairParameters" type="UnicastRepairParametersType" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="serviceClass" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>A controlled term URI indicating the class of information conveyed by a multicast transport session.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transportSecurity" type="transportSecurityType" default="none">
<xs:annotation>
<xs:documentation>Controls whether the Multicast server adds integrity and/or authenticity metadata to multicast transport objects. Informs the Multicast gateway whether this metadata should be present and verified.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastGatewayConfigurationTransportSessionType">
<xs:complexContent>
<xs:extension base="BaseMulticastTransportSessionType">
<xs:sequence>
<xs:element name="ObjectCarousel" type="ReferencingObjectCarouselType" minOccurs="0">
<xs:annotation>
<xs:documentation>Specifying a carousel of ancillary multicast transport objects to be additionally conveyed by this multicast gateway configuration transport session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastGatewayConfigurationMacro" type="MacroDefinitionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Defining a macro to be expanded by the Multicast server when generating a multicast gateway configuration for inclusion in this multicast gateway configuration transport session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="tags" type="tagAttrType" use="optional">
<xs:annotation>
<xs:documentation>A list of globally unique identifiers that refers to either this multicast gateway configuration transport session or the content carried by it.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastTransportSessionType">
<xs:complexContent>
<xs:extension base="BaseMulticastTransportSessionType">
<xs:sequence>
<xs:element name="ServiceComponentIdentifier" type="ServiceComponentIdentifierType" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A means of referencing a single component of the linear service.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ObjectCarousel" type="ObjectCarouselType" minOccurs="0">
<xs:annotation>
<xs:documentation>Specifying a carousel of ancillary multicast transport objects to be additionally conveyed by this multicast transport session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="id" type="xs:NMTOKEN" use="required"/>
<xs:attribute name="start" type="mpeg7:timePointType" use="optional"/>
<xs:attribute name="duration" type="xs:duration" use="optional"/>
<xs:attribute name="contentIngestMethod" type="contentAcquisitionMethodType" default="pull">
<xs:annotation>
<xs:documentation>Used by the Multicast server to determine whether to pull content for this service component, or expect it to be pushed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transmissionMode" type="transmissionModeType" default="resource">
<xs:annotation>
<xs:documentation>Used by the Multicast server to determine the multicast transmission mode. In "resource" mode, the Multicast server waits until it has acquired a complete resource before attempting to transmit it as a multicast transport object. In "chunked" mode, the Multicast server maps a single acquired chunk to a different multicast transport object.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sessionIdleTimeout" type="xs:positiveInteger" use="required">
<xs:annotation>
<xs:documentation>The time (expressed in milliseconds) that a Multicast gateway should wait for any packet on this multicast transport session before it can assume that the session is over and unsubscribe from the corresponding multicast group. If this attribute is omitted, reception of the multicast session never times out due to a lack of packets, but is still bounded by the transport session duration.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastSessionType">
<xs:annotation>
<xs:documentation>All the multicast transport sessions required to deliver a single linear service according to operational needs.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="PresentationManifestLocator" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>The URL of a presentation manifest hosted on an origin server accessible to the system receiving this multicast session configuration.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="TypedLocatorType">
<xs:attribute name="manifestId" type="xs:NMTOKEN" use="required">
<xs:annotation>
<xs:documentation>An opaque identifier, unique within the lexical scope of this instance document, that identifies this XML element and allows it to be cross-referenced from elsewhere in the same instance document.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transportObjectURI" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>The multicast transport object URI of this presentation manifest when it is carouselled by the Multicast server.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="contentPlaybackPathPattern" type="xs:string">
<xs:annotation>
<xs:documentation>A pattern string used by the Multicast gateway to match the path part of presentation manifest request URLs from a Content playback function with this multicast session. May contain any number of wildcard characters at any position.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="MulticastGatewaySessionReporting" type="SessionReportingType" minOccurs="0">
<xs:annotation>
<xs:documentation>The reporting destination(s) used by the Multicast gateway for all Multicast transport sessions within the scope of this Multicast session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastTransportSession" type="MulticastTransportSessionType" maxOccurs="unbounded"/>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute name="serviceIdentifier" type="xs:anyURI" use="required">
<xs:annotation>
<xs:documentation>A URI that uniquely identifies a multicast session within the deployed system.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="contentPlaybackAvailabilityOffset" type="xs:duration" default="PT0S">
<xs:annotation>
<xs:documentation>The period for which the availability start time of media objects delivered at reference point L should be delayed by the Multicast gateway</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastServerConfigurationType">
<xs:sequence>
<xs:element name="MulticastGatewayConfigurationTransportSession" type="MulticastGatewayConfigurationTransportSessionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>The Multicast gateway configuration can optionally be transmitted via an in-band multicast transport session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastSession" type="MulticastSessionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A set of multicast sessions, each one for a different linear service.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastServerConfigurationMacro" type="MacroDefinitionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Defining a macro to be expanded by the Multicast server when processing the multicast server configuration.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastGatewaySessionReporting" type="SessionReportingType" minOccurs="0">
<xs:annotation>
<xs:documentation>The reporting destination(s) used by the Multicast gateway for all Multicast transport sessions declared within the scope of this multicast server configuration.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute ref="ext:schemaVersion" use="required">
<xs:annotation>
<xs:documentation>The version attribute is intended to be increased by 1 in every future version where new element(s) or attribute(s) are added.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="validityAttrs">
<xs:annotation>
<xs:documentation>Attributes declaring the validity of this Multicast server configuration document and its contents.</xs:documentation>
</xs:annotation>
</xs:attributeGroup>
</xs:complexType>
<!-- -->
<xs:complexType name="MulticastGatewayConfigurationType">
<xs:sequence>
<xs:element name="MulticastGatewayConfigurationTransportSession" type="MulticastGatewayConfigurationTransportSessionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>The Multicast gateway configuration can optionally be transmitted via an in-band multicast transport session.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastSession" type="MulticastSessionType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>A set of multicast sessions, each one for a different linear service.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MulticastGatewaySessionReporting" type="SessionReportingType" minOccurs="0">
<xs:annotation>
<xs:documentation>The reporting destination(s) used by the Multicast gateway for all Multicast transport sessions declared within the scope of this multicast gateway configuration.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="skip" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Designated extension point.</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
<xs:attribute ref="ext:schemaVersion" use="required">
<xs:annotation>
<xs:documentation>The version attribute is intended to be increased by 1 in every future version where new element(s) or attribute(s) are added.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="validityAttrs">
<xs:annotation>
<xs:documentation>Attributes declaring the validity of this Multicast gateway configuration document and its contents.</xs:documentation>
</xs:annotation>
</xs:attributeGroup>
</xs:complexType>
<!-- -->
<xs:element name="MulticastServerConfiguration" type="MulticastServerConfigurationType">
<xs:annotation>
<xs:documentation>A document describing the currently configured Multicast sessions of a Multicast server.</xs:documentation>
</xs:annotation>
</xs:element>
<!-- -->
<xs:element name="MulticastGatewayConfiguration" type="MulticastGatewayConfigurationType">
<xs:annotation>
<xs:documentation>A document describing the currently configured Multicast sessions of a Multicast gateway.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>

View File

@ -0,0 +1,152 @@
using skyscraper5.Ietf.Rfc768;
using skyscraper5.Ietf.Rfc971;
using skyscraper5.Skyscraper.Plugins;
using skyscraper8.Ietf.FLUTE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.DvbNip
{
[SkyscraperPlugin]
internal class DvbNipReceiver : ISkyscraperMpePlugin, IFluteEventHandler
{
private DateTime? contextDate;
private object[] contextConnector;
private DvbNipPhase phase;
private FluteListener flute;
public bool CanHandlePacket(InternetHeader internetHeader, byte[] ipv4Packet)
{
byte[] destinationBytes = internetHeader.DestinationAddress.GetAddressBytes();
int multicastTemp = destinationBytes[0];
multicastTemp &= 0b11100000;
multicastTemp >>= 4;
if (multicastTemp != 0b1110)
return false;
if (internetHeader.Protocol != 17)
return false;
return true;
}
public void ConnectToStorage(object[] connector)
{
contextConnector = connector;
}
public void HandlePacket(InternetHeader internetHeader, byte[] ipv4Packet)
{
UserDatagram udpPacket = new UserDatagram(ipv4Packet);
flute.OnFlutePacket(internetHeader.DestinationAddress, udpPacket.DestinationPort, udpPacket.Payload);
}
public void InformToi(IPAddress destinationAddress, ushort destinationPort, ulong transportObjectIdentifier, ulong transportSessionIdentifier)
{
if (phase == DvbNipPhase.DownloadMode)
{
flute.AddPlay(destinationAddress, destinationPort, transportSessionIdentifier, 0);
}
}
public bool IpFilterEnabled()
{
if (phase == DvbNipPhase.DownloadMode)
return false;
else
return true;
}
public void OnCompletePlay(FluteListener.FlutePlay flutePlay)
{
if (phase == DvbNipPhase.WaitingForSignalling)
{
phase = DvbNipPhase.DownloadMode;
return;
}
else if (phase == DvbNipPhase.DownloadMode)
{
if (!flutePlay.Validate())
{
flutePlay.SetIgnore(true);
flutePlay.SetIgnore(false);
return;
}
if (flutePlay.TOI == 0)
{
FDTInstanceType fdtInstance = FluteUtilities.UnpackFluteFdt(flutePlay.GetStream());
foreach(FileType filetype in fdtInstance.File)
{
flute.SetFileAssociation(flutePlay.IPAddress, flutePlay.Port, flutePlay.TSI, filetype.TOI, filetype);
}
return;
}
else
{
if (flutePlay.FileAssociation.ContentLocation.Equals("urn:dvb:metadata:cs:MulticastTransportObjectTypeCS:2021:gateway-configuration"))
{
MulticastGatewayConfigurationType multicastGatewayConfigurationType = DvbNipUtilities.UnpackMulticastGatewayConfiguration(flutePlay.GetStream());
//TODO: Handle Multicast Gateway configuration
flutePlay.SetIgnore(true);
return;
}
flutePlay.WriteToFile("test.xml");
}
flutePlay.SetIgnore(true);
}
else
{
throw new NotImplementedException(phase.ToString());
}
}
public void OnNipCarrierInformation(NipActualCarrierInformation nipActualCarrierInformation)
{
if (phase == DvbNipPhase.WaitingForCarrierInformation)
{
phase = DvbNipPhase.WaitingForSignalling;
flute.RemoveAllPlays();
flute.AddPlay(IPAddress.Parse("224.0.23.14"), 3937, 0, 0);
}
}
public void SetContext(DateTime? currentTime)
{
contextDate = currentTime;
switch(phase)
{
case DvbNipPhase.JustPoweredUp:
flute = new FluteListener(this);
flute.AddPlay(IPAddress.Parse("224.0.23.14"), 3937, 1, 0);
phase = DvbNipPhase.WaitingForCarrierInformation;
break;
case DvbNipPhase.WaitingForCarrierInformation:
break;
case DvbNipPhase.WaitingForSignalling:
break;
case DvbNipPhase.DownloadMode:
break;
default:
throw new NotImplementedException(phase.ToString());
}
}
public bool StopProcessingAfterThis()
{
return false;
}
private enum DvbNipPhase
{
JustPoweredUp,
WaitingForCarrierInformation,
WaitingForSignalling,
DownloadMode,
}
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace skyscraper8.DvbNip
{
internal class DvbNipUtilities
{
private DvbNipUtilities() { }
private static XmlSerializer multicastGatewayConfigurationXmlSerializer;
public static MulticastGatewayConfigurationType UnpackMulticastGatewayConfiguration(Stream stream)
{
if (multicastGatewayConfigurationXmlSerializer == null)
{
multicastGatewayConfigurationXmlSerializer = new XmlSerializer(typeof(MulticastGatewayConfigurationType));
}
object v = multicastGatewayConfigurationXmlSerializer.Deserialize(stream);
MulticastGatewayConfigurationType result = (MulticastGatewayConfigurationType)v;
return result;
}
}
}

View File

@ -0,0 +1,30 @@
using skyscraper5.Skyscraper.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.DvbNip
{
internal class NipActualCarrierInformation
{
public NipActualCarrierInformation(byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer, false);
NipNetworkId = ms.ReadUInt16BE();
NipCarrierId = ms.ReadUInt16BE();
NipLinkId = ms.ReadUInt16BE();
NipServiceId = ms.ReadUInt16BE();
byte reserved = ms.ReadUInt8();
byte length = ms.ReadUInt8();
NipStreamProviderName = Encoding.UTF8.GetString(ms.ReadBytes(length));
}
public ushort NipNetworkId { get; }
public ushort NipCarrierId { get; }
public ushort NipLinkId { get; }
public ushort NipServiceId { get; }
public string NipStreamProviderName { get; }
}
}

View File

@ -0,0 +1,975 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by xsd, Version=4.8.9037.0.
//
namespace skyscraper8.Ietf.FLUTE {
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.9037.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="FDT-InstanceType", Namespace="urn:IETF:metadata:2005:FLUTE:FDT")]
[System.Xml.Serialization.XmlRootAttribute("FDT-Instance", Namespace="urn:IETF:metadata:2005:FLUTE:FDT", IsNullable=false)]
public partial class FDTInstanceType {
private FileType[] fileField;
private uint schemaVersionField;
private string[] baseURL1Field;
private string[] baseURL2Field;
private sbyte delimiterField;
private string[] groupField;
private MBMSSessionIdentityExpiryType[] mBMSSessionIdentityExpiryField;
private System.Xml.XmlElement[] anyField;
private string expiresField;
private bool completeField;
private bool completeFieldSpecified;
private string contentTypeField;
private string contentEncodingField;
private ulong fECOTIFECEncodingIDField;
private bool fECOTIFECEncodingIDFieldSpecified;
private ulong fECOTIFECInstanceIDField;
private bool fECOTIFECInstanceIDFieldSpecified;
private ulong fECOTIMaximumSourceBlockLengthField;
private bool fECOTIMaximumSourceBlockLengthFieldSpecified;
private ulong fECOTIEncodingSymbolLengthField;
private bool fECOTIEncodingSymbolLengthFieldSpecified;
private ulong fECOTIMaxNumberofEncodingSymbolsField;
private bool fECOTIMaxNumberofEncodingSymbolsFieldSpecified;
private byte[] fECOTISchemeSpecificInfoField;
private bool fullFDTField;
private System.Xml.XmlAttribute[] anyAttrField;
public FDTInstanceType() {
this.fullFDTField = false;
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("File")]
public FileType[] File {
get {
return this.fileField;
}
set {
this.fileField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace="urn:3gpp:metadata:2009:MBMS:schemaVersion")]
public uint schemaVersion {
get {
return this.schemaVersionField;
}
set {
this.schemaVersionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Base-URL-1", Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT", DataType="anyURI")]
public string[] BaseURL1 {
get {
return this.baseURL1Field;
}
set {
this.baseURL1Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Base-URL-2", Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT", DataType="anyURI")]
public string[] BaseURL2 {
get {
return this.baseURL2Field;
}
set {
this.baseURL2Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace="urn:3gpp:metadata:2009:MBMS:schemaVersion")]
public sbyte delimiter {
get {
return this.delimiterField;
}
set {
this.delimiterField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Group")]
public string[] Group {
get {
return this.groupField;
}
set {
this.groupField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("MBMS-Session-Identity-Expiry")]
public MBMSSessionIdentityExpiryType[] MBMSSessionIdentityExpiry {
get {
return this.mBMSSessionIdentityExpiryField;
}
set {
this.mBMSSessionIdentityExpiryField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyElementAttribute()]
public System.Xml.XmlElement[] Any {
get {
return this.anyField;
}
set {
this.anyField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string Expires {
get {
return this.expiresField;
}
set {
this.expiresField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public bool Complete {
get {
return this.completeField;
}
set {
this.completeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool CompleteSpecified {
get {
return this.completeFieldSpecified;
}
set {
this.completeFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-Type")]
public string ContentType {
get {
return this.contentTypeField;
}
set {
this.contentTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-Encoding")]
public string ContentEncoding {
get {
return this.contentEncodingField;
}
set {
this.contentEncodingField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-FEC-Encoding-ID")]
public ulong FECOTIFECEncodingID {
get {
return this.fECOTIFECEncodingIDField;
}
set {
this.fECOTIFECEncodingIDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIFECEncodingIDSpecified {
get {
return this.fECOTIFECEncodingIDFieldSpecified;
}
set {
this.fECOTIFECEncodingIDFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-FEC-Instance-ID")]
public ulong FECOTIFECInstanceID {
get {
return this.fECOTIFECInstanceIDField;
}
set {
this.fECOTIFECInstanceIDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIFECInstanceIDSpecified {
get {
return this.fECOTIFECInstanceIDFieldSpecified;
}
set {
this.fECOTIFECInstanceIDFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Maximum-Source-Block-Length")]
public ulong FECOTIMaximumSourceBlockLength {
get {
return this.fECOTIMaximumSourceBlockLengthField;
}
set {
this.fECOTIMaximumSourceBlockLengthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIMaximumSourceBlockLengthSpecified {
get {
return this.fECOTIMaximumSourceBlockLengthFieldSpecified;
}
set {
this.fECOTIMaximumSourceBlockLengthFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Encoding-Symbol-Length")]
public ulong FECOTIEncodingSymbolLength {
get {
return this.fECOTIEncodingSymbolLengthField;
}
set {
this.fECOTIEncodingSymbolLengthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIEncodingSymbolLengthSpecified {
get {
return this.fECOTIEncodingSymbolLengthFieldSpecified;
}
set {
this.fECOTIEncodingSymbolLengthFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Max-Number-of-Encoding-Symbols")]
public ulong FECOTIMaxNumberofEncodingSymbols {
get {
return this.fECOTIMaxNumberofEncodingSymbolsField;
}
set {
this.fECOTIMaxNumberofEncodingSymbolsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIMaxNumberofEncodingSymbolsSpecified {
get {
return this.fECOTIMaxNumberofEncodingSymbolsFieldSpecified;
}
set {
this.fECOTIMaxNumberofEncodingSymbolsFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Scheme-Specific-Info", DataType="base64Binary")]
public byte[] FECOTISchemeSpecificInfo {
get {
return this.fECOTISchemeSpecificInfoField;
}
set {
this.fECOTISchemeSpecificInfoField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="urn:3GPP:metadata:2008:MBMS:FLUTE:FDT_ext")]
[System.ComponentModel.DefaultValueAttribute(false)]
public bool FullFDT {
get {
return this.fullFDTField;
}
set {
this.fullFDTField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyAttributeAttribute()]
public System.Xml.XmlAttribute[] AnyAttr {
get {
return this.anyAttrField;
}
set {
this.anyAttrField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.9037.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:IETF:metadata:2005:FLUTE:FDT")]
public partial class FileType {
private CacheControl cacheControlField;
private sbyte delimiterField;
private AlternativeContentLocationType[] alternateContentLocation1Field;
private AlternativeContentLocationType[] alternateContentLocation2Field;
private sbyte delimiter1Field;
private string[] groupField;
private byte[] mBMSSessionIdentityField;
private System.Xml.XmlElement[] anyField;
private string contentLocationField;
private string tOIField;
private ulong contentLengthField;
private bool contentLengthFieldSpecified;
private ulong transferLengthField;
private bool transferLengthFieldSpecified;
private string contentTypeField;
private string contentEncodingField;
private byte[] contentMD5Field;
private ulong fECOTIFECEncodingIDField;
private bool fECOTIFECEncodingIDFieldSpecified;
private ulong fECOTIFECInstanceIDField;
private bool fECOTIFECInstanceIDFieldSpecified;
private ulong fECOTIMaximumSourceBlockLengthField;
private bool fECOTIMaximumSourceBlockLengthFieldSpecified;
private ulong fECOTIEncodingSymbolLengthField;
private bool fECOTIEncodingSymbolLengthFieldSpecified;
private ulong fECOTIMaxNumberofEncodingSymbolsField;
private bool fECOTIMaxNumberofEncodingSymbolsFieldSpecified;
private byte[] fECOTISchemeSpecificInfoField;
private string decryptionKEYURIField;
private uint fECRedundancyLevelField;
private bool fECRedundancyLevelFieldSpecified;
private string fileETagField;
private ulong[] independentUnitPositionsField;
private System.Xml.XmlAttribute[] anyAttrField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Cache-Control", Namespace="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT", Order=0)]
public CacheControl CacheControl {
get {
return this.cacheControlField;
}
set {
this.cacheControlField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Namespace="urn:3gpp:metadata:2009:MBMS:schemaVersion", Order=1)]
public sbyte delimiter {
get {
return this.delimiterField;
}
set {
this.delimiterField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Alternate-Content-Location-1", Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT", Order=2)]
public AlternativeContentLocationType[] AlternateContentLocation1 {
get {
return this.alternateContentLocation1Field;
}
set {
this.alternateContentLocation1Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Alternate-Content-Location-2", Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT", Order=3)]
public AlternativeContentLocationType[] AlternateContentLocation2 {
get {
return this.alternateContentLocation2Field;
}
set {
this.alternateContentLocation2Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("delimiter", Namespace="urn:3gpp:metadata:2009:MBMS:schemaVersion", Order=4)]
public sbyte delimiter1 {
get {
return this.delimiter1Field;
}
set {
this.delimiter1Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Group", Order=5)]
public string[] Group {
get {
return this.groupField;
}
set {
this.groupField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("MBMS-Session-Identity", Order=6)]
public byte[] MBMSSessionIdentity {
get {
return this.mBMSSessionIdentityField;
}
set {
this.mBMSSessionIdentityField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyElementAttribute(Order=7)]
public System.Xml.XmlElement[] Any {
get {
return this.anyField;
}
set {
this.anyField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-Location", DataType="anyURI")]
public string ContentLocation {
get {
return this.contentLocationField;
}
set {
this.contentLocationField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(DataType="positiveInteger")]
public string TOI {
get {
return this.tOIField;
}
set {
this.tOIField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-Length")]
public ulong ContentLength {
get {
return this.contentLengthField;
}
set {
this.contentLengthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool ContentLengthSpecified {
get {
return this.contentLengthFieldSpecified;
}
set {
this.contentLengthFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Transfer-Length")]
public ulong TransferLength {
get {
return this.transferLengthField;
}
set {
this.transferLengthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool TransferLengthSpecified {
get {
return this.transferLengthFieldSpecified;
}
set {
this.transferLengthFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-Type")]
public string ContentType {
get {
return this.contentTypeField;
}
set {
this.contentTypeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-Encoding")]
public string ContentEncoding {
get {
return this.contentEncodingField;
}
set {
this.contentEncodingField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Content-MD5", DataType="base64Binary")]
public byte[] ContentMD5 {
get {
return this.contentMD5Field;
}
set {
this.contentMD5Field = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-FEC-Encoding-ID")]
public ulong FECOTIFECEncodingID {
get {
return this.fECOTIFECEncodingIDField;
}
set {
this.fECOTIFECEncodingIDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIFECEncodingIDSpecified {
get {
return this.fECOTIFECEncodingIDFieldSpecified;
}
set {
this.fECOTIFECEncodingIDFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-FEC-Instance-ID")]
public ulong FECOTIFECInstanceID {
get {
return this.fECOTIFECInstanceIDField;
}
set {
this.fECOTIFECInstanceIDField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIFECInstanceIDSpecified {
get {
return this.fECOTIFECInstanceIDFieldSpecified;
}
set {
this.fECOTIFECInstanceIDFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Maximum-Source-Block-Length")]
public ulong FECOTIMaximumSourceBlockLength {
get {
return this.fECOTIMaximumSourceBlockLengthField;
}
set {
this.fECOTIMaximumSourceBlockLengthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIMaximumSourceBlockLengthSpecified {
get {
return this.fECOTIMaximumSourceBlockLengthFieldSpecified;
}
set {
this.fECOTIMaximumSourceBlockLengthFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Encoding-Symbol-Length")]
public ulong FECOTIEncodingSymbolLength {
get {
return this.fECOTIEncodingSymbolLengthField;
}
set {
this.fECOTIEncodingSymbolLengthField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIEncodingSymbolLengthSpecified {
get {
return this.fECOTIEncodingSymbolLengthFieldSpecified;
}
set {
this.fECOTIEncodingSymbolLengthFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Max-Number-of-Encoding-Symbols")]
public ulong FECOTIMaxNumberofEncodingSymbols {
get {
return this.fECOTIMaxNumberofEncodingSymbolsField;
}
set {
this.fECOTIMaxNumberofEncodingSymbolsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECOTIMaxNumberofEncodingSymbolsSpecified {
get {
return this.fECOTIMaxNumberofEncodingSymbolsFieldSpecified;
}
set {
this.fECOTIMaxNumberofEncodingSymbolsFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-OTI-Scheme-Specific-Info", DataType="base64Binary")]
public byte[] FECOTISchemeSpecificInfo {
get {
return this.fECOTISchemeSpecificInfoField;
}
set {
this.fECOTISchemeSpecificInfoField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Decryption-KEY-URI", Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="urn:3GPP:metadata:2009:MBMS:FLUTE:FDT_ext", DataType="anyURI")]
public string DecryptionKEYURI {
get {
return this.decryptionKEYURIField;
}
set {
this.decryptionKEYURIField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("FEC-Redundancy-Level", Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT")]
public uint FECRedundancyLevel {
get {
return this.fECRedundancyLevelField;
}
set {
this.fECRedundancyLevelField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool FECRedundancyLevelSpecified {
get {
return this.fECRedundancyLevelFieldSpecified;
}
set {
this.fECRedundancyLevelFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("File-ETag", Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT")]
public string FileETag {
get {
return this.fileETagField;
}
set {
this.fileETagField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="urn:3GPP:metadata:2015:MBMS:FLUTE:FDT")]
public ulong[] IndependentUnitPositions {
get {
return this.independentUnitPositionsField;
}
set {
this.independentUnitPositionsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyAttributeAttribute()]
public System.Xml.XmlAttribute[] AnyAttr {
get {
return this.anyAttrField;
}
set {
this.anyAttrField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.9037.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT")]
[System.Xml.Serialization.XmlRootAttribute("Cache-Control", Namespace="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT", IsNullable=false)]
public partial class CacheControl {
private object itemField;
private ItemChoiceType itemElementNameField;
private System.Xml.XmlAttribute[] anyAttrField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Expires", typeof(uint))]
[System.Xml.Serialization.XmlElementAttribute("max-stale", typeof(bool))]
[System.Xml.Serialization.XmlElementAttribute("no-cache", typeof(bool))]
[System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
public object Item {
get {
return this.itemField;
}
set {
this.itemField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public ItemChoiceType ItemElementName {
get {
return this.itemElementNameField;
}
set {
this.itemElementNameField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyAttributeAttribute()]
public System.Xml.XmlAttribute[] AnyAttr {
get {
return this.anyAttrField;
}
set {
this.anyAttrField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.9037.0")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:3GPP:metadata:2007:MBMS:FLUTE:FDT", IncludeInSchema=false)]
public enum ItemChoiceType {
/// <remarks/>
Expires,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("max-stale")]
maxstale,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("no-cache")]
nocache,
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.9037.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="MBMS-Session-Identity-Expiry-Type", Namespace="urn:3GPP:metadata:2005:MBMS:FLUTE:FDT")]
public partial class MBMSSessionIdentityExpiryType {
private uint valueField;
private byte valueField1;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public uint value {
get {
return this.valueField;
}
set {
this.valueField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public byte Value {
get {
return this.valueField1;
}
set {
this.valueField1 = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.9037.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(TypeName="Alternative-Content-LocationType", Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT")]
[System.Xml.Serialization.XmlRootAttribute("Alternate-Content-Location-1", Namespace="urn:3GPP:metadata:2012:MBMS:FLUTE:FDT", IsNullable=false)]
public partial class AlternativeContentLocationType {
private string[] alternateContentLocationField;
private System.DateTime availabilityTimeField;
private bool availabilityTimeFieldSpecified;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("Alternate-Content-Location", DataType="anyURI")]
public string[] AlternateContentLocation {
get {
return this.alternateContentLocationField;
}
set {
this.alternateContentLocationField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute("Availability-Time")]
public System.DateTime AvailabilityTime {
get {
return this.availabilityTimeField;
}
set {
this.availabilityTimeField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool AvailabilityTimeSpecified {
get {
return this.availabilityTimeFieldSpecified;
}
set {
this.availabilityTimeFieldSpecified = value;
}
}
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class FdtInstanceHeader
{
public FdtInstanceHeader(uint data)
{
this.Version = (data & 0x00f00000) >> 20;
this.FdtInstanceId = (data & 0x000fffff);
}
public uint Version { get; }
public uint FdtInstanceId { get; }
}
}

View File

@ -0,0 +1,21 @@
using skyscraper5.Skyscraper.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class FecHeader
{
public FecHeader(MemoryStream ms)
{
SourceBlockNumber = ms.ReadUInt16BE();
EncodingSymbolId = ms.ReadUInt16BE();
}
public ushort SourceBlockNumber { get; }
public ushort EncodingSymbolId { get; }
}
}

View File

@ -0,0 +1,26 @@
using skyscraper5.Skyscraper.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class FecObjectTransmissionInformation
{
public FecObjectTransmissionInformation(byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer, false);
TransferLength = ms.ReadUInt48BE();
FecInstanceId = ms.ReadUInt16BE();
EncodingSymbolLength = ms.ReadUInt16BE();
MaximumSourceBlockLength = ms.ReadUInt32BE();
}
public ulong TransferLength { get; }
public ushort FecInstanceId { get; }
public ushort EncodingSymbolLength { get; }
public uint MaximumSourceBlockLength { get; }
}
}

View File

@ -0,0 +1,246 @@
using skyscraper5.Ietf.Rfc768;
using skyscraper5.Ietf.Rfc971;
using skyscraper8.DvbNip;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class FluteListener
{
internal void AddPlay(IPAddress iPAddress, int port, ulong tsi, ulong toi)
{
if (knownFlutePlays == null)
knownFlutePlays = new List<FlutePlay>();
FlutePlay? flutePlay = knownFlutePlays.Find(x => x.IPAddress.Equals(iPAddress) &&
x.Port == port &&
x.TSI == tsi &&
x.TOI == toi);
if (flutePlay != null)
return;
FlutePlay play = new FlutePlay(iPAddress, port, tsi, toi);
knownFlutePlays.Add(play);
}
internal void OnFlutePacket(IPAddress destinationAddress, ushort destinationPort, byte[] payload)
{
if (knownFlutePlays == null)
return;
if (eventHandler.IpFilterEnabled())
{
FlutePlay? ipFound = knownFlutePlays.Find(x => x.IPAddress.Equals(destinationAddress) && x.Port == destinationPort);
if (ipFound == null)
return;
}
LctFrame lctFrame = new LctFrame(payload);
eventHandler.InformToi(destinationAddress, destinationPort, lctFrame.LctHeader.TransportObjectIdentifier, lctFrame.LctHeader.TransportSessionIdentifier);
if (lctFrame.LctHeader.NipActualCarrierInformation != null)
{
eventHandler.OnNipCarrierInformation(lctFrame.LctHeader.NipActualCarrierInformation);
return;
}
FlutePlay? flutePlay = knownFlutePlays.Find(x => x.IPAddress.Equals(destinationAddress) &&
x.Port == destinationPort &&
x.TSI == lctFrame.LctHeader.TransportSessionIdentifier &&
x.TOI == lctFrame.LctHeader.TransportObjectIdentifier);
if (flutePlay == null)
return;
flutePlay.OnPacket(lctFrame);
if (flutePlay.IsComplete())
{
eventHandler.OnCompletePlay(flutePlay);
}
}
internal void RemoveAllPlays()
{
if (knownFlutePlays == null)
return;
knownFlutePlays.Clear();
}
internal void SetFileAssociation(IPAddress iPAddress, int port, ulong tSI, string tOI, FileType filetype)
{
ulong toiNumeric = ulong.Parse(tOI);
FlutePlay? flutePlay = knownFlutePlays.Find(x => x.IPAddress.Equals(iPAddress) &&
x.Port == port &&
x.TSI == tSI &&
x.TOI == toiNumeric);
if (flutePlay != null)
{
flutePlay.FileAssociation = filetype;
}
else
{
AddPlay(iPAddress, port, tSI, toiNumeric);
SetFileAssociation(iPAddress, port, tSI, tOI, filetype);
}
}
private List<FlutePlay> knownFlutePlays;
private IFluteEventHandler eventHandler;
public FluteListener(IFluteEventHandler dvbNipReceiver)
{
this.eventHandler = dvbNipReceiver;
}
public class FlutePlay
{
public FlutePlay(IPAddress iPAddress, int port, ulong tsi, ulong toi)
{
IPAddress = iPAddress;
Port = port;
TSI = tsi;
TOI = toi;
}
public override string ToString()
{
if (ignore)
{
return "<disabled>";
}
return String.Format("IP={0}, Port={1}, TOI={2}, TSI={3}, Name={4}", IPAddress, Port, TOI, TSI, FileAssociation?.ContentLocation);
}
public IPAddress IPAddress { get; private set; }
public ulong TSI { get; private set; }
public ulong TOI { get; private set; }
public int Port { get; }
public FileType FileAssociation { get; internal set; }
private int neededEsi, neededSbn;
private ulong nextX, maxX;
private ulong encodingSymbolLength;
private ulong transferLength;
private byte[][] buffers;
private bool ignore;
internal void OnPacket(LctFrame lctFrame)
{
if (ignore == true)
return;
if (neededEsi == 0 && neededSbn == 0 && lctFrame.FecHeader.EncodingSymbolId == 0 && lctFrame.FecHeader.SourceBlockNumber == 0)
{
nextX = 0;
encodingSymbolLength = lctFrame.LctHeader.FecObjectTransmissionInformation.EncodingSymbolLength;
transferLength = lctFrame.LctHeader.FecObjectTransmissionInformation.TransferLength;
maxX = (transferLength / encodingSymbolLength) + 1;
buffers = new byte[maxX][];
buffers[nextX] = lctFrame.Payload;
neededEsi++;
}
else if (neededEsi != 0 || neededSbn != 0)
{
if (IsComplete())
return;
nextX++;
buffers[nextX] = lctFrame.Payload;
}
}
internal bool IsComplete()
{
if (ignore == true)
return false;
if (buffers == null)
return false;
ulong currentSize = 0;
for (int i = 0; i < buffers.Length; i++)
{
if (buffers[i] == null)
continue;
currentSize += (ulong)buffers[i].Length;
}
return currentSize >= transferLength;
}
public _2DMemoryStream GetStream()
{
return new _2DMemoryStream(buffers);
}
public void WriteToFile(string filename)
{
FileInfo fi = new FileInfo(filename);
if (fi.Exists)
fi.Delete();
FileStream fileStream = fi.OpenWrite();
_2DMemoryStream _2DMemoryStream = GetStream();
_2DMemoryStream.CopyTo(fileStream);
fileStream.Flush();
fileStream.Close();
fileStream.Dispose();
}
internal void SetIgnore(bool v)
{
if (v)
{
for (int i = 0; i < buffers.Length; i++)
{
buffers[i] = null;
}
buffers = null;
ignore = true;
}
else
{
neededEsi = 0;
neededSbn = 0;
nextX = 0;
buffers = new byte[maxX][];
ignore = false;
}
}
public bool Validate()
{
if (buffers.Length == 1)
{
if (buffers[0] != null)
return true;
else
return false;
}
int lengthA = buffers[0].Length;
for (int i = 1; i < buffers.Length; i++)
{
if (buffers[i].Length == lengthA)
continue;
else if (buffers[i].Length < lengthA)
lengthA = buffers[i].Length;
else if (buffers[i].Length > lengthA)
return false;
else
throw new NotImplementedException("Failed to validate a FLUTE play");
}
return true;
}
}
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace skyscraper8.Ietf.FLUTE
{
internal class FluteUtilities
{
private static XmlSerializer fdtSerializer;
public static FDTInstanceType UnpackFluteFdt(byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer, false);
FDTInstanceType result = UnpackFluteFdt(ms);
ms.Close();
ms.Dispose();
return result;
}
public static FDTInstanceType UnpackFluteFdt(Stream ms)
{
if (fdtSerializer == null)
fdtSerializer = new XmlSerializer(typeof(FDTInstanceType));
FDTInstanceType result = (FDTInstanceType)fdtSerializer.Deserialize(ms);
return result;
}
}
}

View File

@ -0,0 +1,18 @@
using skyscraper8.DvbNip;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal interface IFluteEventHandler
{
void InformToi(IPAddress destinationAddress, ushort destinationPort, ulong transportObjectIdentifier, ulong transportSessionIdentifier);
bool IpFilterEnabled();
void OnCompletePlay(FluteListener.FlutePlay flutePlay);
void OnNipCarrierInformation(NipActualCarrierInformation nipActualCarrierInformation);
}
}

View File

@ -0,0 +1,64 @@
using skyscraper5.Skyscraper.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class LctFrame
{
public LctFrame(byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer, false);
byte byteA = ms.ReadUInt8();
this.Version = (byteA & 0xf0) >> 4;
this.CongestionControlFlag = (byteA & 0xc0) >> 2;
this.ProtocolSpecificIndication = (byteA & 0x03);
byte byteB = ms.ReadUInt8();
this.TransportSessionIdentifierFlag = (byteB & 0x80) != 0;
this.TransportObjectIdentifierFlag = (byteB & 0x60) >> 5;
this.HalfWordFlag = (byteB & 0x10) != 0;
int reserved = (byteB & 0x0c) >> 2;
this.CloseSessionFlag = (byteB & 0x02) != 0;
this.CloseObjectFlag = (byteB & 0x01) != 0;
if (this.Version != 1)
throw new NotSupportedException(String.Format("FLUTE Version {0}", Version));
int HeaderLength = ms.ReadUInt8();
HeaderLength *= 4;
HeaderLength -= 4;
this.Codepoint = ms.ReadUInt8();
byte[] headerBuffer = ms.ReadBytes(HeaderLength);
this.LctHeader = new LctHeader(headerBuffer,CongestionControlFlag,TransportSessionIdentifierFlag,TransportObjectIdentifierFlag,HalfWordFlag);
if (ms.GetAvailableBytes() < 4)
return;
this.FecHeader = new FecHeader(ms);
long avails = ms.GetAvailableBytes();
if (avails == 0)
return;
Payload = ms.ReadBytes(ms.GetAvailableBytes());
}
public int Version { get; }
public int CongestionControlFlag { get; }
public int ProtocolSpecificIndication { get; }
public byte Codepoint { get; }
public LctHeader LctHeader { get; }
public bool TransportSessionIdentifierFlag { get; }
public int TransportObjectIdentifierFlag { get; }
public bool HalfWordFlag { get; }
public bool CloseSessionFlag { get; }
public bool CloseObjectFlag { get; }
public FecHeader FecHeader { get; }
public byte[] Payload { get; }
}
}

View File

@ -0,0 +1,100 @@
using skyscraper5.Skyscraper.IO;
using skyscraper8.DvbNip;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class LctHeader
{
/// <summary>
///
/// </summary>
/// <param name="headerBuffer">A buffer that contains an LCT Header starting from the first byte of the Congestion Control Information</param>
/// <param name="c">Congestion control flag</param>
/// <param name="s">Transport Session Identifier flag</param>
/// <param name="o">Transport Object Identifier flag</param>
/// <param name="h">Half-word flag</param>
/// <exception cref="NotSupportedException"></exception>
public LctHeader(byte[] headerBuffer, int c, bool sFlag, int o, bool hFlag)
{
int s = sFlag ? 1 : 0;
int h = hFlag ? 1 : 0;
MemoryStream ms = new MemoryStream(headerBuffer, false);
int cciLength = 32 * (c + 1);
int tsiLength = 32 * s + 16 * h;
int toiLength = 32 * o + 16 * h;
CongestionControlInformation = ReadField(ms, cciLength);
TransportSessionIdentifier = ReadField(ms, tsiLength);
TransportObjectIdentifier = ReadField(ms, toiLength);
while (ms.GetAvailableBytes() >= 1)
{
byte extensionId = ms.ReadUInt8();
if (extensionId >= 128)
{
ms.Position--;
uint fixedHeaderExtension = ms.ReadUInt32BE();
switch (extensionId)
{
case 192:
this.FdtInstanceId = new FdtInstanceHeader(fixedHeaderExtension);
break;
default:
throw new NotImplementedException(String.Format("LCT Header Extension {0}", extensionId));
}
}
else
{
uint headerExtensionLength = ms.ReadUInt8();
headerExtensionLength *= 4;
if (headerExtensionLength >= 2)
headerExtensionLength -= 2;
byte[] extensionBuffer = ms.ReadBytes(headerExtensionLength);
switch(extensionId)
{
case 0:
break;
case 64:
this.FecObjectTransmissionInformation = new FecObjectTransmissionInformation(extensionBuffer);
break;
case 68:
this.NipActualCarrierInformation = new NipActualCarrierInformation(extensionBuffer);
break;
default:
throw new NotImplementedException(String.Format("LCT Header Extension {0}", extensionId));
}
}
}
}
private ulong ReadField(Stream stream, int bits)
{
switch(bits)
{
case 16:
return stream.ReadUInt16BE();
case 32:
return stream.ReadUInt32BE();
case 48:
return stream.ReadUInt48BE();
case 64:
return stream.ReadUInt64BE();
default:
throw new NotImplementedException(String.Format("{0} bits.", bits));
}
}
public ulong CongestionControlInformation { get; private set; }
public ulong TransportSessionIdentifier { get; }
public ulong TransportObjectIdentifier { get; }
public FdtInstanceHeader FdtInstanceId { get; }
public NipActualCarrierInformation NipActualCarrierInformation { get; }
public FecObjectTransmissionInformation FecObjectTransmissionInformation { get; }
}
}

View File

@ -0,0 +1,149 @@
using skyscraper5.Dvb.DataBroadcasting.Biop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Ietf.FLUTE
{
internal class _2DMemoryStream : Stream
{
public _2DMemoryStream(byte[][] backing)
{
this.backing = backing;
this.myModuleLength = backing.Select(x => x.Length).Sum();
}
private byte[][] backing;
private long currentPosition;
private long myModuleLength;
public override void Flush()
{
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private int GetRequiredBlockId(long position)
{
for (int i = 0; i < backing.Length; i++)
{
if (backing[i].Length > position)
{
return i;
}
position -= backing[i].Length;
}
throw new ArgumentOutOfRangeException(nameof(position));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private int GetOffsetInBlock(long position)
{
for (int i = 0; i < backing.Length; i++)
{
if (backing[i].Length > position)
{
return (int)position;
}
position -= backing[i].Length;
}
throw new ArgumentOutOfRangeException(nameof(position));
}
public override int Read(byte[] buffer, int offset, int count)
{
if (closed)
{
throw new ObjectDisposedException("This module is already disposed.");
}
if (Position + count > Length)
{
count = (int)(Length - Position);
}
if (Position == Length)
return 0;
int requiredBlockId = GetRequiredBlockId(currentPosition);
int offsetInBlock = GetOffsetInBlock(currentPosition);
int remainingInBlock = backing[requiredBlockId].Length - offsetInBlock;
int bytesToCopy = Math.Min(remainingInBlock, count);
int stillNeededToCopy = count - bytesToCopy;
Array.Copy(backing[requiredBlockId], offsetInBlock, buffer, offset, bytesToCopy);
Position += bytesToCopy;
int result = bytesToCopy;
offset += bytesToCopy;
count -= bytesToCopy;
while (stillNeededToCopy > 0)
{
requiredBlockId++;
offsetInBlock = 0;
remainingInBlock = backing[requiredBlockId].Length - offsetInBlock;
bytesToCopy = Math.Min(remainingInBlock, count);
stillNeededToCopy = count - bytesToCopy;
Array.Copy(backing[requiredBlockId], offsetInBlock, buffer, offset, bytesToCopy);
Position += bytesToCopy;
result += bytesToCopy;
offset += bytesToCopy;
count -= bytesToCopy;
}
return result;
}
public override long Seek(long offset, SeekOrigin origin)
{
switch (origin)
{
case SeekOrigin.Begin:
currentPosition = offset;
break;
case SeekOrigin.Current:
currentPosition += offset;
break;
case SeekOrigin.End:
currentPosition = Length + offset;
break;
default:
throw new NotImplementedException(origin.ToString());
}
return currentPosition;
}
public override void SetLength(long value)
{
throw new NotSupportedException("Can't modify the length of a 2DArray");
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException("Can't write to a 2DArray");
}
public override bool CanRead => true;
public override bool CanSeek => true;
public override bool CanWrite => false;
public override long Length => myModuleLength;
public override long Position
{
get => currentPosition;
set => Seek(value, SeekOrigin.Begin);
}
public override bool CanTimeout => false;
private bool closed;
public override void Close()
{
closed = true;
}
}
}

View File

@ -2,7 +2,7 @@
"profiles": {
"skyscraper8": {
"commandName": "Project",
"commandLineArgs": "file-live \"C:\\Temp\\Astra1_12604_v_SGT-000000.ts\"",
"commandLineArgs": "file-live \"C:\\Temp\\dvbnip-000000.ts\"",
"remoteDebugEnabled": false
},
"Container (Dockerfile)": {

View File

@ -67,6 +67,15 @@ namespace skyscraper5.Skyscraper.IO
return BitConverter.ToInt32(buffer, 0);
}
public static ulong ReadUInt48BE(this Stream stream)
{
ulong result = 0;
result = ReadUInt16BE(stream);
result <<= 32;
result += ReadUInt32BE(stream);
return result;
}
public static long ReadInt64LE(this Stream stream)
{
if (stream.Read(buffer, 0, 8) != 8)