22 #include <freerdp/config.h>
24 #include <winpr/assert.h>
26 #include "sf_rdpsnd.h"
28 #include <freerdp/server/server-common.h>
29 #include <freerdp/log.h>
30 #define TAG SERVER_TAG("sample")
32 static void sf_peer_rdpsnd_activated(RdpsndServerContext* context)
34 WINPR_UNUSED(context);
35 WINPR_ASSERT(context);
36 WLog_DBG(TAG,
"RDPSND Activated");
39 BOOL sf_peer_rdpsnd_init(testPeerContext* context)
41 WINPR_ASSERT(context);
43 context->rdpsnd = rdpsnd_server_context_new(context->vcm);
44 WINPR_ASSERT(context->rdpsnd);
45 context->rdpsnd->rdpcontext = &context->_p;
46 context->rdpsnd->data = context;
47 context->rdpsnd->num_server_formats =
48 server_rdpsnd_get_formats(&context->rdpsnd->server_formats);
50 if (context->rdpsnd->num_server_formats > 0)
51 context->rdpsnd->src_format = &context->rdpsnd->server_formats[0];
53 context->rdpsnd->Activated = sf_peer_rdpsnd_activated;
55 WINPR_ASSERT(context->rdpsnd->Initialize);
56 if (context->rdpsnd->Initialize(context->rdpsnd, TRUE) != CHANNEL_RC_OK)