VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.0/xf86xv.h@ 66940

最後變更 在這個檔案從66940是 32163,由 vboxsync 提交於 14 年 前

Additions/x11/x11include: additional headers for building drivers for X.Org Server 1.9

  • 屬性 svn:eol-style 設為 native
檔案大小: 8.2 KB
 
1
2/*
3 * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * Except as contained in this notice, the name of the copyright holder(s)
24 * and author(s) shall not be used in advertising or otherwise to promote
25 * the sale, use or other dealings in this Software without prior written
26 * authorization from the copyright holder(s) and author(s).
27 */
28
29#ifndef _XF86XV_H_
30#define _XF86XV_H_
31
32#include "xvdix.h"
33#include "xf86str.h"
34
35#define VIDEO_NO_CLIPPING 0x00000001
36#define VIDEO_INVERT_CLIPLIST 0x00000002
37#define VIDEO_OVERLAID_IMAGES 0x00000004
38#define VIDEO_OVERLAID_STILLS 0x00000008
39#define VIDEO_CLIP_TO_VIEWPORT 0x00000010
40
41typedef struct {
42 int id;
43 int type;
44 int byte_order;
45 unsigned char guid[16];
46 int bits_per_pixel;
47 int format;
48 int num_planes;
49
50 /* for RGB formats only */
51 int depth;
52 unsigned int red_mask;
53 unsigned int green_mask;
54 unsigned int blue_mask;
55
56 /* for YUV formats only */
57 unsigned int y_sample_bits;
58 unsigned int u_sample_bits;
59 unsigned int v_sample_bits;
60 unsigned int horz_y_period;
61 unsigned int horz_u_period;
62 unsigned int horz_v_period;
63 unsigned int vert_y_period;
64 unsigned int vert_u_period;
65 unsigned int vert_v_period;
66 char component_order[32];
67 int scanline_order;
68} XF86ImageRec, *XF86ImagePtr;
69
70
71typedef struct {
72 ScrnInfoPtr pScrn;
73 int id;
74 unsigned short width, height;
75 int *pitches; /* bytes */
76 int *offsets; /* in bytes from start of framebuffer */
77 DevUnion devPrivate;
78} XF86SurfaceRec, *XF86SurfacePtr;
79
80
81typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn,
82 short vid_x, short vid_y, short drw_x, short drw_y,
83 short vid_w, short vid_h, short drw_w, short drw_h,
84 RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
85typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn,
86 short vid_x, short vid_y, short drw_x, short drw_y,
87 short vid_w, short vid_h, short drw_w, short drw_h,
88 RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
89typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn,
90 short vid_x, short vid_y, short drw_x, short drw_y,
91 short vid_w, short vid_h, short drw_w, short drw_h,
92 RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
93typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn,
94 short vid_x, short vid_y, short drw_x, short drw_y,
95 short vid_w, short vid_h, short drw_w, short drw_h,
96 RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
97typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool Exit);
98typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
99 INT32 value, pointer data);
100typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
101 INT32 *value, pointer data);
102typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn, Bool motion,
103 short vid_w, short vid_h, short drw_w, short drw_h,
104 unsigned int *p_w, unsigned int *p_h, pointer data);
105typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn,
106 short src_x, short src_y, short drw_x, short drw_y,
107 short src_w, short src_h, short drw_w, short drw_h,
108 int image, unsigned char* buf, short width, short height, Bool Sync,
109 RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
110typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, short drw_x, short drw_y,
111 RegionPtr clipBoxes, pointer data, DrawablePtr pDraw );
112typedef int (*QueryImageAttributesFuncPtr)(ScrnInfoPtr pScrn,
113 int image, unsigned short *width, unsigned short *height,
114 int *pitches, int *offsets);
115typedef void (*ClipNotifyFuncPtr)(ScrnInfoPtr pScrn, pointer data,
116 WindowPtr window, int dx, int dy);
117
118typedef enum {
119 XV_OFF,
120 XV_PENDING,
121 XV_ON
122} XvStatus;
123
124/*** this is what the driver needs to fill out ***/
125
126typedef struct {
127 int id;
128 char *name;
129 unsigned short width, height;
130 XvRationalRec rate;
131} XF86VideoEncodingRec, *XF86VideoEncodingPtr;
132
133typedef struct {
134 char depth;
135 short class;
136} XF86VideoFormatRec, *XF86VideoFormatPtr;
137
138typedef struct {
139 int flags;
140 int min_value;
141 int max_value;
142 char *name;
143} XF86AttributeRec, *XF86AttributePtr;
144
145typedef struct {
146 unsigned int type;
147 int flags;
148 char *name;
149 int nEncodings;
150 XF86VideoEncodingPtr pEncodings;
151 int nFormats;
152 XF86VideoFormatPtr pFormats;
153 int nPorts;
154 DevUnion *pPortPrivates;
155 int nAttributes;
156 XF86AttributePtr pAttributes;
157 int nImages;
158 XF86ImagePtr pImages;
159 PutVideoFuncPtr PutVideo;
160 PutStillFuncPtr PutStill;
161 GetVideoFuncPtr GetVideo;
162 GetStillFuncPtr GetStill;
163 StopVideoFuncPtr StopVideo;
164 SetPortAttributeFuncPtr SetPortAttribute;
165 GetPortAttributeFuncPtr GetPortAttribute;
166 QueryBestSizeFuncPtr QueryBestSize;
167 PutImageFuncPtr PutImage;
168 ReputImageFuncPtr ReputImage;
169 QueryImageAttributesFuncPtr QueryImageAttributes;
170 ClipNotifyFuncPtr ClipNotify;
171} XF86VideoAdaptorRec, *XF86VideoAdaptorPtr;
172
173typedef struct {
174 XF86ImagePtr image;
175 int flags;
176 int (*alloc_surface)(ScrnInfoPtr pScrn,
177 int id,
178 unsigned short width,
179 unsigned short height,
180 XF86SurfacePtr surface);
181 int (*free_surface)(XF86SurfacePtr surface);
182 int (*display) (XF86SurfacePtr surface,
183 short vid_x, short vid_y,
184 short drw_x, short drw_y,
185 short vid_w, short vid_h,
186 short drw_w, short drw_h,
187 RegionPtr clipBoxes);
188 int (*stop) (XF86SurfacePtr surface);
189 int (*getAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 *value);
190 int (*setAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 value);
191 int max_width;
192 int max_height;
193 int num_attributes;
194 XF86AttributePtr attributes;
195} XF86OffscreenImageRec, *XF86OffscreenImagePtr;
196
197extern _X_EXPORT Bool
198xf86XVScreenInit(
199 ScreenPtr pScreen,
200 XF86VideoAdaptorPtr *Adaptors,
201 int num
202);
203
204typedef int (* xf86XVInitGenericAdaptorPtr)(ScrnInfoPtr pScrn,
205 XF86VideoAdaptorPtr **Adaptors);
206
207extern _X_EXPORT int
208xf86XVRegisterGenericAdaptorDriver(
209 xf86XVInitGenericAdaptorPtr InitFunc
210);
211
212extern _X_EXPORT int
213xf86XVListGenericAdaptors(
214 ScrnInfoPtr pScrn,
215 XF86VideoAdaptorPtr **Adaptors
216);
217
218extern _X_EXPORT Bool
219xf86XVRegisterOffscreenImages(
220 ScreenPtr pScreen,
221 XF86OffscreenImagePtr images,
222 int num
223);
224
225extern _X_EXPORT XF86OffscreenImagePtr
226xf86XVQueryOffscreenImages(
227 ScreenPtr pScreen,
228 int *num
229);
230
231extern _X_EXPORT XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn);
232
233extern _X_EXPORT void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr);
234
235extern _X_EXPORT void
236xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes);
237
238extern _X_EXPORT void
239xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes);
240
241extern _X_EXPORT Bool
242xf86XVClipVideoHelper(
243 BoxPtr dst,
244 INT32 *xa,
245 INT32 *xb,
246 INT32 *ya,
247 INT32 *yb,
248 RegionPtr reg,
249 INT32 width,
250 INT32 height
251);
252
253extern _X_EXPORT void
254xf86XVCopyYUV12ToPacked(
255 const void *srcy,
256 const void *srcv,
257 const void *srcu,
258 void *dst,
259 int srcPitchy,
260 int srcPitchuv,
261 int dstPitch,
262 int h,
263 int w
264);
265
266extern _X_EXPORT void
267xf86XVCopyPacked(
268 const void *src,
269 void *dst,
270 int srcPitch,
271 int dstPitch,
272 int h,
273 int w
274);
275
276extern _X_EXPORT DevPrivateKey (*XvGetScreenKeyProc)(void);
277extern _X_EXPORT unsigned long (*XvGetRTPortProc)(void);
278extern _X_EXPORT int (*XvScreenInitProc)(ScreenPtr);
279
280#endif /* _XF86XV_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette