1 /***********************************************************
2 Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
3 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Digital or MIT not be
12 used in advertising or publicity pertaining to distribution of the
13 software without specific, written prior permission.
15 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23 ******************************************************************/
30 ** Xvlib.h --- Xv library public header file
34 ** David Carver (Digital Workstation Engineering/Project Athena)
39 ** - changed XvFreeAdaptors to XvFreeAdaptorInfo
40 ** - changed XvFreeEncodings to XvFreeEncodingInfo
43 ** - changed SetPortControl to SetPortAttribute
44 ** - changed GetPortControl to GetPortAttribute
45 ** - changed QueryBestSize
48 ** - version 2.0 upgrade
51 ** - version 1.4 upgrade
55 #include <X11/Xfuncproto.h>
56 #include <X11/extensions/Xv.h>
57 #include <X11/extensions/XShm.h>
65 int flags; /* XvGettable, XvSettable */
72 XvEncodingID encoding_id;
77 unsigned long num_encodings;
82 unsigned long visual_id;
87 unsigned long num_ports;
90 unsigned long num_formats;
92 unsigned long num_adaptors;
97 unsigned long serial; /* # of last request processed by server */
98 Bool send_event; /* true if this came from a SendEvent request */
99 Display *display; /* Display the event was read from */
100 Drawable drawable; /* drawable */
101 unsigned long reason; /* what generated this event */
102 XvPortID port_id; /* what port */
103 Time time; /* milliseconds */
104 } XvVideoNotifyEvent;
108 unsigned long serial; /* # of last request processed by server */
109 Bool send_event; /* true if this came from a SendEvent request */
110 Display *display; /* Display the event was read from */
111 XvPortID port_id; /* what port */
112 Time time; /* milliseconds */
113 Atom attribute; /* atom that identifies attribute */
114 long value; /* value of attribute */
119 XvVideoNotifyEvent xvvideo;
120 XvPortNotifyEvent xvport;
125 int id; /* Unique descriptor for the format */
126 int type; /* XvRGB, XvYUV */
127 int byte_order; /* LSBFirst, MSBFirst */
128 char guid[16]; /* Globally Unique IDentifier */
130 int format; /* XvPacked, XvPlanar */
133 /* for RGB formats only */
135 unsigned int red_mask;
136 unsigned int green_mask;
137 unsigned int blue_mask;
139 /* for YUV formats only */
140 unsigned int y_sample_bits;
141 unsigned int u_sample_bits;
142 unsigned int v_sample_bits;
143 unsigned int horz_y_period;
144 unsigned int horz_u_period;
145 unsigned int horz_v_period;
146 unsigned int vert_y_period;
147 unsigned int vert_u_period;
148 unsigned int vert_v_period;
149 char component_order[32]; /* eg. UYVY */
150 int scanline_order; /* XvTopToBottom, XvBottomToTop */
151 } XvImageFormatValues;
156 int data_size; /* bytes */
158 int *pitches; /* bytes */
159 int *offsets; /* bytes */
166 extern int XvQueryExtension(
167 Display* /* display */,
168 unsigned int* /* p_version */,
169 unsigned int* /* p_revision */,
170 unsigned int* /* p_requestBase */,
171 unsigned int* /* p_eventBase */,
172 unsigned int* /* p_errorBase */
175 extern int XvQueryAdaptors(
176 Display* /* display */,
178 unsigned int* /* p_nAdaptors */,
179 XvAdaptorInfo** /* p_pAdaptors */
182 extern int XvQueryEncodings(
183 Display* /* display */,
185 unsigned int* /* p_nEncoding */,
186 XvEncodingInfo** /* p_pEncoding */
189 extern int XvPutVideo(
190 Display* /* display */,
196 unsigned int /* vw */,
197 unsigned int /* vh */,
200 unsigned int /* dw */,
201 unsigned int /* dh */
204 extern int XvPutStill(
205 Display* /* display */,
211 unsigned int /* vw */,
212 unsigned int /* vh */,
215 unsigned int /* dw */,
216 unsigned int /* dh */
219 extern int XvGetVideo(
220 Display* /* display */,
226 unsigned int /* vw */,
227 unsigned int /* vh */,
230 unsigned int /* dw */,
231 unsigned int /* dh */
234 extern int XvGetStill(
235 Display* /* display */,
241 unsigned int /* vw */,
242 unsigned int /* vh */,
245 unsigned int /* dw */,
246 unsigned int /* dh */
249 extern int XvStopVideo(
250 Display* /* display */,
252 Drawable /* drawable */
255 extern int XvGrabPort(
256 Display* /* display */,
261 extern int XvUngrabPort(
262 Display* /* display */,
267 extern int XvSelectVideoNotify(
268 Display* /* display */,
269 Drawable /* drawable */,
273 extern int XvSelectPortNotify(
274 Display* /* display */,
279 extern int XvSetPortAttribute(
280 Display* /* display */,
282 Atom /* attribute */,
286 extern int XvGetPortAttribute(
287 Display* /* display */,
289 Atom /* attribute */,
293 extern int XvQueryBestSize(
294 Display* /* display */,
297 unsigned int /* vid_w */,
298 unsigned int /* vid_h */,
299 unsigned int /* drw_w */,
300 unsigned int /* drw_h */,
301 unsigned int* /* p_actual_width */,
302 unsigned int* /* p_actual_width */
305 extern XvAttribute* XvQueryPortAttributes(
306 Display* /* display */,
312 extern void XvFreeAdaptorInfo(
313 XvAdaptorInfo* /* adaptors */
316 extern void XvFreeEncodingInfo(
317 XvEncodingInfo* /* encodings */
321 extern XvImageFormatValues * XvListImageFormats (
327 extern XvImage * XvCreateImage (
336 extern int XvPutImage (
352 extern int XvShmPutImage (
369 extern XvImage * XvShmCreateImage (
376 XShmSegmentInfo *shminfo