1191
|
1 #***********************************************************
|
|
2 #Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
|
|
3 #and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
|
|
4 #
|
|
5 # All Rights Reserved
|
|
6 #
|
|
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.
|
|
14 #
|
|
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
|
|
21 #SOFTWARE.
|
|
22 #
|
|
23 #******************************************************************
|
|
24 # $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $
|
|
25 #*
|
|
26 #** File:
|
|
27 #**
|
|
28 #** Xvlib.h --- Xv library public header file
|
|
29 #**
|
|
30 #** Author:
|
|
31 #**
|
|
32 #** David Carver (Digital Workstation Engineering/Project Athena)
|
|
33 #**
|
|
34 #** Revisions:
|
|
35 #**
|
|
36 #** 26.06.91 Carver
|
|
37 #** - changed XvFreeAdaptors to XvFreeAdaptorInfo
|
|
38 #** - changed XvFreeEncodings to XvFreeEncodingInfo
|
|
39 #**
|
|
40 #** 11.06.91 Carver
|
|
41 #** - changed SetPortControl to SetPortAttribute
|
|
42 #** - changed GetPortControl to GetPortAttribute
|
|
43 #** - changed QueryBestSize
|
|
44 #**
|
|
45 #** 05.15.91 Carver
|
|
46 #** - version 2.0 upgrade
|
|
47 #**
|
|
48 #** 01.24.91 Carver
|
|
49 #** - version 1.4 upgrade
|
|
50 #**
|
|
51 #*
|
|
52
|
|
53 import
|
|
54 x, xlib, xshm, xv
|
|
55
|
|
56 const
|
|
57 libXv* = "libXv.so"
|
|
58
|
|
59 type
|
|
60 PXvRational* = ptr XvRational
|
|
61 XvRational*{.final.} = object
|
|
62 numerator*: cint
|
|
63 denominator*: cint
|
|
64
|
|
65 PXvAttribute* = ptr XvAttribute
|
|
66 XvAttribute*{.final.} = object
|
|
67 flags*: cint # XvGettable, XvSettable
|
|
68 min_value*: cint
|
|
69 max_value*: cint
|
|
70 name*: cstring
|
|
71
|
|
72 PPXvEncodingInfo* = ptr PXvEncodingInfo
|
|
73 PXvEncodingInfo* = ptr XvEncodingInfo
|
|
74 XvEncodingInfo*{.final.} = object
|
|
75 encoding_id*: XvEncodingID
|
|
76 name*: cstring
|
|
77 width*: culong
|
|
78 height*: culong
|
|
79 rate*: XvRational
|
|
80 num_encodings*: culong
|
|
81
|
|
82 PXvFormat* = ptr XvFormat
|
|
83 XvFormat*{.final.} = object
|
|
84 depth*: cchar
|
|
85 visual_id*: culong
|
|
86
|
|
87 PPXvAdaptorInfo* = ptr PXvAdaptorInfo
|
|
88 PXvAdaptorInfo* = ptr XvAdaptorInfo
|
|
89 XvAdaptorInfo*{.final.} = object
|
|
90 base_id*: XvPortID
|
|
91 num_ports*: culong
|
|
92 thetype*: cchar
|
|
93 name*: cstring
|
|
94 num_formats*: culong
|
|
95 formats*: PXvFormat
|
|
96 num_adaptors*: culong
|
|
97
|
|
98 PXvVideoNotifyEvent* = ptr XvVideoNotifyEvent
|
|
99 XvVideoNotifyEvent*{.final.} = object
|
|
100 theType*: cint
|
|
101 serial*: culong # # of last request processed by server
|
|
102 send_event*: XBool # true if this came from a SendEvent request
|
|
103 display*: PDisplay # Display the event was read from
|
|
104 drawable*: Drawable # drawable
|
|
105 reason*: culong # what generated this event
|
|
106 port_id*: XvPortID # what port
|
|
107 time*: Time # milliseconds
|
|
108
|
|
109 PXvPortNotifyEvent* = ptr XvPortNotifyEvent
|
|
110 XvPortNotifyEvent*{.final.} = object
|
|
111 theType*: cint
|
|
112 serial*: culong # # of last request processed by server
|
|
113 send_event*: XBool # true if this came from a SendEvent request
|
|
114 display*: PDisplay # Display the event was read from
|
|
115 port_id*: XvPortID # what port
|
|
116 time*: Time # milliseconds
|
|
117 attribute*: Atom # atom that identifies attribute
|
|
118 value*: clong # value of attribute
|
|
119
|
|
120 PXvEvent* = ptr XvEvent
|
|
121 XvEvent*{.final.} = object
|
|
122 pad*: array[0..23, clong] # case longint of
|
|
123 # 0 : (
|
|
124 # theType : cint;
|
|
125 # );
|
|
126 # 1 : (
|
|
127 # xvvideo : XvVideoNotifyEvent;
|
|
128 # );
|
|
129 # 2 : (
|
|
130 # xvport : XvPortNotifyEvent;
|
|
131 # );
|
|
132 # 3 : (
|
|
133 #
|
|
134 # );
|
|
135
|
|
136 PXvImageFormatValues* = ptr XvImageFormatValues
|
|
137 XvImageFormatValues*{.final.} = object
|
|
138 id*: cint # Unique descriptor for the format
|
|
139 theType*: cint # XvRGB, XvYUV
|
|
140 byte_order*: cint # LSBFirst, MSBFirst
|
|
141 guid*: array[0..15, cchar] # Globally Unique IDentifier
|
|
142 bits_per_pixel*: cint
|
|
143 format*: cint # XvPacked, XvPlanar
|
|
144 num_planes*: cint # for RGB formats only
|
|
145 depth*: cint
|
|
146 red_mask*: cuint
|
|
147 green_mask*: cuint
|
|
148 blue_mask*: cuint # for YUV formats only
|
|
149 y_sample_bits*: cuint
|
|
150 u_sample_bits*: cuint
|
|
151 v_sample_bits*: cuint
|
|
152 horz_y_period*: cuint
|
|
153 horz_u_period*: cuint
|
|
154 horz_v_period*: cuint
|
|
155 vert_y_period*: cuint
|
|
156 vert_u_period*: cuint
|
|
157 vert_v_period*: cuint
|
|
158 component_order*: array[0..31, char] # eg. UYVY
|
|
159 scanline_order*: cint # XvTopToBottom, XvBottomToTop
|
|
160
|
|
161 PXvImage* = ptr XvImage
|
|
162 XvImage*{.final.} = object
|
|
163 id*: cint
|
|
164 width*, height*: cint
|
|
165 data_size*: cint # bytes
|
|
166 num_planes*: cint
|
|
167 pitches*: cint # bytes
|
|
168 offsets*: cint # bytes
|
|
169 data*: pointer
|
|
170 obdata*: XPointer
|
|
171
|
|
172 proc XvQueryExtension*(display: PDisplay, p_version, p_revision, p_requestBase,
|
|
173 p_eventBase, p_errorBase: cuint): cint{.cdecl, dynlib: libXv, importc.}
|
|
174 proc XvQueryAdaptors*(display: PDisplay, window: Window, p_nAdaptors: cuint,
|
|
175 p_pAdaptors: PPXvAdaptorInfo): cint{.cdecl, dynlib: libXv,
|
|
176 importc.}
|
|
177 proc XvQueryEncodings*(display: PDisplay, port: XvPortID, p_nEncoding: cuint,
|
|
178 p_pEncoding: PPXvEncodingInfo): cint{.cdecl,
|
|
179 dynlib: libXv, importc.}
|
|
180 proc XvPutVideo*(display: PDisplay, port: XvPortID, d: Drawable, gc: GC,
|
|
181 vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
182 cdecl, dynlib: libXv, importc.}
|
|
183 proc XvPutStill*(display: PDisplay, port: XvPortID, d: Drawable, gc: GC,
|
|
184 vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
185 cdecl, dynlib: libXv, importc.}
|
|
186 proc XvGetVideo*(display: PDisplay, port: XvPortID, d: Drawable, gc: GC,
|
|
187 vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
188 cdecl, dynlib: libXv, importc.}
|
|
189 proc XvGetStill*(display: PDisplay, port: XvPortID, d: Drawable, gc: GC,
|
|
190 vx, vy: cint, vw, vh: cuint, dx, dy: cint, dw, dh: cuint): cint{.
|
|
191 cdecl, dynlib: libXv, importc.}
|
|
192 proc XvStopVideo*(display: PDisplay, port: XvPortID, drawable: Drawable): cint{.
|
|
193 cdecl, dynlib: libXv, importc.}
|
|
194 proc XvGrabPort*(display: PDisplay, port: XvPortID, time: Time): cint{.cdecl,
|
|
195 dynlib: libXv, importc.}
|
|
196 proc XvUngrabPort*(display: PDisplay, port: XvPortID, time: Time): cint{.
|
|
197 cdecl, dynlib: libXv, importc.}
|
|
198 proc XvSelectVideoNotify*(display: PDisplay, drawable: Drawable, onoff: XBool): cint{.
|
|
199 cdecl, dynlib: libXv, importc.}
|
|
200 proc XvSelectPortNotify*(display: PDisplay, port: XvPortID, onoff: XBool): cint{.
|
|
201 cdecl, dynlib: libXv, importc.}
|
|
202 proc XvSetPortAttribute*(display: PDisplay, port: XvPortID, attribute: Atom,
|
|
203 value: cint): cint{.cdecl, dynlib: libXv, importc.}
|
|
204 proc XvGetPortAttribute*(display: PDisplay, port: XvPortID, attribute: Atom,
|
|
205 p_value: cint): cint{.cdecl, dynlib: libXv, importc.}
|
|
206 proc XvQueryBestSize*(display: PDisplay, port: XvPortID, motion: XBool,
|
|
207 vid_w, vid_h, drw_w, drw_h: cuint,
|
|
208 p_actual_width, p_actual_height: cuint): cint{.cdecl,
|
|
209 dynlib: libXv, importc.}
|
|
210 proc XvQueryPortAttributes*(display: PDisplay, port: XvPortID, number: cint): PXvAttribute{.
|
|
211 cdecl, dynlib: libXv, importc.}
|
|
212 proc XvFreeAdaptorInfo*(adaptors: PXvAdaptorInfo){.cdecl, dynlib: libXv, importc.}
|
|
213 proc XvFreeEncodingInfo*(encodings: PXvEncodingInfo){.cdecl, dynlib: libXv,
|
|
214 importc.}
|
|
215 proc XvListImageFormats*(display: PDisplay, port_id: XvPortID,
|
|
216 count_return: cint): PXvImageFormatValues{.cdecl,
|
|
217 dynlib: libXv, importc.}
|
|
218 proc XvCreateImage*(display: PDisplay, port: XvPortID, id: cint, data: pointer,
|
|
219 width, height: cint): PXvImage{.cdecl, dynlib: libXv,
|
|
220 importc.}
|
|
221 proc XvPutImage*(display: PDisplay, id: XvPortID, d: Drawable, gc: GC,
|
|
222 image: PXvImage, src_x, src_y: cint, src_w, src_h: cuint,
|
|
223 dest_x, dest_y: cint, dest_w, dest_h: cuint): cint{.cdecl,
|
|
224 dynlib: libXv, importc.}
|
|
225 proc XvShmPutImage*(display: PDisplay, id: XvPortID, d: Drawable, gc: GC,
|
|
226 image: PXvImage, src_x, src_y: cint, src_w, src_h: cuint,
|
|
227 dest_x, dest_y: cint, dest_w, dest_h: cuint,
|
|
228 send_event: XBool): cint{.cdecl, dynlib: libXv, importc.}
|
|
229 proc XvShmCreateImage*(display: PDisplay, port: XvPortID, id: cint,
|
|
230 data: pointer, width, height: cint,
|
|
231 shminfo: PXShmSegmentInfo): PXvImage{.cdecl,
|
|
232 dynlib: libXv, importc.}
|
|
233 # implementation
|