23 #include <freerdp/config.h>
25 #include <winpr/assert.h>
31 #include <freerdp/server/server-common.h>
32 #include <freerdp/log.h>
33 #define TAG SERVER_TAG("sample")
35 #if defined(CHANNEL_AUDIN_SERVER)
37 static UINT sf_peer_audin_data(audin_server_context* audin,
const SNDIN_DATA* data)
43 WLog_WARN(TAG,
"not implemented");
44 WLog_DBG(TAG,
"receive %" PRIdz
" bytes.", Stream_Length(data->Data));
50 BOOL sf_peer_audin_init(testPeerContext* context)
52 WINPR_ASSERT(context);
53 #if defined(CHANNEL_AUDIN_SERVER)
54 context->audin = audin_server_context_new(context->vcm);
55 WINPR_ASSERT(context->audin);
57 context->audin->rdpcontext = &context->_p;
58 context->audin->userdata = context;
60 context->audin->Data = sf_peer_audin_data;
62 return audin_server_set_formats(context->audin, -1, NULL);
68 BOOL sf_peer_audin_start(testPeerContext* context)
70 #if defined(CHANNEL_AUDIN_SERVER)
71 if (!context || !context->audin || !context->audin->Open)
74 return context->audin->Open(context->audin);
80 BOOL sf_peer_audin_stop(testPeerContext* context)
82 #if defined(CHANNEL_AUDIN_SERVER)
83 if (!context || !context->audin || !context->audin->Close)
86 return context->audin->Close(context->audin);
92 BOOL sf_peer_audin_running(testPeerContext* context)
94 #if defined(CHANNEL_AUDIN_SERVER)
95 if (!context || !context->audin || !context->audin->IsOpen)
98 return context->audin->IsOpen(context->audin);
104 void sf_peer_audin_uninit(testPeerContext* context)
106 WINPR_ASSERT(context);
108 #if defined(CHANNEL_AUDIN_SERVER)
109 audin_server_context_free(context->audin);
110 context->audin = NULL;