1 | /** @file
|
---|
2 | * VBox Remote Desktop Extension (VRDE) - Video Input interface.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2012 Oracle Corporation
|
---|
7 | *
|
---|
8 | * Oracle Corporation confidential
|
---|
9 | * All rights reserved
|
---|
10 | */
|
---|
11 |
|
---|
12 | #ifndef ___VBox_RemoteDesktop_VRDEVideoIn_h
|
---|
13 | #define ___VBox_RemoteDesktop_VRDEVideoIn_h
|
---|
14 |
|
---|
15 |
|
---|
16 | /* Define VRDE_VIDEOIN_WITH_VRDEINTERFACE to include the server VRDE interface parts. */
|
---|
17 |
|
---|
18 | #ifdef VRDE_VIDEOIN_WITH_VRDEINTERFACE
|
---|
19 | #include <VBox/RemoteDesktop/VRDE.h>
|
---|
20 | #endif /* VRDE_VIDEOIN_WITH_VRDEINTERFACE */
|
---|
21 |
|
---|
22 | #ifdef AssertCompileSize
|
---|
23 | #define ASSERTSIZE(type, size) AssertCompileSize(type, size);
|
---|
24 | #else
|
---|
25 | #define ASSERTSIZE(type, size)
|
---|
26 | #endif /* AssertCompileSize */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * Interface for accessing a video camera device on the client.
|
---|
31 | *
|
---|
32 | * Async callbacks are used for providing feedback, reporting errors, etc.
|
---|
33 | *
|
---|
34 | * Initial version supports: Camera + Processing Unit + Streaming Control.
|
---|
35 | *
|
---|
36 | * There are 2 modes:
|
---|
37 | * 1) The virtual WebCam is already attached to the guest.
|
---|
38 | * 2) The virtual WebCam will be attached when the client has it.
|
---|
39 | *
|
---|
40 | * Initially the mode 1 is supported.
|
---|
41 | *
|
---|
42 | * Mode 1 details:
|
---|
43 | * The WebCam has some fixed functionality, according to the descriptors,
|
---|
44 | * which has been already read by the guest. So some of functions will
|
---|
45 | * not work if the client does not support them.
|
---|
46 | *
|
---|
47 | * Mode 2 details:
|
---|
48 | * Virtual WebCam descriptors are built from the client capabilities.
|
---|
49 | *
|
---|
50 | * Similarly to the smartcard, the server will inform the ConsoleVRDE that there is a WebCam.
|
---|
51 | * ConsoleVRDE creates a VRDEVIDEOIN handle and forwards virtual WebCam requests to it.
|
---|
52 | *
|
---|
53 | * Interface with VBox.
|
---|
54 | *
|
---|
55 | * Virtual WebCam ConsoleVRDE VRDE
|
---|
56 | *
|
---|
57 | * Negotiate <->
|
---|
58 | * <- VideoInDeviceNotify(Attached, DeviceId)
|
---|
59 | * -> GetDeviceDesc
|
---|
60 | * <- DeviceDesc
|
---|
61 | * 2 <- CreateCamera
|
---|
62 | * 2 CameraCreated ->
|
---|
63 | *
|
---|
64 | * CameraRequest -> Request ->
|
---|
65 | * Response <- <- Response <- Response
|
---|
66 | * Frame <- <- Frame <- Frame
|
---|
67 | * <- VideoInDeviceNotify(Detached, DeviceId)
|
---|
68 | *
|
---|
69 | * Unsupported requests fail.
|
---|
70 | * The Device Description received from the client may be used to validate WebCam requests
|
---|
71 | * in the ConsoleVRDE code, for example filter out unsupported requests.
|
---|
72 | *
|
---|
73 | */
|
---|
74 |
|
---|
75 | /* All structures in this file are packed.
|
---|
76 | * Everything is little-endian.
|
---|
77 | */
|
---|
78 | #pragma pack(1)
|
---|
79 |
|
---|
80 | /*
|
---|
81 | * The interface supports generic video input descriptors, capabilities and controls:
|
---|
82 | * * Descriptors
|
---|
83 | * + Interface
|
---|
84 | * - Input, Camera Terminal
|
---|
85 | * - Processing Unit
|
---|
86 | * + Video Streaming
|
---|
87 | * - Input Header
|
---|
88 | * - Payload Format
|
---|
89 | * - Video Frame
|
---|
90 | * - Still Image Frame
|
---|
91 | * * Video Control requests
|
---|
92 | * + Interface
|
---|
93 | * - Power Mode
|
---|
94 | * + Unit and Terminal
|
---|
95 | * camera
|
---|
96 | * - Scanning Mode (interlaced, progressive)
|
---|
97 | * - Auto-Exposure Mode
|
---|
98 | * - Auto-Exposure Priority
|
---|
99 | * - Exposure Time Absolute, Relative
|
---|
100 | * - Focus Absolute, Relative, Auto
|
---|
101 | * - Iris Absolute, Relative
|
---|
102 | * - Zoom Absolute, Relative
|
---|
103 | * - PanTilt Absolute, Relative
|
---|
104 | * - Roll Absolute, Relative
|
---|
105 | * - Privacy
|
---|
106 | * processing
|
---|
107 | * - Backlight Compensation
|
---|
108 | * - Brightness
|
---|
109 | * - Contrast
|
---|
110 | * - Gain
|
---|
111 | * - Power Line Frequency
|
---|
112 | * - Hue Manual, Auto
|
---|
113 | * - Saturation
|
---|
114 | * - Sharpness
|
---|
115 | * - Gamma
|
---|
116 | * - White Balance Temperature Manual, Auto
|
---|
117 | * - White Balance Component Manual, Auto
|
---|
118 | * - Digital Multiplier
|
---|
119 | * - Digital Multiplier Limit
|
---|
120 | * * Video Streaming requests
|
---|
121 | * + Interface
|
---|
122 | * - Synch Delay
|
---|
123 | * - Still Image Trigger
|
---|
124 | * - Generate Key Frame
|
---|
125 | * - Update Frame Segment
|
---|
126 | * - Stream Error Code
|
---|
127 | *
|
---|
128 | *
|
---|
129 | * Notes:
|
---|
130 | * * still capture uses a method similar to method 2, because the still frame will
|
---|
131 | * be send instead of video over the channel.
|
---|
132 | * Also the method 2 can be in principle emulated by both 1 and 3 on the client.
|
---|
133 | * However the client can initiate a still frame transfer, similar to hardware button trigger.
|
---|
134 | * * all control changes are async.
|
---|
135 | * * probe/commit are not used. The server can select a supported format/frame from the list.
|
---|
136 | * * no color matching. sRGB is the default.
|
---|
137 | * * most of constants are the same as in USB Video Class spec, but they are not the same and
|
---|
138 | * should be always converted.
|
---|
139 | */
|
---|
140 |
|
---|
141 | /*
|
---|
142 | * The DEVICEDEC describes the device and provides a list of supported formats:
|
---|
143 | * VRDEVIDEOINDEVICEDESC
|
---|
144 | * VRDEVIDEOINFORMATDESC[0];
|
---|
145 | * VRDEVIDEOINFRAMEDESC[0..N-1]
|
---|
146 | * VRDEVIDEOINFORMATDESC[1];
|
---|
147 | * VRDEVIDEOINFRAMEDESC[0..M-1]
|
---|
148 | * ...
|
---|
149 | */
|
---|
150 |
|
---|
151 | typedef struct VRDEVIDEOINDEVICEDESC
|
---|
152 | {
|
---|
153 | uint16_t u16ObjectiveFocalLengthMin;
|
---|
154 | uint16_t u16ObjectiveFocalLengthMax;
|
---|
155 | uint16_t u16OcularFocalLength;
|
---|
156 | uint16_t u16MaxMultiplier;
|
---|
157 | uint32_t fu32CameraControls; /* VRDE_VIDEOIN_F_CT_CTRL_* */
|
---|
158 | uint32_t fu32ProcessingControls; /* VRDE_VIDEOIN_F_PU_CTRL_* */
|
---|
159 | uint8_t fu8DeviceCaps; /* VRDE_VIDEOIN_F_DEV_CAP_* */
|
---|
160 | uint8_t u8NumFormats; /* Number of following VRDEVIDEOINFORMATDESC structures. */
|
---|
161 | uint16_t cbExt; /* Size of the optional extended description. */
|
---|
162 | /* An extended description may follow. */
|
---|
163 | /* An array of VRDEVIDEOINFORMATDESC follows. */
|
---|
164 | } VRDEVIDEOINDEVICEDESC;
|
---|
165 |
|
---|
166 | /* VRDEVIDEOINDEVICEDESC::fu32CameraControls */
|
---|
167 | #define VRDE_VIDEOIN_F_CT_CTRL_SCANNING_MODE 0x00000001 /* D0: Scanning Mode */
|
---|
168 | #define VRDE_VIDEOIN_F_CT_CTRL_AE_MODE 0x00000002 /* D1: Auto-Exposure Mode */
|
---|
169 | #define VRDE_VIDEOIN_F_CT_CTRL_AE_PRIORITY 0x00000004 /* D2: Auto-Exposure Priority */
|
---|
170 | #define VRDE_VIDEOIN_F_CT_CTRL_EXPOSURE_TIME_ABSOLUTE 0x00000008 /* D3: Exposure Time (Absolute) */
|
---|
171 | #define VRDE_VIDEOIN_F_CT_CTRL_EXPOSURE_TIME_RELATIVE 0x00000010 /* D4: Exposure Time (Relative) */
|
---|
172 | #define VRDE_VIDEOIN_F_CT_CTRL_FOCUS_ABSOLUTE 0x00000020 /* D5: Focus (Absolute) */
|
---|
173 | #define VRDE_VIDEOIN_F_CT_CTRL_FOCUS_RELATIVE 0x00000040 /* D6: Focus (Relative) */
|
---|
174 | #define VRDE_VIDEOIN_F_CT_CTRL_IRIS_ABSOLUTE 0x00000080 /* D7: Iris (Absolute) */
|
---|
175 | #define VRDE_VIDEOIN_F_CT_CTRL_IRIS_RELATIVE 0x00000100 /* D8: Iris (Relative) */
|
---|
176 | #define VRDE_VIDEOIN_F_CT_CTRL_ZOOM_ABSOLUTE 0x00000200 /* D9: Zoom (Absolute) */
|
---|
177 | #define VRDE_VIDEOIN_F_CT_CTRL_ZOOM_RELATIVE 0x00000400 /* D10: Zoom (Relative) */
|
---|
178 | #define VRDE_VIDEOIN_F_CT_CTRL_PANTILT_ABSOLUTE 0x00000800 /* D11: PanTilt (Absolute) */
|
---|
179 | #define VRDE_VIDEOIN_F_CT_CTRL_PANTILT_RELATIVE 0x00001000 /* D12: PanTilt (Relative) */
|
---|
180 | #define VRDE_VIDEOIN_F_CT_CTRL_ROLL_ABSOLUTE 0x00002000 /* D13: Roll (Absolute) */
|
---|
181 | #define VRDE_VIDEOIN_F_CT_CTRL_ROLL_RELATIVE 0x00004000 /* D14: Roll (Relative) */
|
---|
182 | #define VRDE_VIDEOIN_F_CT_CTRL_RESERVED1 0x00008000 /* D15: Reserved */
|
---|
183 | #define VRDE_VIDEOIN_F_CT_CTRL_RESERVED2 0x00010000 /* D16: Reserved */
|
---|
184 | #define VRDE_VIDEOIN_F_CT_CTRL_FOCUS_AUTO 0x00020000 /* D17: Focus, Auto */
|
---|
185 | #define VRDE_VIDEOIN_F_CT_CTRL_PRIVACY 0x00040000 /* D18: Privacy */
|
---|
186 |
|
---|
187 | /* VRDEVIDEOINDEVICEDESC::fu32ProcessingControls */
|
---|
188 | #define VRDE_VIDEOIN_F_PU_CTRL_BRIGHTNESS 0x00000001 /* D0: Brightness */
|
---|
189 | #define VRDE_VIDEOIN_F_PU_CTRL_CONTRAST 0x00000002 /* D1: Contrast */
|
---|
190 | #define VRDE_VIDEOIN_F_PU_CTRL_HUE 0x00000004 /* D2: Hue */
|
---|
191 | #define VRDE_VIDEOIN_F_PU_CTRL_SATURATION 0x00000008 /* D3: Saturation */
|
---|
192 | #define VRDE_VIDEOIN_F_PU_CTRL_SHARPNESS 0x00000010 /* D4: Sharpness */
|
---|
193 | #define VRDE_VIDEOIN_F_PU_CTRL_GAMMA 0x00000020 /* D5: Gamma */
|
---|
194 | #define VRDE_VIDEOIN_F_PU_CTRL_WHITE_BALANCE_TEMPERATURE 0x00000040 /* D6: White Balance Temperature */
|
---|
195 | #define VRDE_VIDEOIN_F_PU_CTRL_WHITE_BALANCE_COMPONENT 0x00000080 /* D7: White Balance Component */
|
---|
196 | #define VRDE_VIDEOIN_F_PU_CTRL_BACKLIGHT_COMPENSATION 0x00000100 /* D8: Backlight Compensation */
|
---|
197 | #define VRDE_VIDEOIN_F_PU_CTRL_GAIN 0x00000200 /* D9: Gain */
|
---|
198 | #define VRDE_VIDEOIN_F_PU_CTRL_POWER_LINE_FREQUENCY 0x00000400 /* D10: Power Line Frequency */
|
---|
199 | #define VRDE_VIDEOIN_F_PU_CTRL_HUE_AUTO 0x00000800 /* D11: Hue, Auto */
|
---|
200 | #define VRDE_VIDEOIN_F_PU_CTRL_WHITE_BALANCE_TEMPERATURE_AUTO 0x00001000 /* D12: White Balance Temperature, Auto */
|
---|
201 | #define VRDE_VIDEOIN_F_PU_CTRL_WHITE_BALANCE_COMPONENT_AUTO 0x00002000 /* D13: White Balance Component, Auto */
|
---|
202 | #define VRDE_VIDEOIN_F_PU_CTRL_DIGITAL_MULTIPLIER 0x00004000 /* D14: Digital Multiplier */
|
---|
203 | #define VRDE_VIDEOIN_F_PU_CTRL_DIGITAL_MULTIPLIER_LIMIT 0x00008000 /* D15: Digital Multiplier Limit */
|
---|
204 |
|
---|
205 | /* VRDEVIDEOINDEVICEDESC::fu8DeviceCaps */
|
---|
206 | #define VRDE_VIDEOIN_F_DEV_CAP_DYNAMICCHANGE 0x01 /* Whether dynamic format change is supported. */
|
---|
207 | #define VRDE_VIDEOIN_F_DEV_CAP_TRIGGER 0x02 /* Whether hardware triggering is supported. */
|
---|
208 | #define VRDE_VIDEOIN_F_DEV_CAP_TRIGGER_USAGE 0x04 /* 0 - still image, 1 - generic button event.*/
|
---|
209 |
|
---|
210 | /* The video format descriptor. */
|
---|
211 | typedef struct VRDEVIDEOINFORMATDESC
|
---|
212 | {
|
---|
213 | uint16_t cbFormat; /* Size of the structure including cbFormat and format specific data. */
|
---|
214 | uint8_t u8FormatId; /* The unique identifier of the format on the client. */
|
---|
215 | uint8_t u8FormatType; /* MJPEG etc. VRDE_VIDEOIN_FORMAT_* */
|
---|
216 | uint8_t u8FormatFlags; /* VRDE_VIDEOIN_F_FMT_* */
|
---|
217 | uint8_t u8NumFrames; /* Number of following VRDEVIDEOINFRAMEDESC structures. */
|
---|
218 | uint16_t u16Reserved; /* Must be set to 0. */
|
---|
219 | /* Other format specific data may follow. */
|
---|
220 | /* An array of VRDEVIDEOINFRAMEDESC follows. */
|
---|
221 | } VRDEVIDEOINFORMATDESC;
|
---|
222 |
|
---|
223 | /* VRDEVIDEOINFORMATDESC::u8FormatType */
|
---|
224 | #define VRDE_VIDEOIN_FORMAT_UNCOMPRESSED 0x04
|
---|
225 | #define VRDE_VIDEOIN_FORMAT_MJPEG 0x06
|
---|
226 | #define VRDE_VIDEOIN_FORMAT_MPEG2TS 0x0A
|
---|
227 | #define VRDE_VIDEOIN_FORMAT_DV 0x0C
|
---|
228 | #define VRDE_VIDEOIN_FORMAT_FRAME_BASED 0x10
|
---|
229 | #define VRDE_VIDEOIN_FORMAT_STREAM_BASED 0x12
|
---|
230 |
|
---|
231 | /* VRDEVIDEOINFORMATDESC::u8FormatFlags. */
|
---|
232 | #define VRDE_VIDEOIN_F_FMT_GENERATEKEYFRAME 0x01 /* Supports Generate Key Frame */
|
---|
233 | #define VRDE_VIDEOIN_F_FMT_UPDATEFRAMESEGMENT 0x02 /* Supports Update Frame Segment */
|
---|
234 | #define VRDE_VIDEOIN_F_FMT_COPYPROTECT 0x04 /* If duplication should be restricted. */
|
---|
235 | #define VRDE_VIDEOIN_F_FMT_COMPQUALITY 0x08 /* If the format supports an adjustable compression quality. */
|
---|
236 |
|
---|
237 | typedef struct VRDEVIDEOINFRAMESIZE
|
---|
238 | {
|
---|
239 | uint16_t u16Width;
|
---|
240 | uint16_t u16Height;
|
---|
241 | } VRDEVIDEOINFRAMESIZE;
|
---|
242 |
|
---|
243 | typedef struct VRDEVIDEOINFRAMEDESC
|
---|
244 | {
|
---|
245 | uint16_t cbFrame; /* Size of the structure including cbFrame and frame specific data. */
|
---|
246 | uint8_t u8FrameId; /* The unique identifier of the frame for the corresponding format on the client. */
|
---|
247 | uint8_t u8FrameFlags;
|
---|
248 | VRDEVIDEOINFRAMESIZE frameSize;
|
---|
249 | uint32_t u32NumFrameIntervals; /* The number of supported frame intervals. */
|
---|
250 | uint32_t u32MinFrameInterval; /* Shortest frame interval supported (at highest frame rate), in 100ns units. */
|
---|
251 | uint32_t u32MaxFrameInterval; /* Longest frame interval supported (at lowest frame rate), in 100ns units. */
|
---|
252 | /* Other frame specific data may follow. */
|
---|
253 | } VRDEVIDEOINFRAMEDESC;
|
---|
254 |
|
---|
255 | /* VRDEVIDEOINFRAMEDESC::u8FrameFlags. */
|
---|
256 | #define VRDE_VIDEOIN_F_FRM_STILL 0x01 /* If still images are supported for this frame. */
|
---|
257 |
|
---|
258 | /*
|
---|
259 | * Controls.
|
---|
260 | *
|
---|
261 | * The same structures are used for both SET and GET requests.
|
---|
262 | * Requests are async. A callback is invoked, when the client returns a reply.
|
---|
263 | * A control change notification also uses these structures.
|
---|
264 | *
|
---|
265 | * If a control request can not be fulfilled, then VRDE_VIDEOIN_CTRLHDR_F_FAIL
|
---|
266 | * will be set and u8Status contains the error code. This replaces the VC_REQUEST_ERROR_CODE_CONTROL.
|
---|
267 | */
|
---|
268 |
|
---|
269 | typedef struct VRDEVIDEOINCTRLHDR
|
---|
270 | {
|
---|
271 | uint16_t u16ControlSelector; /* VRDE_VIDEOIN_CTRLSEL_* */
|
---|
272 | uint16_t u16RequestType; /* VRDE_VIDEOIN_CTRLREQ_* */
|
---|
273 | uint16_t u16ParmSize; /* The size of the control specific parameters. */
|
---|
274 | uint8_t u8Flags; /* VRDE_VIDEOIN_CTRLHDR_F_* */
|
---|
275 | uint8_t u8Status; /* VRDE_VIDEOIN_CTRLHDR_STATUS_* */
|
---|
276 | /* Control specific data follows. */
|
---|
277 | } VRDEVIDEOINCTRLHDR;
|
---|
278 |
|
---|
279 | /* Control request types: VRDEVIDEOINCTRLHDR::u16RequestType. */
|
---|
280 | #define VRDE_VIDEOIN_CTRLREQ_UNDEFINED 0x00
|
---|
281 | #define VRDE_VIDEOIN_CTRLREQ_SET_CUR 0x01
|
---|
282 | #define VRDE_VIDEOIN_CTRLREQ_GET_CUR 0x81
|
---|
283 | #define VRDE_VIDEOIN_CTRLREQ_GET_MIN 0x82
|
---|
284 | #define VRDE_VIDEOIN_CTRLREQ_GET_MAX 0x83
|
---|
285 | #define VRDE_VIDEOIN_CTRLREQ_GET_RES 0x84
|
---|
286 | #define VRDE_VIDEOIN_CTRLREQ_GET_LEN 0x85
|
---|
287 | #define VRDE_VIDEOIN_CTRLREQ_GET_INFO 0x86
|
---|
288 | #define VRDE_VIDEOIN_CTRLREQ_GET_DEF 0x87
|
---|
289 |
|
---|
290 | /* VRDEVIDEOINCTRLHDR::u8Flags */
|
---|
291 | #define VRDE_VIDEOIN_CTRLHDR_F_NOTIFY 0x01 /* Control change notification, the attribute is derived from u16RequestType and F_FAIL. */
|
---|
292 | #define VRDE_VIDEOIN_CTRLHDR_F_FAIL 0x02 /* The operation failed. Error code is in u8Status. */
|
---|
293 |
|
---|
294 | /* VRDEVIDEOINCTRLHDR::u8Status if the VRDE_VIDEOIN_CTRLHDR_F_FAIL is set. */
|
---|
295 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_SUCCESS 0x00 /**/
|
---|
296 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_NOTREADY 0x01 /* Not ready */
|
---|
297 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_WRONGSTATE 0x02 /* Wrong state */
|
---|
298 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_POWER 0x03 /* Power */
|
---|
299 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_OUTOFRANGE 0x04 /* Out of range */
|
---|
300 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_INVALIDUNIT 0x05 /* Invalid unit */
|
---|
301 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_INVALIDCONTROL 0x06 /* Invalid control */
|
---|
302 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_INVALIDREQUEST 0x07 /* Invalid Request */
|
---|
303 | #define VRDE_VIDEOIN_CTRLHDR_STATUS_UNKNOWN 0xFF /* Unknown */
|
---|
304 |
|
---|
305 | /* Control selectors. 16 bit. High byte is the category. Low byte is the identifier.*/
|
---|
306 | #ifdef RT_MAKE_U16
|
---|
307 | #define VRDE_VIDEOIN_CTRLSEL_MAKE(Lo, Hi) RT_MAKE_U16(Lo, Hi)
|
---|
308 | #else
|
---|
309 | #define VRDE_VIDEOIN_CTRLSEL_MAKE(Lo, Hi) ((uint16_t)( (uint16_t)((uint8_t)(Hi)) << 8 | (uint8_t)(Lo) ))
|
---|
310 | #endif
|
---|
311 |
|
---|
312 | #define VRDE_VIDEOIN_CTRLSEL_VC(a) VRDE_VIDEOIN_CTRLSEL_MAKE(a, 0x01)
|
---|
313 | #define VRDE_VIDEOIN_CTRLSEL_CT(a) VRDE_VIDEOIN_CTRLSEL_MAKE(a, 0x02)
|
---|
314 | #define VRDE_VIDEOIN_CTRLSEL_PU(a) VRDE_VIDEOIN_CTRLSEL_MAKE(a, 0x03)
|
---|
315 | #define VRDE_VIDEOIN_CTRLSEL_VS(a) VRDE_VIDEOIN_CTRLSEL_MAKE(a, 0x04)
|
---|
316 | #define VRDE_VIDEOIN_CTRLSEL_HW(a) VRDE_VIDEOIN_CTRLSEL_MAKE(a, 0x05)
|
---|
317 |
|
---|
318 | #define VRDE_VIDEOIN_CTRLSEL_VC_VIDEO_POWER_MODE_CONTROL VRDE_VIDEOIN_CTRLSEL_VC(0x01)
|
---|
319 |
|
---|
320 | #define VRDE_VIDEOIN_CTRLSEL_CT_UNDEFINED VRDE_VIDEOIN_CTRLSEL_CT(0x00)
|
---|
321 | #define VRDE_VIDEOIN_CTRLSEL_CT_SCANNING_MODE VRDE_VIDEOIN_CTRLSEL_CT(0x01)
|
---|
322 | #define VRDE_VIDEOIN_CTRLSEL_CT_AE_MODE VRDE_VIDEOIN_CTRLSEL_CT(0x02)
|
---|
323 | #define VRDE_VIDEOIN_CTRLSEL_CT_AE_PRIORITY VRDE_VIDEOIN_CTRLSEL_CT(0x03)
|
---|
324 | #define VRDE_VIDEOIN_CTRLSEL_CT_EXPOSURE_TIME_ABSOLUTE VRDE_VIDEOIN_CTRLSEL_CT(0x04)
|
---|
325 | #define VRDE_VIDEOIN_CTRLSEL_CT_EXPOSURE_TIME_RELATIVE VRDE_VIDEOIN_CTRLSEL_CT(0x05)
|
---|
326 | #define VRDE_VIDEOIN_CTRLSEL_CT_FOCUS_ABSOLUTE VRDE_VIDEOIN_CTRLSEL_CT(0x06)
|
---|
327 | #define VRDE_VIDEOIN_CTRLSEL_CT_FOCUS_RELATIVE VRDE_VIDEOIN_CTRLSEL_CT(0x07)
|
---|
328 | #define VRDE_VIDEOIN_CTRLSEL_CT_FOCUS_AUTO VRDE_VIDEOIN_CTRLSEL_CT(0x08)
|
---|
329 | #define VRDE_VIDEOIN_CTRLSEL_CT_IRIS_ABSOLUTE VRDE_VIDEOIN_CTRLSEL_CT(0x09)
|
---|
330 | #define VRDE_VIDEOIN_CTRLSEL_CT_IRIS_RELATIVE VRDE_VIDEOIN_CTRLSEL_CT(0x0A)
|
---|
331 | #define VRDE_VIDEOIN_CTRLSEL_CT_ZOOM_ABSOLUTE VRDE_VIDEOIN_CTRLSEL_CT(0x0B)
|
---|
332 | #define VRDE_VIDEOIN_CTRLSEL_CT_ZOOM_RELATIVE VRDE_VIDEOIN_CTRLSEL_CT(0x0C)
|
---|
333 | #define VRDE_VIDEOIN_CTRLSEL_CT_PANTILT_ABSOLUTE VRDE_VIDEOIN_CTRLSEL_CT(0x0D)
|
---|
334 | #define VRDE_VIDEOIN_CTRLSEL_CT_PANTILT_RELATIVE VRDE_VIDEOIN_CTRLSEL_CT(0x0E)
|
---|
335 | #define VRDE_VIDEOIN_CTRLSEL_CT_ROLL_ABSOLUTE VRDE_VIDEOIN_CTRLSEL_CT(0x0F)
|
---|
336 | #define VRDE_VIDEOIN_CTRLSEL_CT_ROLL_RELATIVE VRDE_VIDEOIN_CTRLSEL_CT(0x10)
|
---|
337 | #define VRDE_VIDEOIN_CTRLSEL_CT_PRIVACY VRDE_VIDEOIN_CTRLSEL_CT(0x11)
|
---|
338 |
|
---|
339 | #define VRDE_VIDEOIN_CTRLSEL_PU_UNDEFINED VRDE_VIDEOIN_CTRLSEL_PU(0x00)
|
---|
340 | #define VRDE_VIDEOIN_CTRLSEL_PU_BACKLIGHT_COMPENSATION VRDE_VIDEOIN_CTRLSEL_PU(0x01)
|
---|
341 | #define VRDE_VIDEOIN_CTRLSEL_PU_BRIGHTNESS VRDE_VIDEOIN_CTRLSEL_PU(0x02)
|
---|
342 | #define VRDE_VIDEOIN_CTRLSEL_PU_CONTRAST VRDE_VIDEOIN_CTRLSEL_PU(0x03)
|
---|
343 | #define VRDE_VIDEOIN_CTRLSEL_PU_GAIN VRDE_VIDEOIN_CTRLSEL_PU(0x04)
|
---|
344 | #define VRDE_VIDEOIN_CTRLSEL_PU_POWER_LINE_FREQUENCY VRDE_VIDEOIN_CTRLSEL_PU(0x05)
|
---|
345 | #define VRDE_VIDEOIN_CTRLSEL_PU_HUE VRDE_VIDEOIN_CTRLSEL_PU(0x06)
|
---|
346 | #define VRDE_VIDEOIN_CTRLSEL_PU_SATURATION VRDE_VIDEOIN_CTRLSEL_PU(0x07)
|
---|
347 | #define VRDE_VIDEOIN_CTRLSEL_PU_SHARPNESS VRDE_VIDEOIN_CTRLSEL_PU(0x08)
|
---|
348 | #define VRDE_VIDEOIN_CTRLSEL_PU_GAMMA VRDE_VIDEOIN_CTRLSEL_PU(0x09)
|
---|
349 | #define VRDE_VIDEOIN_CTRLSEL_PU_WHITE_BALANCE_TEMPERATURE VRDE_VIDEOIN_CTRLSEL_PU(0x0A)
|
---|
350 | #define VRDE_VIDEOIN_CTRLSEL_PU_WHITE_BALANCE_TEMPERATURE_AUTO VRDE_VIDEOIN_CTRLSEL_PU(0x0B)
|
---|
351 | #define VRDE_VIDEOIN_CTRLSEL_PU_WHITE_BALANCE_COMPONENT VRDE_VIDEOIN_CTRLSEL_PU(0x0C)
|
---|
352 | #define VRDE_VIDEOIN_CTRLSEL_PU_WHITE_BALANCE_COMPONENT_AUTO VRDE_VIDEOIN_CTRLSEL_PU(0x0D)
|
---|
353 | #define VRDE_VIDEOIN_CTRLSEL_PU_DIGITAL_MULTIPLIER VRDE_VIDEOIN_CTRLSEL_PU(0x0E)
|
---|
354 | #define VRDE_VIDEOIN_CTRLSEL_PU_DIGITAL_MULTIPLIER_LIMIT VRDE_VIDEOIN_CTRLSEL_PU(0x0F)
|
---|
355 | #define VRDE_VIDEOIN_CTRLSEL_PU_HUE_AUTO VRDE_VIDEOIN_CTRLSEL_PU(0x10)
|
---|
356 | #define VRDE_VIDEOIN_CTRLSEL_PU_ANALOG_VIDEO_STANDARD VRDE_VIDEOIN_CTRLSEL_PU(0x11)
|
---|
357 | #define VRDE_VIDEOIN_CTRLSEL_PU_ANALOG_LOCK_STATUS VRDE_VIDEOIN_CTRLSEL_PU(0x12)
|
---|
358 |
|
---|
359 | #define VRDE_VIDEOIN_CTRLSEL_VS_UNDEFINED VRDE_VIDEOIN_CTRLSEL_VS(0x00)
|
---|
360 | #define VRDE_VIDEOIN_CTRLSEL_VS_START VRDE_VIDEOIN_CTRLSEL_VS(0x01)
|
---|
361 | #define VRDE_VIDEOIN_CTRLSEL_VS_STOP VRDE_VIDEOIN_CTRLSEL_VS(0x02)
|
---|
362 | #define VRDE_VIDEOIN_CTRLSEL_VS_STILL_IMAGE_TRIGGER VRDE_VIDEOIN_CTRLSEL_VS(0x05)
|
---|
363 | #define VRDE_VIDEOIN_CTRLSEL_VS_STREAM_ERROR_CODE VRDE_VIDEOIN_CTRLSEL_VS(0x06)
|
---|
364 | #define VRDE_VIDEOIN_CTRLSEL_VS_GENERATE_KEY_FRAME VRDE_VIDEOIN_CTRLSEL_VS(0x07)
|
---|
365 | #define VRDE_VIDEOIN_CTRLSEL_VS_UPDATE_FRAME_SEGMENT VRDE_VIDEOIN_CTRLSEL_VS(0x08)
|
---|
366 | #define VRDE_VIDEOIN_CTRLSEL_VS_SYNCH_DELAY VRDE_VIDEOIN_CTRLSEL_VS(0x09)
|
---|
367 |
|
---|
368 | #define VRDE_VIDEOIN_CTRLSEL_HW_BUTTON VRDE_VIDEOIN_CTRLSEL_HW(0x01)
|
---|
369 |
|
---|
370 | typedef struct VRDEVIDEOINCTRL_VIDEO_POWER_MODE
|
---|
371 | {
|
---|
372 | VRDEVIDEOINCTRLHDR hdr;
|
---|
373 | uint8_t u8DevicePowerMode;
|
---|
374 | } VRDEVIDEOINCTRL_VIDEO_POWER_MODE;
|
---|
375 |
|
---|
376 | typedef struct VRDEVIDEOINCTRL_CT_SCANNING_MODE
|
---|
377 | {
|
---|
378 | VRDEVIDEOINCTRLHDR hdr;
|
---|
379 | uint8_t u8ScanningMode;
|
---|
380 | } VRDEVIDEOINCTRL_CT_SCANNING_MODE;
|
---|
381 |
|
---|
382 | typedef struct VRDEVIDEOINCTRL_CT_AE_MODE
|
---|
383 | {
|
---|
384 | VRDEVIDEOINCTRLHDR hdr;
|
---|
385 | uint8_t u8AutoExposureMode;
|
---|
386 | } VRDEVIDEOINCTRL_CT_AE_MODE;
|
---|
387 |
|
---|
388 | typedef struct VRDEVIDEOINCTRL_CT_AE_PRIORITY
|
---|
389 | {
|
---|
390 | VRDEVIDEOINCTRLHDR hdr;
|
---|
391 | uint8_t u8AutoExposurePriority;
|
---|
392 | } VRDEVIDEOINCTRL_CT_AE_PRIORITY;
|
---|
393 |
|
---|
394 | typedef struct VRDEVIDEOINCTRL_CT_EXPOSURE_TIME_ABSOLUTE
|
---|
395 | {
|
---|
396 | VRDEVIDEOINCTRLHDR hdr;
|
---|
397 | uint32_t u32ExposureTimeAbsolute;
|
---|
398 | } VRDEVIDEOINCTRL_CT_EXPOSURE_TIME_ABSOLUTE;
|
---|
399 |
|
---|
400 | typedef struct VRDEVIDEOINCTRL_CT_EXPOSURE_TIME_RELATIVE
|
---|
401 | {
|
---|
402 | VRDEVIDEOINCTRLHDR hdr;
|
---|
403 | uint8_t u8ExposureTimeRelative;
|
---|
404 | } VRDEVIDEOINCTRL_CT_EXPOSURE_TIME_RELATIVE;
|
---|
405 |
|
---|
406 | typedef struct VRDEVIDEOINCTRL_CT_FOCUS_ABSOLUTE
|
---|
407 | {
|
---|
408 | VRDEVIDEOINCTRLHDR hdr;
|
---|
409 | uint16_t u16FocusAbsolute;
|
---|
410 | } VRDEVIDEOINCTRL_CT_FOCUS_ABSOLUTE;
|
---|
411 |
|
---|
412 | typedef struct VRDEVIDEOINCTRL_CT_FOCUS_RELATIVE
|
---|
413 | {
|
---|
414 | VRDEVIDEOINCTRLHDR hdr;
|
---|
415 | uint8_t u8FocusRelative;
|
---|
416 | uint8_t u8Speed;
|
---|
417 | } VRDEVIDEOINCTRL_CT_FOCUS_RELATIVE;
|
---|
418 |
|
---|
419 | typedef struct VRDEVIDEOINCTRL_CT_FOCUS_AUTO
|
---|
420 | {
|
---|
421 | VRDEVIDEOINCTRLHDR hdr;
|
---|
422 | uint8_t u8FocusAuto;
|
---|
423 | } VRDEVIDEOINCTRL_CT_FOCUS_AUTO;
|
---|
424 |
|
---|
425 | typedef struct VRDEVIDEOINCTRL_CT_IRIS_ABSOLUTE
|
---|
426 | {
|
---|
427 | VRDEVIDEOINCTRLHDR hdr;
|
---|
428 | uint16_t u16IrisAbsolute;
|
---|
429 | } VRDEVIDEOINCTRL_CT_IRIS_ABSOLUTE;
|
---|
430 |
|
---|
431 | typedef struct VRDEVIDEOINCTRL_CT_IRIS_RELATIVE
|
---|
432 | {
|
---|
433 | VRDEVIDEOINCTRLHDR hdr;
|
---|
434 | uint8_t u8IrisRelative;
|
---|
435 | } VRDEVIDEOINCTRL_CT_IRIS_RELATIVE;
|
---|
436 |
|
---|
437 | typedef struct VRDEVIDEOINCTRL_CT_ZOOM_ABSOLUTE
|
---|
438 | {
|
---|
439 | VRDEVIDEOINCTRLHDR hdr;
|
---|
440 | uint16_t u16ZoomAbsolute;
|
---|
441 | } VRDEVIDEOINCTRL_CT_ZOOM_ABSOLUTE;
|
---|
442 |
|
---|
443 | typedef struct VRDEVIDEOINCTRL_CT_ZOOM_RELATIVE
|
---|
444 | {
|
---|
445 | VRDEVIDEOINCTRLHDR hdr;
|
---|
446 | uint8_t u8Zoom;
|
---|
447 | uint8_t u8DigitalZoom;
|
---|
448 | uint8_t u8Speed;
|
---|
449 | } VRDEVIDEOINCTRL_CT_ZOOM_RELATIVE;
|
---|
450 |
|
---|
451 | typedef struct VRDEVIDEOINCTRL_CT_PANTILT_ABSOLUTE
|
---|
452 | {
|
---|
453 | VRDEVIDEOINCTRLHDR hdr;
|
---|
454 | uint32_t u32PanAbsolute;
|
---|
455 | uint32_t u32TiltAbsolute;
|
---|
456 | } VRDEVIDEOINCTRL_CT_PANTILT_ABSOLUTE;
|
---|
457 |
|
---|
458 | typedef struct VRDEVIDEOINCTRL_CT_PANTILT_RELATIVE
|
---|
459 | {
|
---|
460 | VRDEVIDEOINCTRLHDR hdr;
|
---|
461 | uint8_t u8PanRelative;
|
---|
462 | uint8_t u8PanSpeed;
|
---|
463 | uint8_t u8TiltRelative;
|
---|
464 | uint8_t u8TiltSpeed;
|
---|
465 | } VRDEVIDEOINCTRL_CT_PANTILT_RELATIVE;
|
---|
466 |
|
---|
467 | typedef struct VRDEVIDEOINCTRL_CT_ROLL_ABSOLUTE
|
---|
468 | {
|
---|
469 | VRDEVIDEOINCTRLHDR hdr;
|
---|
470 | uint16_t u16RollAbsolute;
|
---|
471 | } VRDEVIDEOINCTRL_CT_ROLL_ABSOLUTE;
|
---|
472 |
|
---|
473 | typedef struct VRDEVIDEOINCTRL_CT_ROLL_RELATIVE
|
---|
474 | {
|
---|
475 | VRDEVIDEOINCTRLHDR hdr;
|
---|
476 | uint8_t u8RollRelative;
|
---|
477 | uint8_t u8Speed;
|
---|
478 | } VRDEVIDEOINCTRL_CT_ROLL_RELATIVE;
|
---|
479 |
|
---|
480 | typedef struct VRDEVIDEOINCTRL_CT_PRIVACY_MODE
|
---|
481 | {
|
---|
482 | VRDEVIDEOINCTRLHDR hdr;
|
---|
483 | uint8_t u8Privacy;
|
---|
484 | } VRDEVIDEOINCTRL_CT_PRIVACY_MODE;
|
---|
485 |
|
---|
486 | typedef struct VRDEVIDEOINCTRL_PU_BACKLIGHT_COMPENSATION
|
---|
487 | {
|
---|
488 | VRDEVIDEOINCTRLHDR hdr;
|
---|
489 | uint16_t u16BacklightCompensation;
|
---|
490 | } VRDEVIDEOINCTRL_PU_BACKLIGHT_COMPENSATION;
|
---|
491 |
|
---|
492 | typedef struct VRDEVIDEOINCTRL_PU_BRIGHTNESS
|
---|
493 | {
|
---|
494 | VRDEVIDEOINCTRLHDR hdr;
|
---|
495 | uint16_t u16Brightness;
|
---|
496 | } VRDEVIDEOINCTRL_PU_BRIGHTNESS;
|
---|
497 |
|
---|
498 | typedef struct VRDEVIDEOINCTRL_PU_CONTRAST
|
---|
499 | {
|
---|
500 | VRDEVIDEOINCTRLHDR hdr;
|
---|
501 | uint16_t u16Contrast;
|
---|
502 | } VRDEVIDEOINCTRL_PU_CONTRAST;
|
---|
503 |
|
---|
504 | typedef struct VRDEVIDEOINCTRL_PU_GAIN
|
---|
505 | {
|
---|
506 | VRDEVIDEOINCTRLHDR hdr;
|
---|
507 | uint16_t u16Gain;
|
---|
508 | } VRDEVIDEOINCTRL_PU_GAIN;
|
---|
509 |
|
---|
510 | typedef struct VRDEVIDEOINCTRL_PU_POWER_LINE_FREQUENCY
|
---|
511 | {
|
---|
512 | VRDEVIDEOINCTRLHDR hdr;
|
---|
513 | uint16_t u16PowerLineFrequency;
|
---|
514 | } VRDEVIDEOINCTRL_PU_POWER_LINE_FREQUENCY;
|
---|
515 |
|
---|
516 | typedef struct VRDEVIDEOINCTRL_PU_HUE
|
---|
517 | {
|
---|
518 | VRDEVIDEOINCTRLHDR hdr;
|
---|
519 | uint16_t u16Hue;
|
---|
520 | } VRDEVIDEOINCTRL_PU_HUE;
|
---|
521 |
|
---|
522 | typedef struct VRDEVIDEOINCTRL_PU_HUE_AUTO
|
---|
523 | {
|
---|
524 | VRDEVIDEOINCTRLHDR hdr;
|
---|
525 | uint8_t u8HueAuto;
|
---|
526 | } VRDEVIDEOINCTRL_PU_HUE_AUTO;
|
---|
527 |
|
---|
528 | typedef struct VRDEVIDEOINCTRL_PU_SATURATION
|
---|
529 | {
|
---|
530 | VRDEVIDEOINCTRLHDR hdr;
|
---|
531 | uint16_t u16Saturation;
|
---|
532 | } VRDEVIDEOINCTRL_PU_SATURATION;
|
---|
533 |
|
---|
534 | typedef struct VRDEVIDEOINCTRL_PU_SHARPNESS
|
---|
535 | {
|
---|
536 | VRDEVIDEOINCTRLHDR hdr;
|
---|
537 | uint16_t u16Sharpness;
|
---|
538 | } VRDEVIDEOINCTRL_PU_SHARPNESS;
|
---|
539 |
|
---|
540 | typedef struct VRDEVIDEOINCTRL_PU_GAMMA
|
---|
541 | {
|
---|
542 | VRDEVIDEOINCTRLHDR hdr;
|
---|
543 | uint16_t u16Gamma;
|
---|
544 | } VRDEVIDEOINCTRL_PU_GAMMA;
|
---|
545 |
|
---|
546 | typedef struct VRDEVIDEOINCTRL_PU_WHITE_BALANCE_TEMPERATURE
|
---|
547 | {
|
---|
548 | VRDEVIDEOINCTRLHDR hdr;
|
---|
549 | uint16_t u16WhiteBalanceTemperature;
|
---|
550 | } VRDEVIDEOINCTRL_PU_WHITE_BALANCE_TEMPERATURE;
|
---|
551 |
|
---|
552 | typedef struct VRDEVIDEOINCTRL_PU_WHITE_BALANCE_TEMPERATURE_AUTO
|
---|
553 | {
|
---|
554 | VRDEVIDEOINCTRLHDR hdr;
|
---|
555 | uint8_t u8WhiteBalanceTemperatureAuto;
|
---|
556 | } VRDEVIDEOINCTRL_PU_WHITE_BALANCE_TEMPERATURE_AUTO;
|
---|
557 |
|
---|
558 | typedef struct VRDEVIDEOINCTRL_PU_WHITE_BALANCE_COMPONENT
|
---|
559 | {
|
---|
560 | VRDEVIDEOINCTRLHDR hdr;
|
---|
561 | uint16_t u16WhiteBalanceBlue;
|
---|
562 | uint16_t u16WhiteBalanceRed;
|
---|
563 | } VRDEVIDEOINCTRL_PU_WHITE_BALANCE_COMPONENT;
|
---|
564 |
|
---|
565 | typedef struct VRDEVIDEOINCTRL_PU_WHITE_BALANCE_COMPONENT_AUTO
|
---|
566 | {
|
---|
567 | VRDEVIDEOINCTRLHDR hdr;
|
---|
568 | uint8_t u8WhiteBalanceComponentAuto;
|
---|
569 | } VRDEVIDEOINCTRL_PU_WHITE_BALANCE_COMPONENT_AUTO;
|
---|
570 |
|
---|
571 | typedef struct VRDEVIDEOINCTRL_PU_DIGITAL_MULTIPLIER
|
---|
572 | {
|
---|
573 | VRDEVIDEOINCTRLHDR hdr;
|
---|
574 | uint16_t u16MultiplierStep;
|
---|
575 | } VRDEVIDEOINCTRL_PU_DIGITAL_MULTIPLIER;
|
---|
576 |
|
---|
577 | typedef struct VRDEVIDEOINCTRL_PU_DIGITAL_MULTIPLIER_LIMIT
|
---|
578 | {
|
---|
579 | VRDEVIDEOINCTRLHDR hdr;
|
---|
580 | uint16_t u16MultiplierLimit;
|
---|
581 | } VRDEVIDEOINCTRL_PU_DIGITAL_MULTIPLIER_LIMIT;
|
---|
582 |
|
---|
583 | typedef struct VRDEVIDEOINCTRL_PU_ANALOG_VIDEO_STANDARD
|
---|
584 | {
|
---|
585 | VRDEVIDEOINCTRLHDR hdr;
|
---|
586 | uint8_t u8VideoStandard;
|
---|
587 | } VRDEVIDEOINCTRL_PU_ANALOG_VIDEO_STANDARD;
|
---|
588 |
|
---|
589 | typedef struct VRDEVIDEOINCTRL_PU_ANALOG_LOCK_STATUS
|
---|
590 | {
|
---|
591 | VRDEVIDEOINCTRLHDR hdr;
|
---|
592 | uint8_t u8Status;
|
---|
593 | } VRDEVIDEOINCTRL_PU_ANALOG_LOCK_STATUS;
|
---|
594 |
|
---|
595 | /* Start sending video frames with this format. */
|
---|
596 | #define VRDEVIDEOINCTRL_F_VS_START_FID 0x01
|
---|
597 | #define VRDEVIDEOINCTRL_F_VS_START_EOF 0x02
|
---|
598 |
|
---|
599 | typedef struct VRDEVIDEOINCTRL_VS_START
|
---|
600 | {
|
---|
601 | VRDEVIDEOINCTRLHDR hdr;
|
---|
602 | uint8_t u8FormatId; /* The format id on the client: VRDEVIDEOINFORMATDESC::u8FormatId. */
|
---|
603 | uint8_t u8FramingInfo; /* VRDEVIDEOINCTRL_F_VS_START_*. Set by the client. */
|
---|
604 | VRDEVIDEOINFRAMESIZE frameSize;
|
---|
605 | uint32_t u32FrameInterval; /* Frame interval in 100 ns units, 0 means a still image capture.
|
---|
606 | * The client may choose a different interval if this value is
|
---|
607 | * not supported.
|
---|
608 | */
|
---|
609 | uint16_t u16CompQuality; /* 0 .. 10000 = 0 .. 100%.
|
---|
610 | * Applicable if the format has VRDE_VIDEOIN_F_FMT_COMPQUALITY,
|
---|
611 | * otherwise this field is ignored.
|
---|
612 | */
|
---|
613 | uint16_t u16Delay; /* Latency in ms from video data capture to presentation on the channel.
|
---|
614 | * Set by the client, read by the server.
|
---|
615 | */
|
---|
616 | uint32_t u32ClockFrequency; /* @todo just all clocks in 100ns units? */
|
---|
617 | } VRDEVIDEOINCTRL_VS_START;
|
---|
618 |
|
---|
619 | /* Stop sending video frames. */
|
---|
620 | typedef struct VRDEVIDEOINCTRL_VS_STOP
|
---|
621 | {
|
---|
622 | VRDEVIDEOINCTRLHDR hdr;
|
---|
623 | } VRDEVIDEOINCTRL_VS_STOP;
|
---|
624 |
|
---|
625 | typedef struct VRDEVIDEOINCTRL_VS_SYNCH_DELAY
|
---|
626 | {
|
---|
627 | VRDEVIDEOINCTRLHDR hdr;
|
---|
628 | uint16_t u16Delay;
|
---|
629 | } VRDEVIDEOINCTRL_VS_SYNCH_DELAY;
|
---|
630 |
|
---|
631 | typedef struct VRDEVIDEOINCTRL_VS_STILL_IMAGE_TRIGGER
|
---|
632 | {
|
---|
633 | VRDEVIDEOINCTRLHDR hdr;
|
---|
634 | uint8_t u8Trigger;
|
---|
635 | } VRDEVIDEOINCTRL_VS_STILL_IMAGE_TRIGGER;
|
---|
636 |
|
---|
637 | typedef struct VRDEVIDEOINCTRL_VS_GENERATE_KEY_FRAME
|
---|
638 | {
|
---|
639 | VRDEVIDEOINCTRLHDR hdr;
|
---|
640 | uint8_t u8GenerateKeyFrame;
|
---|
641 | } VRDEVIDEOINCTRL_VS_GENERATE_KEY_FRAME;
|
---|
642 |
|
---|
643 | typedef struct VRDEVIDEOINCTRL_VS_UPDATE_FRAME_SEGMENT
|
---|
644 | {
|
---|
645 | VRDEVIDEOINCTRLHDR hdr;
|
---|
646 | uint8_t u8StartFrameSegment;
|
---|
647 | uint8_t u8EndFrameSegment;
|
---|
648 | } VRDEVIDEOINCTRL_VS_UPDATE_FRAME_SEGMENT;
|
---|
649 |
|
---|
650 | typedef struct VRDEVIDEOINCTRL_VS_STREAM_ERROR_CODE
|
---|
651 | {
|
---|
652 | VRDEVIDEOINCTRLHDR hdr;
|
---|
653 | uint8_t u8StreamErrorCode;
|
---|
654 | } VRDEVIDEOINCTRL_VS_STREAM_ERROR_CODE;
|
---|
655 |
|
---|
656 | /* A hardware button was pressed/released on the device. */
|
---|
657 | typedef struct VRDEVIDEOINCTRL_HW_BUTTON
|
---|
658 | {
|
---|
659 | VRDEVIDEOINCTRLHDR hdr;
|
---|
660 | uint8_t u8Pressed;
|
---|
661 | } VRDEVIDEOINCTRL_CT_HW_BUTTON;
|
---|
662 |
|
---|
663 | /*
|
---|
664 | * Payload transfers. How frames are sent to the server:
|
---|
665 | * the client send a PAYLOAD packet, which has the already set format.
|
---|
666 | * The server enables the transfers by sending VRDEVIDEOINCTRL_VS_START.
|
---|
667 | */
|
---|
668 |
|
---|
669 | /* Payload header */
|
---|
670 | typedef struct VRDEVIDEOINPAYLOADHDR
|
---|
671 | {
|
---|
672 | uint8_t u8HeaderLength; /* Entire header. */
|
---|
673 | uint8_t u8HeaderInfo; /* VRDE_VIDEOIN_PAYLOAD_F_* */
|
---|
674 | uint32_t u32PresentationTime; /* @todo define this */
|
---|
675 | uint32_t u32SourceTimeClock; /* @todo At the moment when the frame was sent to the channel.
|
---|
676 | * Allows the server to measure clock drift.
|
---|
677 | */
|
---|
678 | uint16_t u16Reserved; /* @todo */
|
---|
679 | } VRDEVIDEOINPAYLOADHDR;
|
---|
680 |
|
---|
681 | /* VRDEVIDEOINPAYLOADHDR::u8HeaderInfo */
|
---|
682 | #define VRDE_VIDEOIN_PAYLOAD_F_FID 0x01 /* Frame ID */
|
---|
683 | #define VRDE_VIDEOIN_PAYLOAD_F_EOF 0x02 /* End of Frame */
|
---|
684 | #define VRDE_VIDEOIN_PAYLOAD_F_PTS 0x04 /* Presentation Time */
|
---|
685 | #define VRDE_VIDEOIN_PAYLOAD_F_SCR 0x08 /* Source Clock Reference */
|
---|
686 | #define VRDE_VIDEOIN_PAYLOAD_F_RES 0x10 /* Reserved */
|
---|
687 | #define VRDE_VIDEOIN_PAYLOAD_F_STI 0x20 /* Still Image */
|
---|
688 | #define VRDE_VIDEOIN_PAYLOAD_F_ERR 0x40 /* Error */
|
---|
689 | #define VRDE_VIDEOIN_PAYLOAD_F_EOH 0x80 /* End of header */
|
---|
690 |
|
---|
691 |
|
---|
692 | /*
|
---|
693 | * The network channel specification.
|
---|
694 | */
|
---|
695 |
|
---|
696 | /*
|
---|
697 | * The protocol uses a dynamic RDP channel.
|
---|
698 | * Everything is little-endian.
|
---|
699 | */
|
---|
700 |
|
---|
701 | #define VRDE_VIDEOIN_CHANNEL "RVIDEOIN"
|
---|
702 |
|
---|
703 | /* Major functions. */
|
---|
704 | #define VRDE_VIDEOIN_FN_NEGOTIATE 0x0000 /* Version and capabilities check. */
|
---|
705 | #define VRDE_VIDEOIN_FN_NOTIFY 0x0001 /* Device attach/detach from the client. */
|
---|
706 | #define VRDE_VIDEOIN_FN_DEVICEDESC 0x0002 /* Query device description. */
|
---|
707 | #define VRDE_VIDEOIN_FN_CONTROL 0x0003 /* Control the device and start/stop video input. */
|
---|
708 | #define VRDE_VIDEOIN_FN_CONTROL_NOTIFY 0x0004 /* The client reports a control change, etc. */
|
---|
709 | #define VRDE_VIDEOIN_FN_FRAME 0x0005 /* Frame from the client. */
|
---|
710 |
|
---|
711 | /* Status codes. */
|
---|
712 | #define VRDE_VIDEOIN_STATUS_SUCCESS 0 /* Function completed successfully. */
|
---|
713 | #define VRDE_VIDEOIN_STATUS_FAILED 1 /* Failed for some reason. */
|
---|
714 |
|
---|
715 | typedef struct VRDEVIDEOINMSGHDR
|
---|
716 | {
|
---|
717 | uint32_t u32Length; /* The length of the message in bytes, including the header. */
|
---|
718 | uint32_t u32DeviceId; /* The client's device id. */
|
---|
719 | uint32_t u32MessageId; /* Unique id assigned by the server. The client must send a reply with the same id.
|
---|
720 | * If the client initiates a request, then this must be set to 0, because there is
|
---|
721 | * currently no client requests, which would require a response from the server.
|
---|
722 | */
|
---|
723 | uint16_t u16FunctionId; /* VRDE_VIDEOIN_FN_* */
|
---|
724 | uint16_t u16Status; /* The result of a request. VRDE_VIDEOIN_STATUS_*. */
|
---|
725 | } VRDEVIDEOINMSGHDR;
|
---|
726 | ASSERTSIZE(VRDEVIDEOINMSGHDR, 16)
|
---|
727 |
|
---|
728 | /*
|
---|
729 | * VRDE_VIDEOIN_FN_NEGOTIATE
|
---|
730 | *
|
---|
731 | * Sent by the server when the channel is established and the client replies with its capabilities.
|
---|
732 | */
|
---|
733 | #define VRDE_VIDEOIN_NEGOTIATE_VERSION 1
|
---|
734 |
|
---|
735 | #define VRDE_VIDEOIN_NEGOTIATE_CAP_VOID 0
|
---|
736 |
|
---|
737 | typedef struct VRDEVIDEOINMSG_NEGOTIATE
|
---|
738 | {
|
---|
739 | VRDEVIDEOINMSGHDR hdr;
|
---|
740 | uint32_t u32Version; /* VRDE_VIDEOIN_NEGOTIATE_VERSION */
|
---|
741 | uint32_t fu32Capabilities; /* VRDE_VIDEOIN_NEGOTIATE_CAP_* */
|
---|
742 | } VRDEVIDEOINMSG_NEGOTIATE;
|
---|
743 |
|
---|
744 | /*
|
---|
745 | * VRDE_VIDEOIN_FN_NOTIFY
|
---|
746 | *
|
---|
747 | * Sent by the client when a webcam is attached or detached.
|
---|
748 | * The client must send the ATTACH notification for each webcam, which is
|
---|
749 | * already connected to the client when the VIDEOIN channel is established.
|
---|
750 | */
|
---|
751 | #define VRDE_VIDEOIN_NOTIFY_ATTACH 0
|
---|
752 | #define VRDE_VIDEOIN_NOTIFY_DETACH 1
|
---|
753 |
|
---|
754 | typedef struct VRDEVIDEOINMSG_NOTIFY
|
---|
755 | {
|
---|
756 | VRDEVIDEOINMSGHDR hdr;
|
---|
757 | uint32_t u32NotifyEvent; /* VRDE_VIDEOIN_NOTIFY_* */
|
---|
758 | /* Event specific data may follow. The underlying protocol provides the length of the message. */
|
---|
759 | } VRDEVIDEOINMSG_NOTIFY;
|
---|
760 |
|
---|
761 | /*
|
---|
762 | * VRDE_VIDEOIN_FN_DEVICEDESC
|
---|
763 | *
|
---|
764 | * The server queries the description of a device.
|
---|
765 | */
|
---|
766 | typedef struct VRDEVIDEOINMSG_DEVICEDESC_REQ
|
---|
767 | {
|
---|
768 | VRDEVIDEOINMSGHDR hdr;
|
---|
769 | } VRDEVIDEOINMSG_DEVICEDESC_REQ;
|
---|
770 |
|
---|
771 | typedef struct VRDEVIDEOINMSG_DEVICEDESC_RSP
|
---|
772 | {
|
---|
773 | VRDEVIDEOINMSGHDR hdr;
|
---|
774 | VRDEVIDEOINDEVICEDESC Device;
|
---|
775 | /*
|
---|
776 | * VRDEVIDEOINFORMATDESC[0]
|
---|
777 | * VRDEVIDEOINFRAMEDESC[0]
|
---|
778 | * ...
|
---|
779 | * VRDEVIDEOINFRAMEDESC[n]
|
---|
780 | * VRDEVIDEOINFORMATDESC[1]
|
---|
781 | * VRDEVIDEOINFRAMEDESC[0]
|
---|
782 | * ...
|
---|
783 | * VRDEVIDEOINFRAMEDESC[m]
|
---|
784 | * ...
|
---|
785 | */
|
---|
786 | } VRDEVIDEOINMSG_DEVICEDESC_RSP;
|
---|
787 |
|
---|
788 | /*
|
---|
789 | * VRDE_VIDEOIN_FN_CONTROL
|
---|
790 | * VRDE_VIDEOIN_FN_CONTROL_NOTIFY
|
---|
791 | *
|
---|
792 | * Either sent by the server or by the client as a notification/response.
|
---|
793 | * If sent by the client as a notification, then hdr.u32MessageId must be 0.
|
---|
794 | */
|
---|
795 | typedef struct VRDEVIDEOINMSG_CONTROL
|
---|
796 | {
|
---|
797 | VRDEVIDEOINMSGHDR hdr;
|
---|
798 | VRDEVIDEOINCTRLHDR Control;
|
---|
799 | /* Control specific data may follow. */
|
---|
800 | } VRDEVIDEOINMSG_CONTROL;
|
---|
801 |
|
---|
802 | /*
|
---|
803 | * VRDE_VIDEOIN_FN_FRAME
|
---|
804 | *
|
---|
805 | * The client sends a video/still frame in the already specified format.
|
---|
806 | * hdr.u32MessageId must be 0.
|
---|
807 | */
|
---|
808 | typedef struct VRDEVIDEOINMSG_FRAME
|
---|
809 | {
|
---|
810 | VRDEVIDEOINMSGHDR hdr;
|
---|
811 | VRDEVIDEOINPAYLOADHDR Payload;
|
---|
812 | /* The frame data follow. */
|
---|
813 | } VRDEVIDEOINMSG_FRAME;
|
---|
814 |
|
---|
815 |
|
---|
816 | #ifdef VRDE_VIDEOIN_WITH_VRDEINTERFACE
|
---|
817 | /*
|
---|
818 | * The application interface between VirtualBox and the VRDE server.
|
---|
819 | */
|
---|
820 |
|
---|
821 | #define VRDE_VIDEOIN_INTERFACE_NAME "VIDEOIN"
|
---|
822 |
|
---|
823 | typedef struct VRDEVIDEOINDEVICEHANDLE
|
---|
824 | {
|
---|
825 | uint32_t u32ClientId;
|
---|
826 | uint32_t u32DeviceId;
|
---|
827 | } VRDEVIDEOINDEVICEHANDLE;
|
---|
828 |
|
---|
829 | /* The VRDE server video input interface entry points. Interface version 1. */
|
---|
830 | typedef struct VRDEVIDEOININTERFACE
|
---|
831 | {
|
---|
832 | /* The header. */
|
---|
833 | VRDEINTERFACEHDR header;
|
---|
834 |
|
---|
835 | /* Tell the server that this device will be used and associate a context with the device.
|
---|
836 | *
|
---|
837 | * @param hServer The VRDE server instance.
|
---|
838 | * @param pDeviceHandle The device reported by ATTACH notification.
|
---|
839 | * @param pvDeviceCtx The caller context associated with the pDeviceHandle.
|
---|
840 | *
|
---|
841 | * @return IPRT status code.
|
---|
842 | */
|
---|
843 | DECLR3CALLBACKMEMBER(int, VRDEVideoInDeviceAttach, (HVRDESERVER hServer,
|
---|
844 | const VRDEVIDEOINDEVICEHANDLE *pDeviceHandle,
|
---|
845 | void *pvDeviceCtx));
|
---|
846 |
|
---|
847 | /* This device will be not be used anymore. The device context must not be used by the server too.
|
---|
848 | *
|
---|
849 | * @param hServer The VRDE server instance.
|
---|
850 | * @param pDeviceHandle The device reported by ATTACH notification.
|
---|
851 | *
|
---|
852 | * @return IPRT status code.
|
---|
853 | */
|
---|
854 | DECLR3CALLBACKMEMBER(int, VRDEVideoInDeviceDetach, (HVRDESERVER hServer,
|
---|
855 | const VRDEVIDEOINDEVICEHANDLE *pDeviceHandle));
|
---|
856 |
|
---|
857 | /* Get a device description.
|
---|
858 | *
|
---|
859 | * @param hServer The VRDE server instance.
|
---|
860 | * @param pvUser The callers context of this request.
|
---|
861 | * @param pDeviceHandle The device reported by ATTACH notification.
|
---|
862 | *
|
---|
863 | * @return IPRT status code.
|
---|
864 | */
|
---|
865 | DECLR3CALLBACKMEMBER(int, VRDEVideoInGetDeviceDesc, (HVRDESERVER hServer,
|
---|
866 | void *pvUser,
|
---|
867 | const VRDEVIDEOINDEVICEHANDLE *pDeviceHandle));
|
---|
868 |
|
---|
869 | /* Submit a set/get control request.
|
---|
870 | *
|
---|
871 | * @param hServer The VRDE server instance.
|
---|
872 | * @param pvUser The callers context of this request.
|
---|
873 | * @param pDeviceHandle The device reported by ATTACH notification.
|
---|
874 | * @param pReq The request.
|
---|
875 | * @param cbReq Size of the request.
|
---|
876 | *
|
---|
877 | * @return IPRT status code.
|
---|
878 | */
|
---|
879 | DECLR3CALLBACKMEMBER(int, VRDEVideoInControl, (HVRDESERVER hServer,
|
---|
880 | void *pvUser,
|
---|
881 | const VRDEVIDEOINDEVICEHANDLE *pDeviceHandle,
|
---|
882 | VRDEVIDEOINCTRLHDR *pReq,
|
---|
883 | uint32_t cbReq));
|
---|
884 |
|
---|
885 | } VRDEVIDEOININTERFACE;
|
---|
886 |
|
---|
887 |
|
---|
888 | /*
|
---|
889 | * Notifications.
|
---|
890 | * Data structures: pvData of VRDEVIDEOINCALLBACKS::VRDECallbackVideoInNotify.
|
---|
891 | */
|
---|
892 | typedef struct VRDEVIDEOINNOTIFYATTACH
|
---|
893 | {
|
---|
894 | VRDEVIDEOINDEVICEHANDLE deviceHandle;
|
---|
895 | } VRDEVIDEOINNOTIFYATTACH;
|
---|
896 |
|
---|
897 | typedef struct VRDEVIDEOINNOTIFYDETACH
|
---|
898 | {
|
---|
899 | VRDEVIDEOINDEVICEHANDLE deviceHandle;
|
---|
900 | } VRDEVIDEOINNOTIFYDETACH;
|
---|
901 |
|
---|
902 |
|
---|
903 | /* Video input interface callbacks. */
|
---|
904 | typedef struct VRDEVIDEOINCALLBACKS
|
---|
905 | {
|
---|
906 | /** The header. */
|
---|
907 | VRDEINTERFACEHDR header;
|
---|
908 |
|
---|
909 | /* Notifications.
|
---|
910 | *
|
---|
911 | * @param pvCallback The callbacks context specified in VRDEGetInterface.
|
---|
912 | * @param u32EventId The notification identifier: VRDE_VIDEOIN_NOTIFY_*.
|
---|
913 | * @param pvData The notification specific data.
|
---|
914 | * @param cbData The size of buffer pointed by pvData.
|
---|
915 | */
|
---|
916 | DECLR3CALLBACKMEMBER(void, VRDECallbackVideoInNotify,(void *pvCallback,
|
---|
917 | uint32_t u32Id,
|
---|
918 | const void *pvData,
|
---|
919 | uint32_t cbData));
|
---|
920 |
|
---|
921 | /* Device description received from the client.
|
---|
922 | *
|
---|
923 | * @param pvCallback The callbacks context specified in VRDEGetInterface.
|
---|
924 | * @param rcRequest The result code of the request.
|
---|
925 | * @param pDeviceCtx The device context associated with the device in VRDEVideoInGetDeviceDesc.
|
---|
926 | * @param pvUser The pvUser parameter of VRDEVideoInGetDeviceDesc.
|
---|
927 | * @param pDeviceDesc The device description.
|
---|
928 | * @param cbDevice The size of buffer pointed by pDevice.
|
---|
929 | */
|
---|
930 | DECLR3CALLBACKMEMBER(void, VRDECallbackVideoInDeviceDesc,(void *pvCallback,
|
---|
931 | int rcRequest,
|
---|
932 | void *pDeviceCtx,
|
---|
933 | void *pvUser,
|
---|
934 | const VRDEVIDEOINDEVICEDESC *pDeviceDesc,
|
---|
935 | uint32_t cbDevice));
|
---|
936 |
|
---|
937 | /* Control response or notification.
|
---|
938 | *
|
---|
939 | * @param pvCallback The callbacks context specified in VRDEGetInterface.
|
---|
940 | * @param rcRequest The result code of the request.
|
---|
941 | * @param pDeviceCtx The device context associated with the device in VRDEVideoInGetDeviceDesc.
|
---|
942 | * @param pvUser The pvUser parameter of VRDEVideoInControl. NULL if this is a notification.
|
---|
943 | * @param pControl The control information.
|
---|
944 | * @param cbControl The size of buffer pointed by pControl.
|
---|
945 | */
|
---|
946 | DECLR3CALLBACKMEMBER(void, VRDECallbackVideoInControl,(void *pvCallback,
|
---|
947 | int rcRequest,
|
---|
948 | void *pDeviceCtx,
|
---|
949 | void *pvUser,
|
---|
950 | const VRDEVIDEOINCTRLHDR *pControl,
|
---|
951 | uint32_t cbControl));
|
---|
952 |
|
---|
953 | /* Frame which was received from the client.
|
---|
954 | *
|
---|
955 | * @param pvCallback The callbacks context specified in VRDEGetInterface.
|
---|
956 | * @param rcRequest The result code of the request.
|
---|
957 | * @param pDeviceCtx The device context associated with the device in VRDEVideoInGetDeviceDesc.
|
---|
958 | * @param pFrame The frame data.
|
---|
959 | * @param cbFrame The size of buffer pointed by pFrame.
|
---|
960 | */
|
---|
961 | DECLR3CALLBACKMEMBER(void, VRDECallbackVideoInFrame,(void *pvCallback,
|
---|
962 | int rcRequest,
|
---|
963 | void *pDeviceCtx,
|
---|
964 | const VRDEVIDEOINPAYLOADHDR *pFrame,
|
---|
965 | uint32_t cbFrame));
|
---|
966 |
|
---|
967 | } VRDEVIDEOINCALLBACKS;
|
---|
968 | #endif /* VRDE_VIDEOIN_WITH_VRDEINTERFACE */
|
---|
969 |
|
---|
970 | #pragma pack()
|
---|
971 |
|
---|
972 | #endif
|
---|