rdpecam-enumerator.h (4344B)
1/** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Video Capture Virtual Channel Extension 4 * 5 * Copyright 2022 Pascal Nowack <Pascal.Nowack@gmx.de> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20#ifndef FREERDP_CHANNEL_CAM_DEV_ENUM_SERVER_CAM_DEV_ENUM_H 21#define FREERDP_CHANNEL_CAM_DEV_ENUM_SERVER_CAM_DEV_ENUM_H 22 23#include <freerdp/channels/rdpecam.h> 24#include <freerdp/channels/wtsvc.h> 25 26typedef struct _cam_dev_enum_server_context CamDevEnumServerContext; 27 28typedef UINT (*psCamDevEnumServerServerOpen)(CamDevEnumServerContext* context); 29typedef UINT (*psCamDevEnumServerServerClose)(CamDevEnumServerContext* context); 30 31typedef BOOL (*psCamDevEnumServerServerChannelIdAssigned)(CamDevEnumServerContext* context, 32 UINT32 channelId); 33 34typedef UINT (*psCamDevEnumServerServerInitialize)(CamDevEnumServerContext* context, 35 BOOL externalThread); 36typedef UINT (*psCamDevEnumServerServerPoll)(CamDevEnumServerContext* context); 37typedef BOOL (*psCamDevEnumServerServerChannelHandle)(CamDevEnumServerContext* context, 38 HANDLE* handle); 39 40typedef UINT (*psCamDevEnumServerServerSelectVersionRequest)( 41 CamDevEnumServerContext* context, const CAM_SELECT_VERSION_REQUEST* selectVersionRequest); 42typedef UINT (*psCamDevEnumServerServerSelectVersionResponse)( 43 CamDevEnumServerContext* context, const CAM_SELECT_VERSION_RESPONSE* selectVersionResponse); 44 45typedef UINT (*psCamDevEnumServerServerDeviceAddedNotification)( 46 CamDevEnumServerContext* context, const CAM_DEVICE_ADDED_NOTIFICATION* deviceAddedNotification); 47typedef UINT (*psCamDevEnumServerServerDeviceRemovedNotification)( 48 CamDevEnumServerContext* context, 49 const CAM_DEVICE_REMOVED_NOTIFICATION* deviceRemovedNotification); 50 51struct _cam_dev_enum_server_context 52{ 53 HANDLE vcm; 54 55 /* Server self-defined pointer. */ 56 void* userdata; 57 58 /*** APIs called by the server. ***/ 59 60 /** 61 * Optional: Set thread handling. 62 * When externalThread=TRUE, the application is responsible to call 63 * Poll() periodically to process channel events. 64 * 65 * Defaults to externalThread=FALSE 66 */ 67 psCamDevEnumServerServerInitialize Initialize; 68 69 /** 70 * Open the camera device enumerator channel. 71 */ 72 psCamDevEnumServerServerOpen Open; 73 74 /** 75 * Close the camera device enumerator channel. 76 */ 77 psCamDevEnumServerServerClose Close; 78 79 /** 80 * Poll 81 * When externalThread=TRUE, call Poll() periodically from your main loop. 82 * If externalThread=FALSE do not call. 83 */ 84 psCamDevEnumServerServerPoll Poll; 85 86 /** 87 * Retrieve the channel handle for use in conjunction with Poll(). 88 * If externalThread=FALSE do not call. 89 */ 90 psCamDevEnumServerServerChannelHandle ChannelHandle; 91 92 /* 93 * Send a Select Version Response PDU. 94 */ 95 psCamDevEnumServerServerSelectVersionResponse SelectVersionResponse; 96 97 /*** Callbacks registered by the server. ***/ 98 99 /** 100 * Callback, when the channel got its id assigned. 101 */ 102 psCamDevEnumServerServerChannelIdAssigned ChannelIdAssigned; 103 104 /** 105 * Callback for the Select Version Request PDU. 106 */ 107 psCamDevEnumServerServerSelectVersionRequest SelectVersionRequest; 108 109 /** 110 * Callback for the Device Added Notification PDU. 111 */ 112 psCamDevEnumServerServerDeviceAddedNotification DeviceAddedNotification; 113 114 /** 115 * Callback for the Device Removed Notification PDU. 116 */ 117 psCamDevEnumServerServerDeviceRemovedNotification DeviceRemovedNotification; 118 119 rdpContext* rdpcontext; 120}; 121 122#ifdef __cplusplus 123extern "C" 124{ 125#endif 126 127 FREERDP_API CamDevEnumServerContext* cam_dev_enum_server_context_new(HANDLE vcm); 128 FREERDP_API void cam_dev_enum_server_context_free(CamDevEnumServerContext* context); 129 130#ifdef __cplusplus 131} 132#endif 133 134#endif /* FREERDP_CHANNEL_CAM_DEV_ENUM_SERVER_CAM_DEV_ENUM_H */