#include <string.h>
#include <winpr/crt.h>
+#include <winpr/wlog.h>
#include <winpr/synch.h>
#include <winpr/print.h>
#include <winpr/thread.h>
UINT32 OpenHandle;
wMessagePipe* MsgPipe;
+ wLog* log;
HANDLE ScheduleThread;
BYTE cBlockNo;
rdpsndDevicePlugin* device;
};
-static void rdpsnd_send_wave_confirm_pdu(rdpsndPlugin* rdpsnd, UINT16 wTimeStamp, BYTE cConfirmedBlockNo);
+static void rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave);
static void* rdpsnd_schedule_thread(void* arg)
{
Sleep(wTimeDiff);
}
- rdpsnd_send_wave_confirm_pdu(rdpsnd, wave->wTimeStampB, wave->cBlockNo);
- free(wave);
+ rdpsnd_confirm_wave(rdpsnd, wave);
+
message.wParam = NULL;
+ free(wave);
}
return NULL;
Stream_Write_UINT16(pdu, rdpsnd->wQualityMode); /* wQualityMode */
Stream_Write_UINT16(pdu, 0); /* Reserved */
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "QualityMode: %d", rdpsnd->wQualityMode);
+
rdpsnd_virtual_channel_write(rdpsnd, pdu);
}
Stream_Write(pdu, clientFormat->data, clientFormat->cbSize);
}
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Client Audio Formats");
+
rdpsnd_virtual_channel_write(rdpsnd, pdu);
}
rdpsnd_select_supported_audio_formats(rdpsnd);
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Server Audio Formats");
+
rdpsnd_send_client_audio_formats(rdpsnd);
if (wVersion >= 6)
Stream_Write_UINT16(pdu, wTimeStamp);
Stream_Write_UINT16(pdu, wPackSize);
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Training Response: wTimeStamp: %d wPackSize: %d",
+ wTimeStamp, wPackSize);
+
rdpsnd_virtual_channel_write(rdpsnd, pdu);
}
Stream_Read_UINT16(s, wTimeStamp);
Stream_Read_UINT16(s, wPackSize);
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Training Request: wTimeStamp: %d wPackSize: %d",
+ wTimeStamp, wPackSize);
+
rdpsnd_send_training_confirm_pdu(rdpsnd, wTimeStamp, wPackSize);
}
format = &rdpsnd->ClientFormats[wFormatNo];
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "WaveInfo: cBlockNo: %d wFormatNo: %d",
+ rdpsnd->cBlockNo, wFormatNo);
+
if (!rdpsnd->isOpen)
{
rdpsnd->isOpen = TRUE;
rdpsnd_virtual_channel_write(rdpsnd, pdu);
}
+void rdpsnd_confirm_wave(rdpsndPlugin* rdpsnd, RDPSND_WAVE* wave)
+{
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "WaveConfirm: cBlockNo: %d wTimeStamp: %d wTimeDiff: %d",
+ wave->cBlockNo, wave->wTimeStampB, wave->wTimeStampB - wave->wTimeStampA);
+
+ rdpsnd_send_wave_confirm_pdu(rdpsnd, wave->wTimeStampB, wave->cBlockNo);
+}
+
static void rdpsnd_device_send_wave_confirm_pdu(rdpsndDevicePlugin* device, RDPSND_WAVE* wave)
{
MessageQueue_Post(device->rdpsnd->MsgPipe->Out, NULL, 0, (void*) wave, NULL);
format = &rdpsnd->ClientFormats[rdpsnd->wCurrentFormatNo];
wave->wAudioLength = rdpsnd_compute_audio_time_length(format, size);
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Wave: cBlockNo: %d wTimeStamp: %d",
+ wave->cBlockNo, wave->wTimeStampA);
+
if (!rdpsnd->device)
{
free(wave);
static void rdpsnd_recv_close_pdu(rdpsndPlugin* rdpsnd)
{
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Close");
+
if (rdpsnd->device)
{
IFCALL(rdpsnd->device->Close, rdpsnd->device);
Stream_Read_UINT32(s, dwVolume);
+ WLog_Print(rdpsnd->log, WLOG_DEBUG, "Volume: 0x%04X", dwVolume);
+
if (rdpsnd->device)
{
IFCALL(rdpsnd->device->SetVolume, rdpsnd->device, dwVolume);
CopyMemory(&(rdpsnd->channelEntryPoints), pEntryPoints, pEntryPoints->cbSize);
+ rdpsnd->log = WLog_Get("com.freerdp.channels.rdpsnd.client");
+ //WLog_SetLogLevel(rdpsnd->log, WLOG_TRACE);
+
rdpsnd->channelEntryPoints.pVirtualChannelInit(&rdpsnd->InitHandle,
&rdpsnd->channelDef, 1, VIRTUAL_CHANNEL_VERSION_WIN2000, rdpsnd_virtual_channel_init_event);