Implement a confirm block callback

This patch adds a callback called when we receive feedback from the
client.
This commit is contained in:
Hardening 2014-06-04 23:59:34 +02:00
parent bf30d54fac
commit 99d531655c
2 changed files with 10 additions and 2 deletions

View File

@ -83,8 +83,8 @@ static BOOL rdpsnd_server_send_formats(RdpsndServerContext* context, wStream* s)
static BOOL rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream* s)
{
UINT16 timestamp = 0;
BYTE confirmBlockNum = 0;
UINT16 timestamp;
BYTE confirmBlockNum;
if (Stream_GetRemainingLength(s) < 4)
return FALSE;
@ -92,6 +92,9 @@ static BOOL rdpsnd_server_recv_waveconfirm(RdpsndServerContext* context, wStream
Stream_Read_UINT16(s, timestamp);
Stream_Read_UINT8(s, confirmBlockNum);
Stream_Seek_UINT8(s);
IFCALL(context->ConfirmBlock, context, confirmBlockNum, timestamp);
return TRUE;
}

View File

@ -33,6 +33,7 @@ typedef int (*psRdpsndStop)(RdpsndServerContext* context);
typedef BOOL (*psRdpsndServerInitialize)(RdpsndServerContext* context);
typedef BOOL (*psRdpsndServerSelectFormat)(RdpsndServerContext* context, int client_format_index);
typedef BOOL (*psRdpsndServerSendSamples)(RdpsndServerContext* context, const void* buf, int nframes);
typedef BOOL (*psRdpsndServerConfirmBlock)(RdpsndServerContext* context, BYTE confirmBlockNum, UINT16 wtimestamp);
typedef BOOL (*psRdpsndServerSetVolume)(RdpsndServerContext* context, int left, int right);
typedef BOOL (*psRdpsndServerClose)(RdpsndServerContext* context);
@ -82,6 +83,10 @@ struct _rdpsnd_server_context
* nframes * src_format.nBitsPerSample * src_format.nChannels / 8
*/
psRdpsndServerSendSamples SendSamples;
/**
* Called when block confirm is received from the client
*/
psRdpsndServerConfirmBlock ConfirmBlock;
/**
* Set the volume level of the client. Valid range is between 0 and 0xFFFF.
*/