FreeRDP
channels/rdpecam.h
1 
20 #ifndef FREERDP_CHANNEL_RDPECAM_H
21 #define FREERDP_CHANNEL_RDPECAM_H
22 
23 #include <freerdp/api.h>
24 #include <freerdp/dvc.h>
25 #include <freerdp/types.h>
26 
31 #define RDPECAM_CHANNEL_NAME "rdpecam"
32 #define RDPECAM_DVC_CHANNEL_NAME "rdpecam"
33 #define RDPECAM_CONTROL_DVC_CHANNEL_NAME "RDCamera_Device_Enumerator"
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40  typedef enum
41  {
42  CAM_MSG_ID_SuccessResponse = 0x01,
43  CAM_MSG_ID_ErrorResponse = 0x02,
44  CAM_MSG_ID_SelectVersionRequest = 0x03,
45  CAM_MSG_ID_SelectVersionResponse = 0x04,
46  CAM_MSG_ID_DeviceAddedNotification = 0x05,
47  CAM_MSG_ID_DeviceRemovedNotification = 0x06,
48  CAM_MSG_ID_ActivateDeviceRequest = 0x07,
49  CAM_MSG_ID_DeactivateDeviceRequest = 0x08,
50  CAM_MSG_ID_StreamListRequest = 0x09,
51  CAM_MSG_ID_StreamListResponse = 0x0A,
52  CAM_MSG_ID_MediaTypeListRequest = 0x0B,
53  CAM_MSG_ID_MediaTypeListResponse = 0x0C,
54  CAM_MSG_ID_CurrentMediaTypeRequest = 0x0D,
55  CAM_MSG_ID_CurrentMediaTypeResponse = 0x0E,
56  CAM_MSG_ID_StartStreamsRequest = 0x0F,
57  CAM_MSG_ID_StopStreamsRequest = 0x10,
58  CAM_MSG_ID_SampleRequest = 0x11,
59  CAM_MSG_ID_SampleResponse = 0x12,
60  CAM_MSG_ID_SampleErrorResponse = 0x13,
61  CAM_MSG_ID_PropertyListRequest = 0x14,
62  CAM_MSG_ID_PropertyListResponse = 0x15,
63  CAM_MSG_ID_PropertyValueRequest = 0x16,
64  CAM_MSG_ID_PropertyValueResponse = 0x17,
65  CAM_MSG_ID_SetPropertyValueRequest = 0x18,
66  } CAM_MSG_ID;
67 
68 #define CAM_HEADER_SIZE 2
69 
70 typedef struct
71 {
72  BYTE Version;
73  CAM_MSG_ID MessageId;
75 
76 /* Messages Exchanged on the Device Enumeration Channel (2.2.2) */
77 
78 typedef struct
79 {
80  CAM_SHARED_MSG_HEADER Header;
82 
83 typedef struct
84 {
85  CAM_SHARED_MSG_HEADER Header;
87 
88 typedef struct
89 {
90  CAM_SHARED_MSG_HEADER Header;
91  WCHAR* DeviceName;
92  char* VirtualChannelName;
94 
95 typedef struct
96 {
97  CAM_SHARED_MSG_HEADER Header;
98  char* VirtualChannelName;
100 
101 /* Messages Exchanged on Device Channels (2.2.3) */
102 
103 typedef struct
104 {
105  CAM_SHARED_MSG_HEADER Header;
107 
108 typedef enum
109 {
110  CAM_ERROR_CODE_UnexpectedError = 0x00000001,
111  CAM_ERROR_CODE_InvalidMessage = 0x00000002,
112  CAM_ERROR_CODE_NotInitialized = 0x00000003,
113  CAM_ERROR_CODE_InvalidRequest = 0x00000004,
114  CAM_ERROR_CODE_InvalidStreamNumber = 0x00000005,
115  CAM_ERROR_CODE_InvalidMediaType = 0x00000006,
116  CAM_ERROR_CODE_OutOfMemory = 0x00000007,
117  CAM_ERROR_CODE_ItemNotFound = 0x00000008,
118  CAM_ERROR_CODE_SetNotFound = 0x00000009,
119  CAM_ERROR_CODE_OperationNotSupported = 0x0000000A,
120 } CAM_ERROR_CODE;
121 
122 typedef struct
123 {
124  CAM_SHARED_MSG_HEADER Header;
125  CAM_ERROR_CODE ErrorCode;
127 
128 typedef struct
129 {
130  CAM_SHARED_MSG_HEADER Header;
132 
133 typedef struct
134 {
135  CAM_SHARED_MSG_HEADER Header;
137 
138 typedef struct
139 {
140  CAM_SHARED_MSG_HEADER Header;
142 
143 typedef enum
144 {
145  CAM_STREAM_FRAME_SOURCE_TYPE_Color = 0x0001,
146  CAM_STREAM_FRAME_SOURCE_TYPE_Infrared = 0x0002,
147  CAM_STREAM_FRAME_SOURCE_TYPE_Custom = 0x0008,
148 } CAM_STREAM_FRAME_SOURCE_TYPES;
149 
150 typedef enum
151 {
152  CAM_STREAM_CATEGORY_Capture = 0x01,
153 } CAM_STREAM_CATEGORY;
154 
155 typedef struct
156 {
157  CAM_STREAM_FRAME_SOURCE_TYPES FrameSourceTypes;
158  CAM_STREAM_CATEGORY StreamCategory;
159  BYTE Selected;
160  BYTE CanBeShared;
162 
163 typedef struct
164 {
165  CAM_SHARED_MSG_HEADER Header;
166  BYTE N_Descriptions;
167  CAM_STREAM_DESCRIPTION StreamDescriptions[255];
169 
170 typedef struct
171 {
172  CAM_SHARED_MSG_HEADER Header;
173  BYTE StreamIndex;
175 
176 typedef enum
177 {
178  CAM_MEDIA_FORMAT_INVALID = 0x00,
179  CAM_MEDIA_FORMAT_H264 = 0x01,
180  CAM_MEDIA_FORMAT_MJPG = 0x02,
181  CAM_MEDIA_FORMAT_YUY2 = 0x03,
182  CAM_MEDIA_FORMAT_NV12 = 0x04,
183  CAM_MEDIA_FORMAT_I420 = 0x05,
184  CAM_MEDIA_FORMAT_RGB24 = 0x06,
185  CAM_MEDIA_FORMAT_RGB32 = 0x07,
186 } CAM_MEDIA_FORMAT;
187 
188 typedef enum
189 {
190  CAM_MEDIA_TYPE_DESCRIPTION_FLAG_DecodingRequired = 0x01,
191  CAM_MEDIA_TYPE_DESCRIPTION_FLAG_BottomUpImage = 0x02,
192 } CAM_MEDIA_TYPE_DESCRIPTION_FLAGS;
193 
194 typedef struct
195 {
196  CAM_MEDIA_FORMAT Format;
197  UINT32 Width;
198  UINT32 Height;
199  UINT32 FrameRateNumerator;
200  UINT32 FrameRateDenominator;
201  UINT32 PixelAspectRatioNumerator;
202  UINT32 PixelAspectRatioDenominator;
203  CAM_MEDIA_TYPE_DESCRIPTION_FLAGS Flags;
205 
206 typedef struct
207 {
208  CAM_SHARED_MSG_HEADER Header;
209  size_t N_Descriptions;
210  CAM_MEDIA_TYPE_DESCRIPTION* MediaTypeDescriptions;
212 
213 typedef struct
214 {
215  CAM_SHARED_MSG_HEADER Header;
216  BYTE StreamIndex;
218 
219 typedef struct
220 {
221  CAM_SHARED_MSG_HEADER Header;
222  CAM_MEDIA_TYPE_DESCRIPTION MediaTypeDescription;
224 
225 typedef struct
226 {
227  BYTE StreamIndex;
228  CAM_MEDIA_TYPE_DESCRIPTION MediaTypeDescription;
230 
231 typedef struct
232 {
233  CAM_SHARED_MSG_HEADER Header;
234  BYTE N_Infos;
235  CAM_START_STREAM_INFO StartStreamsInfo[255];
237 
238 typedef struct
239 {
240  CAM_SHARED_MSG_HEADER Header;
242 
243 typedef struct
244 {
245  CAM_SHARED_MSG_HEADER Header;
246  BYTE StreamIndex;
248 
249 typedef struct
250 {
251  CAM_SHARED_MSG_HEADER Header;
252  BYTE StreamIndex;
253  size_t SampleSize;
254  BYTE* Sample;
256 
257 typedef struct
258 {
259  CAM_SHARED_MSG_HEADER Header;
260  BYTE StreamIndex;
261  CAM_ERROR_CODE ErrorCode;
263 
264 typedef struct
265 {
266  CAM_SHARED_MSG_HEADER Header;
268 
269 typedef enum
270 {
271  CAM_PROPERTY_SET_CameraControl = 0x01,
272  CAM_PROPERTY_SET_VideoProcAmp = 0x02,
273 } CAM_PROPERTY_SET;
274 
275 /* CameraControl properties */
276 #define CAM_PROPERTY_ID_CAMERA_CONTROL_Exposure 0x01
277 #define CAM_PROPERTY_ID_CAMERA_CONTROL_Focus 0x02
278 #define CAM_PROPERTY_ID_CAMERA_CONTROL_Pan 0x03
279 #define CAM_PROPERTY_ID_CAMERA_CONTROL_Roll 0x04
280 #define CAM_PROPERTY_ID_CAMERA_CONTROL_Tilt 0x05
281 #define CAM_PROPERTY_ID_CAMERA_CONTROL_Zoom 0x06
282 
283 /* VideoProcAmp properties */
284 #define CAM_PROPERTY_ID_VIDEO_PROC_AMP_BacklightCompensation 0x01
285 #define CAM_PROPERTY_ID_VIDEO_PROC_AMP_Brightness 0x02
286 #define CAM_PROPERTY_ID_VIDEO_PROC_AMP_Contrast 0x03
287 #define CAM_PROPERTY_ID_VIDEO_PROC_AMP_Hue 0x04
288 #define CAM_PROPERTY_ID_VIDEO_PROC_AMP_WhiteBalance 0x05
289 
290 typedef enum
291 {
292  CAM_PROPERTY_CAPABILITY_Manual = 0x01,
293  CAM_PROPERTY_CAPABILITY_Auto = 0x02,
294 } CAM_PROPERTY_CAPABILITIES;
295 
296 typedef struct
297 {
298  CAM_PROPERTY_SET PropertySet;
299  BYTE PropertyId;
300  CAM_PROPERTY_CAPABILITIES Capabilities;
301  INT32 MinValue;
302  INT32 MaxValue;
303  INT32 Step;
304  INT32 DefaultValue;
306 
307 typedef struct
308 {
309  CAM_SHARED_MSG_HEADER Header;
310  size_t N_Properties;
311  CAM_PROPERTY_DESCRIPTION* Properties;
313 
314 typedef struct
315 {
316  CAM_SHARED_MSG_HEADER Header;
317  CAM_PROPERTY_SET PropertySet;
318  BYTE PropertyId;
320 
321 typedef enum
322 {
323  CAM_PROPERTY_MODE_Manual = 0x01,
324  CAM_PROPERTY_MODE_Auto = 0x02,
325 } CAM_PROPERTY_MODE;
326 
327 typedef struct
328 {
329  CAM_PROPERTY_MODE Mode;
330  INT32 Value;
332 
333 typedef struct
334 {
335  CAM_SHARED_MSG_HEADER Header;
336  CAM_PROPERTY_VALUE PropertyValue;
338 
339 typedef struct
340 {
341  CAM_SHARED_MSG_HEADER Header;
342  CAM_PROPERTY_SET PropertySet;
343  BYTE PropertyId;
344  CAM_PROPERTY_VALUE PropertyValue;
346 
347 #ifdef __cplusplus
348 }
349 #endif
350 #endif /* FREERDP_CHANNEL_RDPECAM_H */