return error;
}
-static UINT rdpgfx_send_qoe_frame_acknowledge_pdu(RDPGFX_CHANNEL_CALLBACK* callback,
+static UINT rdpgfx_send_qoe_frame_acknowledge_pdu(RdpgfxClientContext* context,
const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* pdu)
{
UINT error;
wStream* s;
RDPGFX_HEADER header;
- RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
+ RDPGFX_CHANNEL_CALLBACK* callback;
+ RDPGFX_PLUGIN* gfx;
header.flags = 0;
header.cmdId = RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE;
header.pduLength = RDPGFX_HEADER_SIZE + 12;
+
+ if (!context || !pdu)
+ return ERROR_BAD_ARGUMENTS;
+
+ gfx = (RDPGFX_PLUGIN*) context->handle;
+
+ if (!gfx)
+ return ERROR_BAD_CONFIGURATION;
+
+ callback = gfx->listener_callback->channel_callback;
+
+ if (!callback)
+ return ERROR_BAD_CONFIGURATION;
+
DEBUG_RDPGFX(gfx->log, "SendQoeFrameAcknowledgePdu: %"PRIu32"", pdu->frameId);
s = Stream_New(NULL, header.pduLength);
gfx->UnacknowledgedFrames--;
gfx->TotalDecodedFrames++;
+
+ if (!gfx->sendFrameAcks)
+ return error;
+
ack.frameId = pdu.frameId;
ack.totalFramesDecoded = gfx->TotalDecodedFrames;
- if (gfx->sendFrameAcks)
+ if (gfx->suspendFrameAcks)
{
- if (gfx->suspendFrameAcks)
- {
- ack.queueDepth = SUSPEND_FRAME_ACKNOWLEDGEMENT;
-
- if (gfx->TotalDecodedFrames == 1)
- if ((error = rdpgfx_send_frame_acknowledge_pdu(context, &ack)))
- WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"",
- error);
- }
- else
- {
- ack.queueDepth = QUEUE_DEPTH_UNAVAILABLE;
+ ack.queueDepth = SUSPEND_FRAME_ACKNOWLEDGEMENT;
+ if (gfx->TotalDecodedFrames == 1)
if ((error = rdpgfx_send_frame_acknowledge_pdu(context, &ack)))
WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"",
- error);
- }
+ error);
+ }
+ else
+ {
+ ack.queueDepth = QUEUE_DEPTH_UNAVAILABLE;
+
+ if ((error = rdpgfx_send_frame_acknowledge_pdu(context, &ack)))
+ WLog_Print(gfx->log, WLOG_ERROR, "rdpgfx_send_frame_acknowledge_pdu failed with error %"PRIu32"",
+ error);
}
switch (gfx->ConnectionCaps.version)
qoe.timeDiffSE = diff;
qoe.timeDiffEDR = 1;
- if ((error = rdpgfx_send_qoe_frame_acknowledge_pdu(callback, &qoe)))
+ if ((error = rdpgfx_send_qoe_frame_acknowledge_pdu(context, &qoe)))
WLog_Print(gfx->log, WLOG_ERROR,
"rdpgfx_send_qoe_frame_acknowledge_pdu failed with error %"PRIu32"",
error);
context->CapsAdvertise = rdpgfx_send_caps_advertise_pdu;
context->FrameAcknowledge = rdpgfx_send_frame_acknowledge_pdu;
context->CacheImportOffer = rdpgfx_send_cache_import_offer_pdu;
+ context->QoeFrameAcknowledge = rdpgfx_send_qoe_frame_acknowledge_pdu;
gfx->iface.pInterface = (void*) context;
gfx->zgfx = zgfx_context_new(FALSE);
const RDPGFX_CAPS_CONFIRM_PDU* capsConfirm);
typedef UINT(*pcRdpgfxFrameAcknowledge)(RdpgfxClientContext* context,
const RDPGFX_FRAME_ACKNOWLEDGE_PDU* frameAcknowledge);
+typedef UINT(*pcRdpgfxQoeFrameAcknowledge)(RdpgfxClientContext* context,
+ const RDPGFX_QOE_FRAME_ACKNOWLEDGE_PDU* qoeFrameAcknowledge);
typedef UINT(*pcRdpgfxMapWindowForSurface)(RdpgfxClientContext* context, UINT16 surfaceID,
UINT64 windowID);
pcRdpgfxCapsAdvertise CapsAdvertise;
pcRdpgfxCapsConfirm CapsConfirm;
pcRdpgfxFrameAcknowledge FrameAcknowledge;
+ pcRdpgfxQoeFrameAcknowledge QoeFrameAcknowledge;
/* No locking required */
pcRdpgfxUpdateSurfaces UpdateSurfaces;