Remove now unnecessary files as everything is implemented in xcbgen.
[free-sw/xcb/proto] / src / xv.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) 2006 Jeremy Kolb.
4 All Rights Reserved.
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the names of the authors or their
24 institutions shall not be used in advertising or otherwise to promote the
25 sale, use or other dealings in this Software without prior written
26 authorization from the authors.
27 -->
28
29 <xcb header="xv" extension-xname="XVideo" extension-name="Xv" major-version="2" minor-version="2">
30     <import>xproto</import>
31     <import>shm</import>
32     <!-- Implements version 2.2 of XV -->
33
34     <!-- XIDs -->
35     <xidtype name="PORT" />
36     <xidtype name="ENCODING" />
37
38     <enum name="Type">
39         <item name="InputMask"><bit>0</bit></item>
40         <item name="OutputMask"><bit>1</bit></item>
41         <item name="VideoMask"><bit>2</bit></item>
42         <item name="StillMask"><bit>3</bit></item>
43         <item name="ImageMask"><bit>4</bit></item>
44     </enum>
45
46     <enum name="ImageFormatInfoType">
47         <item name="RGB" />
48         <item name="YUV" />
49     </enum>
50
51     <enum name="ImageFormatInfoFormat">
52         <item name="Packed" />
53         <item name="Planar" />
54     </enum>
55
56     <enum name="AttributeFlag">
57         <item name="Gettable"><bit>0</bit></item>
58         <item name="Settable"><bit>1</bit></item>
59     </enum>
60     
61     <enum name="VideoNotifyReason">
62         <item name="Started" />
63         <item name="Stopped" />
64         <item name="Busy" />
65         <item name="Preempted" />
66         <item name="HardError" />
67     </enum>
68
69     <enum name="ScanlineOrder">
70         <item name="TopToBottom" />
71         <item name="BottomToTop" />
72     </enum>
73
74     <enum name="GrabPortStatus">
75         <item name="Success" />
76         <item name="BadExtension" />
77         <item name="AlreadyGrabbed" />
78         <item name="InvalidTime" />
79         <item name="BadReply" />
80         <item name="BadAlloc" />
81     </enum>
82
83     <struct name="Rational">
84         <field type="INT32" name="numerator" />
85         <field type="INT32" name="denominator" />
86     </struct>
87
88     <struct name="Format">
89         <field type="VISUALID" name="visual" />
90         <field type="CARD8" name="depth" />
91         <pad bytes="3" />
92     </struct>
93
94     <struct name="AdaptorInfo">
95         <field type="PORT" name="base_id" />
96         <field type="CARD16" name="name_size" />
97         <field type="CARD16" name="num_ports" />
98         <field type="CARD16" name="num_formats" />
99         <field type="CARD8" name="type" mask="Type" />
100         <pad bytes="1" />
101         <list type="char" name="name">
102             <fieldref>name_size</fieldref>
103         </list>
104         <list type="Format" name="formats">
105             <fieldref>num_formats</fieldref>
106         </list>
107
108     </struct>
109
110     <struct name="EncodingInfo">
111         <field type="ENCODING" name="encoding" />
112         <field type="CARD16" name="name_size" />
113         <field type="CARD16" name="width" />
114         <field type="CARD16" name="height" />
115         <!--
116         Some versions of Xvproto.h incorrectly have
117         this padding after "rate".
118         -->
119         <pad bytes="2" />
120         <field type="Rational" name="rate" />
121         <list type="char" name="name">
122             <fieldref>name_size</fieldref>
123         </list>
124     </struct>
125
126     <struct name="Image">
127         <field type="CARD32" name="id" />
128         <field type="CARD16" name="width" />
129         <field type="CARD16" name="height" />
130         <field type="CARD32" name="data_size" />
131         <field type="CARD32" name="num_planes" />
132         <list type="CARD32" name="pitches">
133             <fieldref>num_planes</fieldref>
134         </list>
135         <list type="CARD32" name="offsets">
136             <fieldref>num_planes</fieldref>
137         </list>
138         <list type="CARD8" name="data">
139             <fieldref>data_size</fieldref>
140         </list>
141         <!-- Some XPointer "obdata" for SHM use-->
142     </struct>
143     
144     <struct name="AttributeInfo">
145         <field type="CARD32" name="flags" mask="AttributeFlag" />
146         <field type="INT32" name="min" />
147         <field type="INT32" name="max" />
148         <field type="CARD32" name="size" />
149         <list type="char" name="name">
150             <fieldref>size</fieldref>
151         </list>
152     </struct>
153
154     <struct name="ImageFormatInfo">
155         <field type="CARD32" name="id" />
156         <field type="CARD8" name="type" enum="ImageFormatInfoType" />
157         <field type="CARD8" name="byte_order" enum="ImageOrder" />
158         <pad bytes="2" />
159         <list type="CARD8" name="guid">
160             <value>16</value>
161         </list>
162         <field type="CARD8" name="bpp" />
163         <field type="CARD8" name="num_planes" />
164         <pad bytes="2" />
165         <field type="CARD8" name="depth" />
166         <pad bytes="3" />
167         <field type="CARD32" name="red_mask" />
168         <field type="CARD32" name="green_mask" />
169         <field type="CARD32" name="blue_mask" />
170         <field type="CARD8" name="format" enum="ImageFormatInfoFormat" />
171         <pad bytes="3" />
172         <field type="CARD32" name="y_sample_bits" />
173         <field type="CARD32" name="u_sample_bits" />
174         <field type="CARD32" name="v_sample_bits" />
175         <field type="CARD32" name="vhorz_y_period" />
176         <field type="CARD32" name="vhorz_u_period" />
177         <field type="CARD32" name="vhorz_v_period" />
178         <field type="CARD32" name="vvert_y_period" />
179         <field type="CARD32" name="vvert_u_period" />
180         <field type="CARD32" name="vvert_v_period" />
181         <list type="CARD8" name="vcomp_order">
182             <value>32</value>
183         </list>
184         <field type="CARD8" name="vscanline_order" enum="ScanlineOrder" />
185         <pad bytes="11" />
186     </struct>
187
188
189     <!-- Errors -->
190     <error name="BadPort" number="0"/>
191     <error name="BadEncoding" number="1"/>
192     <error name="BadControl" number="2"/>
193
194     <!-- Events -->
195     <event name="VideoNotify" number="0">
196         <field type="BYTE" name="reason" enum="VideoNotifyReason" />
197         <field type="TIMESTAMP" name="time" />
198         <field type="DRAWABLE" name="drawable" />
199         <field type="PORT" name="port" />
200     </event>
201
202     <event name="PortNotify" number="1">
203         <pad bytes="1" />
204         <field type="TIMESTAMP" name="time" />
205         <field type="PORT" name="port" />
206         <field type="ATOM" name="attribute" />
207         <field type="INT32" name="value" />
208     </event>
209     
210     
211     <!-- Requests -->
212     <request name="QueryExtension" opcode="0">
213         <reply>
214             <pad bytes="1" />
215             <field type="CARD16" name="major" />
216             <field type="CARD16" name="minor" />
217         </reply>
218     </request>
219
220     <request name="QueryAdaptors" opcode="1">
221         <field type="WINDOW" name="window" />
222         <reply>
223             <pad bytes="1" />
224             <field type="CARD16" name="num_adaptors" />
225             <pad bytes="22" />
226             <list type="AdaptorInfo" name="info">
227                 <fieldref>num_adaptors</fieldref>
228             </list>
229         </reply>
230     </request>
231
232     <request name="QueryEncodings" opcode="2">
233         <field type="PORT" name="port" />
234         <reply>
235             <pad bytes="1" />
236             <field type="CARD16" name="num_encodings" />
237             <!--
238             In Xvproto.h this padding is 24 bytes
239             in actuality it is 22 bytes
240             -->
241             <pad bytes="22" />
242             <list type="EncodingInfo" name="info">
243                 <fieldref>num_encodings</fieldref>
244             </list>
245         </reply>
246     </request>
247
248     <request name="GrabPort" opcode="3">
249         <field type="PORT" name="port" />
250         <field type="TIMESTAMP" name="time" altenum="Time" />
251         <reply>
252             <field type="BYTE" name="result" enum="GrabPortStatus" />
253         </reply>
254     </request>
255
256     <request name="UngrabPort" opcode="4">
257         <field type="PORT" name="port" />
258         <field type="TIMESTAMP" name="time" altenum="Time" />
259     </request>
260
261     <request name="PutVideo" opcode="5">
262         <field type="PORT" name="port" />
263         <field type="DRAWABLE" name="drawable" />
264         <field type="GCONTEXT" name="gc" />
265         <field type="INT16" name="vid_x" />
266         <field type="INT16" name="vid_y" />
267         <field type="CARD16" name="vid_w" />
268         <field type="CARD16" name="vid_h" />
269         <field type="INT16" name="drw_x" />
270         <field type="INT16" name="drw_y" />
271         <field type="CARD16" name="drw_w" />
272         <field type="CARD16" name="drw_h" />
273     </request>
274
275     <request name="PutStill" opcode="6">
276         <field type="PORT" name="port" />
277         <field type="DRAWABLE" name="drawable" />
278         <field type="GCONTEXT" name="gc" />
279         <field type="INT16" name="vid_x" />
280         <field type="INT16" name="vid_y" />
281         <field type="CARD16" name="vid_w" />
282         <field type="CARD16" name="vid_h" />
283         <field type="INT16" name="drw_x" />
284         <field type="INT16" name="drw_y" />
285         <field type="CARD16" name="drw_w" />
286         <field type="CARD16" name="drw_h" />
287     </request>
288
289     <request name="GetVideo" opcode="7">
290         <field type="PORT" name="port" />
291         <field type="DRAWABLE" name="drawable" />
292         <field type="GCONTEXT" name="gc" />
293         <field type="INT16" name="vid_x" />
294         <field type="INT16" name="vid_y" />
295         <field type="CARD16" name="vid_w" />
296         <field type="CARD16" name="vid_h" />
297         <field type="INT16" name="drw_x" />
298         <field type="INT16" name="drw_y" />
299         <field type="CARD16" name="drw_w" />
300         <field type="CARD16" name="drw_h" />
301     </request>
302
303     <request name="GetStill" opcode="8">
304         <field type="PORT" name="port" />
305         <field type="DRAWABLE" name="drawable" />
306         <field type="GCONTEXT" name="gc" />
307         <field type="INT16" name="vid_x" />
308         <field type="INT16" name="vid_y" />
309         <field type="CARD16" name="vid_w" />
310         <field type="CARD16" name="vid_h" />
311         <field type="INT16" name="drw_x" />
312         <field type="INT16" name="drw_y" />
313         <field type="CARD16" name="drw_w" />
314         <field type="CARD16" name="drw_h" />
315     </request>
316
317     <request name="StopVideo" opcode="9">
318         <field type="PORT" name="port" />
319         <field type="DRAWABLE" name="drawable" />
320     </request>
321
322     <request name="SelectVideoNotify" opcode="10">
323         <field type="DRAWABLE" name="drawable" />
324         <field type="BOOL" name="onoff" />
325         <pad bytes="3" />
326     </request>
327
328     <request name="SelectPortNotify" opcode="11">
329         <field type="PORT" name="port" />
330         <field type="BOOL" name="onoff" />
331         <pad bytes="3" />
332     </request>
333
334     <request name="QueryBestSize" opcode="12">
335         <field type="PORT" name="port" />
336         <field type="CARD16" name="vid_w" />
337         <field type="CARD16" name="vid_h" />
338         <field type="CARD16" name="drw_w" />
339         <field type="CARD16" name="drw_h" />
340         <field type="BOOL" name="motion" />
341         <pad bytes="3" />
342         <reply>
343             <pad bytes="1" />
344             <field type="CARD16" name="actual_width" />
345             <field type="CARD16" name="actual_height" />
346         </reply>
347     </request>
348
349     <request name="SetPortAttribute" opcode="13">
350         <field type="PORT" name="port" />
351         <field type="ATOM" name="attribute" />
352         <field type="INT32" name="value" />
353     </request>
354
355     <request name="GetPortAttribute" opcode="14">
356         <field type="PORT" name="port" />
357         <field type="ATOM" name="attribute" />
358         <reply>
359             <pad bytes="1" />
360             <field type="INT32" name="value" />
361         </reply>
362     </request>
363
364     <!-- Not in the docs beyond this point :( -->
365
366     <request name="QueryPortAttributes" opcode="15">
367         <field type="PORT" name="port" />
368         <reply>
369             <pad bytes="1" />
370             <field type="CARD32" name="num_attributes" />
371             <field type="CARD32" name="text_size" />
372             <pad bytes="16" />
373             <list type="AttributeInfo" name="attributes">
374                 <fieldref>num_attributes</fieldref>
375             </list>
376         </reply>
377     </request>
378
379     <request name="ListImageFormats" opcode="16">
380         <field type="PORT" name="port" />
381         <reply>
382             <pad bytes="1" />
383             <field type="CARD32" name="num_formats" />
384             <pad bytes="20" />
385             <list type="ImageFormatInfo" name="format">
386                 <fieldref>num_formats</fieldref>
387             </list>
388         </reply>
389     </request>
390
391     <request name="QueryImageAttributes" opcode="17">
392         <field type="PORT" name="port" />
393         <field type="CARD32" name="id" />
394         <field type="CARD16" name="width" />
395         <field type="CARD16" name="height" />
396         <reply>
397             <pad bytes="1" />
398             <field type="CARD32" name="num_planes" />
399             <field type="CARD32" name="data_size" />
400             <field type="CARD16" name="width" />
401             <field type="CARD16" name="height" />
402             <pad bytes="12" />
403             <list type="CARD32" name="pitches">
404                 <fieldref>num_planes</fieldref>
405             </list>
406             <list type="CARD32" name="offsets">
407                 <fieldref>num_planes</fieldref>
408             </list>
409         </reply>
410     </request>
411
412     <request name="PutImage" opcode="18">
413         <field type="PORT" name="port" />
414         <field type="DRAWABLE" name="drawable" />
415         <field type="GCONTEXT" name="gc" />
416         <field type="CARD32" name="id" />
417         <field type="INT16" name="src_x" />
418         <field type="INT16" name="src_y" />
419         <field type="CARD16" name="src_w" />
420         <field type="CARD16" name="src_h" />
421         <field type="INT16" name="drw_x" />
422         <field type="INT16" name="drw_y" />
423         <field type="CARD16" name="drw_w" />
424         <field type="CARD16" name="drw_h" />
425         <field type="CARD16" name="width" />
426         <field type="CARD16" name="height" />
427         <list type="CARD8" name="data" />
428     </request>
429
430     <request name="ShmPutImage" opcode="19">
431         <field type="PORT" name="port" />
432         <field type="DRAWABLE" name="drawable" />
433         <field type="GCONTEXT" name="gc" />
434         <field type="SEG" name="shmseg" />
435         <field type="CARD32" name="id" />
436         <field type="CARD32" name="offset" />
437         <field type="INT16" name="src_x" />
438         <field type="INT16" name="src_y" />
439         <field type="CARD16" name="src_w" />
440         <field type="CARD16" name="src_h" />
441         <field type="INT16" name="drw_x" />
442         <field type="INT16" name="drw_y" />
443         <field type="CARD16" name="drw_w" />
444         <field type="CARD16" name="drw_h" />
445         <field type="CARD16" name="width" />
446         <field type="CARD16" name="height" />
447         <field type="CARD8" name="send_event" />
448         <pad bytes="3" />
449     </request>
450 </xcb>