rdpgfx/server: Minor fix: use switch for pdu length estimation
This commit is contained in:
parent
992e0e9f35
commit
26c98e4429
@ -452,19 +452,16 @@ static INLINE UINT32 rdpgfx_estimate_surface_command(RDPGFX_SURFACE_COMMAND* cmd
|
|||||||
UINT32 h264Size = 0;
|
UINT32 h264Size = 0;
|
||||||
|
|
||||||
/* Create new stream according to codec. */
|
/* Create new stream according to codec. */
|
||||||
if (cmd->codecId == RDPGFX_CODECID_CAPROGRESSIVE ||
|
switch (cmd->codecId)
|
||||||
cmd->codecId == RDPGFX_CODECID_CAPROGRESSIVE_V2)
|
|
||||||
{
|
{
|
||||||
|
case RDPGFX_CODECID_CAPROGRESSIVE:
|
||||||
|
case RDPGFX_CODECID_CAPROGRESSIVE_V2:
|
||||||
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_2) + cmd->length;
|
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_2) + cmd->length;
|
||||||
}
|
case RDPGFX_CODECID_AVC420:
|
||||||
else if (cmd->codecId == RDPGFX_CODECID_AVC420)
|
|
||||||
{
|
|
||||||
havc420 = (RDPGFX_AVC420_BITMAP_STREAM*)cmd->extra;
|
havc420 = (RDPGFX_AVC420_BITMAP_STREAM*)cmd->extra;
|
||||||
h264Size = rdpgfx_estimate_h264_avc420(havc420);
|
h264Size = rdpgfx_estimate_h264_avc420(havc420);
|
||||||
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_1) + h264Size;
|
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_1) + h264Size;
|
||||||
}
|
case RDPGFX_CODECID_AVC444:
|
||||||
else if (cmd->codecId == RDPGFX_CODECID_AVC444)
|
|
||||||
{
|
|
||||||
havc444 = (RDPGFX_AVC444_BITMAP_STREAM*)cmd->extra;
|
havc444 = (RDPGFX_AVC444_BITMAP_STREAM*)cmd->extra;
|
||||||
h264Size = sizeof(UINT32); /* cbAvc420EncodedBitstream1 */
|
h264Size = sizeof(UINT32); /* cbAvc420EncodedBitstream1 */
|
||||||
/* avc420EncodedBitstream1 */
|
/* avc420EncodedBitstream1 */
|
||||||
@ -479,9 +476,7 @@ static INLINE UINT32 rdpgfx_estimate_surface_command(RDPGFX_SURFACE_COMMAND* cmd
|
|||||||
}
|
}
|
||||||
|
|
||||||
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_1) + h264Size;
|
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_1) + h264Size;
|
||||||
}
|
default:
|
||||||
else
|
|
||||||
{
|
|
||||||
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_1) + cmd->length;
|
return sizeof(RDPGFX_WIRE_TO_SURFACE_PDU_1) + cmd->length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user