VirtualBox

source: vbox/trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h@ 50313

Last change on this file since 50313 was 50313, checked in by vboxsync, 11 years ago

crOpenGL: video recording working

  • Property svn:eol-style set to native
File size: 10.0 KB
Line 
1/** @file
2 * OpenGL:
3 * Common header for host service and guest clients.
4 */
5
6/*
7 * Copyright (C) 2006-2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef ___VBox_HostService_VBoxCrOpenGLSvc_h
28#define ___VBox_HostService_VBoxCrOpenGLSvc_h
29
30#include <VBox/types.h>
31#include <VBox/VMMDev.h>
32#include <VBox/VBoxGuest2.h>
33#include <VBox/hgcmsvc.h>
34#include <VBox/VBoxVideo.h>
35
36/* crOpenGL host functions */
37#define SHCRGL_HOST_FN_SET_CONSOLE (1)
38#define SHCRGL_HOST_FN_SET_VISIBLE_REGION (5)
39#define SHCRGL_HOST_FN_SET_VM (7)
40#define SHCRGL_HOST_FN_SCREEN_CHANGED (8)
41#ifdef VBOX_WITH_CRHGSMI
42#define SHCRGL_HOST_FN_CRHGSMI_CMD (10)
43#define SHCRGL_HOST_FN_CRHGSMI_CTL (11)
44#endif
45#define SHCRGL_HOST_FN_VIEWPORT_CHANGED (15)
46#define SHCRGL_HOST_FN_SET_OUTPUT_REDIRECT (20)
47#define SHCRGL_HOST_FN_CRCMD_NOTIFY_CMDS (21)
48#define SHCRGL_HOST_FN_DEV_RESIZE (22)
49#define SHCRGL_HOST_FN_VIEWPORT_CHANGED2 (23)
50#define SHCRGL_HOST_FN_TAKE_SCREENSHOT (24)
51/* crOpenGL guest functions */
52#define SHCRGL_GUEST_FN_WRITE (2)
53#define SHCRGL_GUEST_FN_READ (3)
54#define SHCRGL_GUEST_FN_WRITE_READ (4)
55#define SHCRGL_GUEST_FN_SET_VERSION (6)
56#define SHCRGL_GUEST_FN_INJECT (9)
57#define SHCRGL_GUEST_FN_SET_PID (12)
58#define SHCRGL_GUEST_FN_WRITE_BUFFER (13)
59#define SHCRGL_GUEST_FN_WRITE_READ_BUFFERED (14)
60#define SHCRGL_GUEST_FN_GET_CAPS (15)
61
62/* Parameters count */
63#define SHCRGL_CPARMS_SET_CONSOLE (1)
64#define SHCRGL_CPARMS_SET_VM (1)
65#define SHCRGL_CPARMS_SET_VISIBLE_REGION (1)
66#define SHCRGL_CPARMS_WRITE (1)
67#define SHCRGL_CPARMS_READ (2)
68#define SHCRGL_CPARMS_WRITE_READ (3)
69#define SHCRGL_CPARMS_SET_VERSION (2)
70#define SHCRGL_CPARMS_SCREEN_CHANGED (1)
71#define SHCRGL_CPARMS_DEV_RESIZE (1)
72#define SHCRGL_CPARMS_INJECT (2)
73#define SHCRGL_CPARMS_SET_PID (1)
74#define SHCRGL_CPARMS_WRITE_BUFFER (4)
75#define SHCRGL_CPARMS_WRITE_READ_BUFFERED (3)
76#define SHCRGL_CPARMS_SET_OUTPUT_REDIRECT (1)
77#define SHCRGL_CPARMS_CRCMD_NOTIFY_CMDS (0)
78#define SHCRGL_CPARMS_VIEWPORT_CHANGED (5)
79#define SHCRGL_CPARMS_VIEWPORT_CHANGED2 (1)
80#define SHCRGL_CPARMS_GET_CAPS (1)
81
82/* @todo Move to H3DOR.h begin */
83
84/* Names of supported output redirect formats. */
85#define H3DOR_FMT_RGBA_TOPDOWN "H3DOR_FMT_RGBA_TOPDOWN"
86
87/* Comma separated list of output formats supported by the output redirect target. */
88#define H3DOR_PROP_FORMATS 0
89
90#pragma pack(1)
91typedef struct {
92 /* The caller's context of the redirection. */
93 const void *pvContext;
94 /* Inform caller that a new window will be redirected. */
95 DECLR3CALLBACKMEMBER(void, H3DORBegin, (const void *pvContext, void **ppvInstance,
96 const char *pszFormat));
97 /* The window dimension has been changed. */
98 DECLR3CALLBACKMEMBER(void, H3DORGeometry, (void *pvInstance,
99 int32_t x, int32_t y, uint32_t w, uint32_t h));
100 /* Update the window visible region. */
101 DECLR3CALLBACKMEMBER(void, H3DORVisibleRegion, (void *pvInstance,
102 uint32_t cRects, const RTRECT *paRects));
103 /* A rendered 3D frame is ready. Format of pvData is "pszFormat" parameter of H3DORBegin. */
104 DECLR3CALLBACKMEMBER(void, H3DORFrame, (void *pvInstance,
105 void *pvData, uint32_t cbData));
106 /* The window is closed. */
107 DECLR3CALLBACKMEMBER(void, H3DOREnd, (void *pvInstance));
108 /* Obtain caller's parameters: the list of supported formats, etc. */
109 DECLR3CALLBACKMEMBER(int, H3DORContextProperty, (const void *pvContext, uint32_t index,
110 void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut));
111} H3DOUTPUTREDIRECT;
112#pragma pack()
113
114/* @todo Move to H3DOR.h end */
115
116#ifdef VBOX_WITH_CRHGSMI
117#pragma pack(1)
118typedef struct
119{
120 int32_t result; /**< OUT Host HGSMI return code.*/
121 uint32_t u32ClientID; /**< IN The id of the caller. */
122 uint32_t u32Function; /**< IN Function number. */
123 uint32_t u32Reserved;
124} CRVBOXHGSMIHDR;
125AssertCompileSize(CRVBOXHGSMIHDR, 16);
126
127/** GUEST_FN_WRITE Parameters structure. */
128typedef struct
129{
130 CRVBOXHGSMIHDR hdr;
131 /** buffer index, in
132 * Data buffer
133 */
134 uint32_t iBuffer;
135} CRVBOXHGSMIWRITE;
136
137/** GUEST_FN_READ Parameters structure. */
138typedef struct
139{
140 CRVBOXHGSMIHDR hdr;
141
142 /** buffer index, in/out
143 * Data buffer
144 */
145 uint32_t iBuffer;
146 uint32_t cbBuffer;
147} CRVBOXHGSMIREAD;
148
149/** GUEST_FN_WRITE_READ Parameters structure. */
150typedef struct
151{
152 CRVBOXHGSMIHDR hdr;
153
154 /** buffer index, in
155 * Data buffer
156 */
157 uint32_t iBuffer;
158
159 /** buffer index, out
160 * Writeback buffer
161 */
162 uint32_t iWriteback;
163 uint32_t cbWriteback;
164} CRVBOXHGSMIWRITEREAD;
165
166/** GUEST_FN_SET_VERSION Parameters structure. */
167typedef struct
168{
169 CRVBOXHGSMIHDR hdr;
170
171 /** 32bit, in
172 * Major version
173 */
174 uint32_t vMajor;
175
176 /** 32bit, in
177 * Minor version
178 */
179 uint32_t vMinor;
180} CRVBOXHGSMISETVERSION;
181
182/** GUEST_FN_INJECT Parameters structure. */
183typedef struct
184{
185 CRVBOXHGSMIHDR hdr;
186
187 /** 32bit, in
188 * ClientID to inject commands buffer for
189 */
190 uint32_t u32ClientID;
191 /** buffer index, in
192 * Data buffer
193 */
194 uint32_t iBuffer;
195} CRVBOXHGSMIINJECT;
196
197/** GUEST_FN_SET_PID Parameters structure. */
198typedef struct
199{
200 CRVBOXHGSMIHDR hdr;
201
202 /** 64bit, in
203 * PID
204 */
205 uint64_t u64PID;
206} CRVBOXHGSMISETPID;
207
208#pragma pack()
209#endif
210/**
211 * SHCRGL_GUEST_FN_WRITE
212 */
213
214/** GUEST_FN_WRITE Parameters structure. */
215typedef struct
216{
217 VBoxGuestHGCMCallInfo hdr;
218
219 /** pointer, in
220 * Data buffer
221 */
222 HGCMFunctionParameter pBuffer;
223} CRVBOXHGCMWRITE;
224
225/** GUEST_FN_READ Parameters structure. */
226typedef struct
227{
228 VBoxGuestHGCMCallInfo hdr;
229
230 /** pointer, in/out
231 * Data buffer
232 */
233 HGCMFunctionParameter pBuffer;
234
235 /** 32bit, out
236 * Count of bytes written to buffer
237 */
238 HGCMFunctionParameter cbBuffer;
239
240} CRVBOXHGCMREAD;
241
242/** GUEST_FN_WRITE_READ Parameters structure. */
243typedef struct
244{
245 VBoxGuestHGCMCallInfo hdr;
246
247 /** pointer, in
248 * Data buffer
249 */
250 HGCMFunctionParameter pBuffer;
251
252 /** pointer, out
253 * Writeback buffer
254 */
255 HGCMFunctionParameter pWriteback;
256
257 /** 32bit, out
258 * Count of bytes written to writeback buffer
259 */
260 HGCMFunctionParameter cbWriteback;
261
262} CRVBOXHGCMWRITEREAD;
263
264/** GUEST_FN_SET_VERSION Parameters structure. */
265typedef struct
266{
267 VBoxGuestHGCMCallInfo hdr;
268
269 /** 32bit, in
270 * Major version
271 */
272 HGCMFunctionParameter vMajor;
273
274 /** 32bit, in
275 * Minor version
276 */
277 HGCMFunctionParameter vMinor;
278
279} CRVBOXHGCMSETVERSION;
280
281/** GUEST_FN_GET_CAPS Parameters structure. */
282typedef struct
283{
284 VBoxGuestHGCMCallInfo hdr;
285
286 /** 32bit, out
287 * Caps
288 */
289 HGCMFunctionParameter Caps;
290} CRVBOXHGCMGETCAPS;
291
292/** GUEST_FN_INJECT Parameters structure. */
293typedef struct
294{
295 VBoxGuestHGCMCallInfo hdr;
296
297 /** 32bit, in
298 * ClientID to inject commands buffer for
299 */
300 HGCMFunctionParameter u32ClientID;
301 /** pointer, in
302 * Data buffer
303 */
304 HGCMFunctionParameter pBuffer;
305} CRVBOXHGCMINJECT;
306
307/** GUEST_FN_SET_PID Parameters structure. */
308typedef struct
309{
310 VBoxGuestHGCMCallInfo hdr;
311
312 /** 64bit, in
313 * PID
314 */
315 HGCMFunctionParameter u64PID;
316} CRVBOXHGCMSETPID;
317
318/** GUEST_FN_WRITE_BUFFER Parameters structure. */
319typedef struct
320{
321 VBoxGuestHGCMCallInfo hdr;
322
323 /** 32bit, in/out
324 * Buffer id, 0 means host have to allocate one
325 */
326 HGCMFunctionParameter iBufferID;
327
328 /** 32bit, in
329 * Buffer size
330 */
331 HGCMFunctionParameter cbBufferSize;
332
333 /** 32bit, in
334 * Write offset in buffer
335 */
336 HGCMFunctionParameter ui32Offset;
337
338 /** pointer, in
339 * Data buffer
340 */
341 HGCMFunctionParameter pBuffer;
342
343} CRVBOXHGCMWRITEBUFFER;
344
345/** GUEST_FN_WRITE_READ_BUFFERED Parameters structure. */
346typedef struct
347{
348 VBoxGuestHGCMCallInfo hdr;
349
350 /** 32bit, in
351 * Buffer id.
352 */
353 HGCMFunctionParameter iBufferID;
354
355 /** pointer, out
356 * Writeback buffer
357 */
358 HGCMFunctionParameter pWriteback;
359
360 /** 32bit, out
361 * Count of bytes written to writeback buffer
362 */
363 HGCMFunctionParameter cbWriteback;
364
365} CRVBOXHGCMWRITEREADBUFFERED;
366
367
368typedef struct
369{
370 VBVAINFOSCREEN Screen;
371 void *pvVRAM;
372} CRVBOXHGCMDEVRESIZE;
373
374typedef struct
375{
376 uint32_t u32Screen;
377 uint32_t x;
378 uint32_t y;
379 uint32_t width;
380 uint32_t height;
381} CRVBOXHGCMVIEWPORT;
382
383typedef DECLCALLBACKPTR(void, PFNCRSCREENSHOTREPORT)(void *pvCtx, uint32_t uScreen,
384 uint32_t x, uint32_t y, uint32_t uBitsPerPixel,
385 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight,
386 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp);
387
388#define CRSCREEN_ALL (0xffffffff)
389
390typedef struct
391{
392 /* screen id or CRSCREEN_ALL to specify all enabled */
393 uint32_t u32Screen;
394 void *pvContext;
395 PFNCRSCREENSHOTREPORT pfnScreenshot;
396} CRVBOXHGCMTAKESCREENSHOT;
397
398#endif
Note: See TracBrowser for help on using the repository browser.

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