6 1. You can use the <include ref="..." /> directive to include another file
8 2. Profiles are prioritised in the order that they are read (i.e. if A follows
9 B and a stream matches both A and B, it is assumed to be of profile A.
17 This is a vanilla example to show what a basic profile would look like.
21 "name" is the DLNA profile name and "mime", the DLNA MIME type. These 2
22 fields are mandatory for every dlna-profile.
24 <dlna-profile name="MP3" mime="audio/mpeg">
26 Here the "type" corresponds to the stream type -
27 video/audio/container/...
29 <restriction type="audio">
30 <!-- The name field is mandatory for all restrictions -->
31 <field name="name" type="string">
32 <value>audio/mpeg</value>
35 <!-- "name" and "type" are mandatory for every field -->
36 <field name="mpegversion" type="int">
37 <!-- mpegversion = (int) 1 -->
41 <field name="layer" type="int">
42 <!-- layer = (int) 3 -->
46 <field name="channels" type="int">
47 <!-- channels = (int) [ 1, 2 ] -->
48 <range min="1" max="2" />
51 <field name="rate" type="int">
52 <!-- rate = (int) { 32000, 44100, 48000 } -->
58 <field name="bitrate" type="int">
59 <!-- bitrate = (int) [ 32000, 320000 ] -->
60 <range min="32000" max="320000" />
67 EXAMPLE 2: AVC_MP4_BL_CIF15_AAC_520
69 This one is a little more complicated. The video profile is composed of a
70 container (systems portion), audio and video restrictions. In addition to
71 this, each portion might occur in multiple profiles (for example, all the
72 AVC_MP4_* profiles use the "MP4" systems portion.
74 We tackle this by defining a global restrictions section first, where all
75 the common bits are defined. Reusing these is helpful for the MPEG-2 and
76 MPEG-4 profiles which have several commonalities.
80 Since several profiles share common restrictions, we define these
84 <!-- First, some common restrictions for reuse -->
85 <restriction type="video" id="CIF">
86 <field name="height" type="int">
89 <field name="width" type="int">
94 <restriction type="video" id="QVGA_4:3">
95 <field name="height" type="int">
98 <field name="width" type="int">
103 <!-- and others, like QCIF, VGA, ... -->
105 <restriction type="video" id="AVC_L1.2">
106 <!-- This one doesn't exist yet -->
107 <field name="avclevel" type="string">
115 <!-- and define other profiles and levels too -->
117 <!-- Now, some "base classes" for the profiles -->
119 <restriction type="container" id="MP4">
120 <!-- MP4 container ("systems" profile) -->
121 <field name="name" type="string">
122 <value>audio/x-m4a</value>
126 <restriction type="video" id="BL">
127 <!-- AVC baseline profile -->
128 <field name="name" type="string">
129 <value>video/x-h264</value>
132 <!-- This one doesn't exist yet -->
133 <field name="avcprofile" type="string">
134 <value>baseline</value>
137 <field name="format" type="fourcc">
138 <!-- Possible values with 4:2:0 format -->
145 The "parent" tag allows you to reuse all the caps of a given restriction
146 and then specify fields you want to append (if they are not present in
147 the parent) or override (if they are).
149 If there are multiple parents, the resultant restriction is the union of
152 Note: The multiple-inheritance works differently for <dlna-profile>s
154 <restriction type="video" id="BL_L1.2">
156 <parent name="AVC_L1.2" />
159 <restriction type="video" id="BL_L1.2_CIF">
160 <parent name="BL_L1.2" />
161 <parent name="CIF" />
163 <field name="framerate" type="fraction">
168 <restriction type="video" id="BL_L1.2_QVGA_4:3">
169 <parent name="BL_L1.2" />
170 <parent name="QVGA_4:3" />
172 <field name="framerate" type="fraction">
178 Define BL_L1.2_525SIF, BL_L1.2_QVGA_16:9, ... in a similar fashion
181 <!-- For audio, assume that AAC, AAC_LTP, AAC_520 are defined -->
184 <!-- Finally, AVC_MP4_BL_CIF15_AAC_520 is defined here -->
185 <dlna-profile name="AVC_MP4_BL_CIF15_AAC_520" mime="video/mp4" id="AVC">
187 <parent name="MP4" />
189 <parent name="AAC_520" />
192 If a profile has multiple parents of the same stream type (video in this
193 case), it is sufficient for the media to match *any one* of these.
195 Note: This is different from how multiple parents behave for
198 <parent name="BL_L1.2_CIF" />
199 <parent name="BL_L1.2_QVGA_4:3" />
204 Same restrictions, differnt container - use the base-profile attribute. You
205 can also append more restrictions, but you cannot override anything other
208 <dlna-profile name="AVC_MP4_BL_CIF15_AAC_520" mime="video/mp4" base-profile="AVC">
209 <!-- override container -->
210 <restriction type="container">
211 <field name="name" type="string">
212 <value>video/quicktime</value>