FreeRDP
server/audin.h
1 
23 #ifndef FREERDP_CHANNEL_AUDIN_SERVER_H
24 #define FREERDP_CHANNEL_AUDIN_SERVER_H
25 
26 #include <freerdp/config.h>
27 
28 #include <freerdp/channels/audin.h>
29 #include <freerdp/channels/wtsvc.h>
30 
31 #if !defined(CHANNEL_AUDIN_SERVER)
32 #error "This header must not be included if CHANNEL_AUDIN_SERVER is not defined"
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40  typedef struct s_audin_server_context audin_server_context;
41 
42  typedef BOOL (*psAudinServerChannelOpen)(audin_server_context* context);
43  typedef BOOL (*psAudinServerChannelIsOpen)(audin_server_context* context);
44  typedef BOOL (*psAudinServerChannelClose)(audin_server_context* context);
45 
46  typedef BOOL (*psAudinServerChannelIdAssigned)(audin_server_context* context, UINT32 channelId);
47 
48  typedef UINT (*psAudinServerVersion)(audin_server_context* context,
49  const SNDIN_VERSION* version);
50  typedef UINT (*psAudinServerFormats)(audin_server_context* context,
51  const SNDIN_FORMATS* formats);
52  typedef UINT (*psAudinServerOpen)(audin_server_context* context, const SNDIN_OPEN* open);
53  typedef UINT (*psAudinServerOpenReply)(audin_server_context* context,
54  const SNDIN_OPEN_REPLY* open_reply);
55  typedef UINT (*psAudinServerIncomingData)(audin_server_context* context,
56  const SNDIN_DATA_INCOMING* data_incoming);
57  typedef UINT (*psAudinServerData)(audin_server_context* context, const SNDIN_DATA* data);
58  typedef UINT (*psAudinServerFormatChange)(audin_server_context* context,
59  const SNDIN_FORMATCHANGE* format_change);
60 
62  {
63  HANDLE vcm;
64 
65  /* Server self-defined pointer. */
66  void* userdata;
67 
72  SNDIN_VERSION_Version serverVersion;
73 
74  /*** APIs called by the server. ***/
75 
79  psAudinServerChannelOpen Open;
80 
84  psAudinServerChannelIsOpen IsOpen;
85 
89  psAudinServerChannelClose Close;
90 
99  psAudinServerVersion SendVersion;
100 
104  psAudinServerFormats SendFormats;
105 
109  psAudinServerOpen SendOpen;
110 
114  psAudinServerFormatChange SendFormatChange;
115 
116  /*** Callbacks registered by the server. ***/
117 
121  psAudinServerChannelIdAssigned ChannelIdAssigned;
122 
123  /*
124  * Callback for the Version PDU.
125  */
126  psAudinServerVersion ReceiveVersion;
127 
128  /*
129  * Callback for the Sound Formats PDU.
130  */
131  psAudinServerFormats ReceiveFormats;
132 
133  /*
134  * Callback for the Open Reply PDU.
135  */
136  psAudinServerOpenReply OpenReply;
137 
138  /*
139  * Callback for the Incoming Data PDU.
140  */
141  psAudinServerIncomingData IncomingData;
142 
143  /*
144  * Callback for the Data PDU.
145  */
146  psAudinServerData Data;
147 
148  /*
149  * Callback for the Format Change PDU.
150  */
151  psAudinServerFormatChange ReceiveFormatChange;
152 
153  rdpContext* rdpcontext;
154  };
155 
156  FREERDP_API void audin_server_context_free(audin_server_context* context);
157 
158  WINPR_ATTR_MALLOC(audin_server_context_free, 1)
159  FREERDP_API audin_server_context* audin_server_context_new(HANDLE vcm);
160 
169  FREERDP_API BOOL audin_server_set_formats(audin_server_context* context, SSIZE_T count,
170  const AUDIO_FORMAT* formats);
171 
172  FREERDP_API const AUDIO_FORMAT*
173  audin_server_get_negotiated_format(const audin_server_context* context);
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif /* FREERDP_CHANNEL_AUDIN_SERVER_H */
psAudinServerOpen SendOpen
Definition: server/audin.h:109
psAudinServerChannelClose Close
Definition: server/audin.h:89
psAudinServerChannelOpen Open
Definition: server/audin.h:79
psAudinServerFormats SendFormats
Definition: server/audin.h:104
psAudinServerFormatChange SendFormatChange
Definition: server/audin.h:114
psAudinServerChannelIdAssigned ChannelIdAssigned
Definition: server/audin.h:121
psAudinServerVersion SendVersion
Definition: server/audin.h:99
psAudinServerChannelIsOpen IsOpen
Definition: server/audin.h:84
SNDIN_VERSION_Version serverVersion
Definition: server/audin.h:72