Пример #1
0
static void wf_peer_rdpsnd_activated(rdpsnd_server_context* context)
{
#ifdef WITH_RDPSND_DSOUND

	wf_directsound_activate(context);

#else

	wf_wasapi_activate(context);

#endif
	
}
Пример #2
0
static void wf_peer_rdpsnd_activated(RdpsndServerContext* context)
{
	wfInfo* wfi;
	int i, j;

	wfi = wf_info_get_instance();

	wfi->agreed_format = NULL;
	WLog_DBG(TAG, "Client supports the following %d formats:", context->num_client_formats);

	for (i = 0; i < context->num_client_formats; i++)
	{
		//TODO: improve the way we agree on a format
		for (j = 0; j < context->num_server_formats; j++)
		{
			if ((context->client_formats[i].wFormatTag == context->server_formats[j].wFormatTag) &&
			    (context->client_formats[i].nChannels == context->server_formats[j].nChannels) &&
			    (context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec))
			{
				WLog_DBG(TAG, "agreed on format!");
				wfi->agreed_format = (AUDIO_FORMAT*) &context->server_formats[j];
				break;
			}
		}
		if (wfi->agreed_format != NULL)
			break;
		
	}
	
	if (wfi->agreed_format == NULL)
	{
		WLog_ERR(TAG, "Could not agree on a audio format with the server");
		return;
	}
	
	context->SelectFormat(context, i);
	context->SetVolume(context, 0x7FFF, 0x7FFF);

#ifdef WITH_RDPSND_DSOUND

	wf_directsound_activate(context);

#else

	wf_wasapi_activate(context);

#endif
	
}