PageRenderTime 31ms CodeModel.GetById 23ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/schemas/flv.xsd

https://code.google.com/
XML Schema | 123 lines | 110 code | 13 blank | 0 comment | 0 complexity | 3b56e600458f1adc1e95deeb05dd2809 MD5 | raw file
  1<?xml version="1.0" encoding="utf-8"?>
  2<xs:schema targetNamespace="http://schemas.flvmeta.org/FLV/1.0/"
  3    elementFormDefault="qualified"
  4    xmlns="http://schemas.flvmeta.org/FLV/1.0/"
  5    xmlns:amf="http://schemas.flvmeta.org/AMF0/1.0/"
  6    xmlns:xs="http://www.w3.org/2001/XMLSchema"
  7>
  8  <xs:import namespace="http://schemas.flvmeta.org/AMF0/1.0/" schemaLocation="Amf0.xsd"/>
  9
 10  <xs:element name="flv">
 11    <xs:complexType>
 12      <xs:sequence>
 13        <xs:element name="tag" type="tFlvTag" minOccurs="0" maxOccurs="unbounded"/>
 14      </xs:sequence>
 15      <xs:attribute name="version" use="optional" fixed="1" />
 16      <xs:attribute name="hasVideo" use="optional" type="xs:boolean" default="1"/>
 17      <xs:attribute name="hasAudio" use="optional" type="xs:boolean" default="1"/>
 18    </xs:complexType>
 19  </xs:element>
 20
 21  <xs:complexType name="tFlvTag">
 22    <xs:choice>
 23      <xs:element name="videoData" type="tVideoData"/>
 24      <xs:element name="audioData" type="tAudioData"/>
 25      <xs:element name="scriptDataObject" type="tScriptDataObject"/>
 26    </xs:choice>
 27    <xs:attribute name="type" type="tTagType" use="required"/>
 28    <xs:attribute name="dataSize" type="xs:nonNegativeInteger" use="optional"/>
 29    <xs:attribute name="timestamp" type="xs:nonNegativeInteger" use="required"/>
 30    <xs:attribute name="streamID" type="xs:nonNegativeInteger" use="optional" fixed="0"/>
 31    <xs:attribute name="offset" type="xs:nonNegativeInteger" use="required"/>
 32  </xs:complexType>
 33
 34  <xs:simpleType name="tTagType">
 35    <xs:restriction base="xs:string">
 36      <xs:enumeration value="audio"/>
 37      <xs:enumeration value="video"/>
 38      <xs:enumeration value="scriptData"/>
 39    </xs:restriction>
 40  </xs:simpleType>
 41  
 42  <xs:complexType name="tAudioData">
 43    <xs:attribute name="format" use="required" type="tAudioFormat"/>
 44    <xs:attribute name="rate" use="required" type="tAudioRate"/>
 45    <xs:attribute name="size" use="required" type="tAudioSize"/>
 46    <xs:attribute name="type" use="required" type="tAudioType"/>
 47  </xs:complexType>
 48
 49  <xs:simpleType name="tAudioFormat">
 50    <xs:restriction base="xs:string">
 51      <xs:enumeration value="Linear PCM, platform endian"/>
 52      <xs:enumeration value="ADPCM"/>
 53      <xs:enumeration value="MP3"/>
 54      <xs:enumeration value="Linear PCM, little endian"/>
 55      <xs:enumeration value="Nellymoser 16-kHz mono"/>
 56      <xs:enumeration value="Nellymoser 8-kHz mono"/>
 57      <xs:enumeration value="Nellymoser"/>
 58      <xs:enumeration value="G.711 A-law logarithmic PCM"/>
 59      <xs:enumeration value="G.711 mu-law logarithmic PCM"/>
 60      <xs:enumeration value="reserved"/>
 61      <xs:enumeration value="AAC"/>
 62      <xs:enumeration value="Speex"/>
 63      <xs:enumeration value="MP3 8-Khz"/>
 64      <xs:enumeration value="Device-specific sound"/>
 65    </xs:restriction>
 66  </xs:simpleType>
 67
 68  <xs:simpleType name="tAudioRate">
 69    <xs:restriction base="xs:float">
 70      <xs:enumeration value="5.5"/>
 71      <xs:enumeration value="11"/>
 72      <xs:enumeration value="22"/>
 73      <xs:enumeration value="44"/>
 74    </xs:restriction>
 75  </xs:simpleType>
 76
 77  <xs:simpleType name="tAudioSize">
 78    <xs:restriction base="xs:integer">
 79      <xs:enumeration value="8"/>
 80      <xs:enumeration value="16"/>
 81    </xs:restriction>
 82  </xs:simpleType>
 83
 84  <xs:simpleType name="tAudioType">
 85    <xs:restriction base="xs:string">
 86      <xs:enumeration value="mono"/>
 87      <xs:enumeration value="stereo"/>
 88    </xs:restriction>
 89  </xs:simpleType>
 90
 91  <xs:complexType name="tVideoData">
 92    <xs:attribute name="frameType" use="required" type="tFrameType"/>
 93    <xs:attribute name="codecID" use="required" type="tVideoCodec"/>
 94  </xs:complexType>
 95
 96  <xs:simpleType name="tFrameType">
 97    <xs:restriction base="xs:string">
 98      <xs:enumeration value="keyframe"/>
 99      <xs:enumeration value="inter frame"/>
100      <xs:enumeration value="disposable inter frame"/>
101      <xs:enumeration value="generated keyframe"/>
102      <xs:enumeration value="video info/command frame"/>
103    </xs:restriction>
104  </xs:simpleType>
105
106  <xs:simpleType name="tVideoCodec">
107    <xs:restriction base="xs:string">
108      <xs:enumeration value="JPEG"/>
109      <xs:enumeration value="Sorenson H.263"/>
110      <xs:enumeration value="Screen video"/>
111      <xs:enumeration value="On2 VP6"/>
112      <xs:enumeration value="On2 VP6 with alpha channel"/>
113      <xs:enumeration value="Screen video version 2"/>
114      <xs:enumeration value="AVC"/>
115    </xs:restriction>
116  </xs:simpleType>
117
118  <xs:complexType name="tScriptDataObject">
119    <xs:group ref="amf:tData" />
120    <xs:attribute name="name" use="required" type="xs:string" />
121  </xs:complexType>
122
123</xs:schema>