[MS-RDPEGFX] RDPGFX_WIRE_TO_SURFACE_PDU_2和编解码器上下文ADM [英] [MS-RDPEGFX] RDPGFX_WIRE_TO_SURFACE_PDU_2 and codec context ADM

查看:96
本文介绍了[MS-RDPEGFX] RDPGFX_WIRE_TO_SURFACE_PDU_2和编解码器上下文ADM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在调查FreeRDP MS-RDPEGFX中的渲染错误,该错误似乎与RDPGFX_WIRE_TO_SURFACE_PDU_2消息和编解码器上下文ADM有关。

I am currently investigating a rendering bug in the FreeRDP MS-RDPEGFX that appears to be related to the RDPGFX_WIRE_TO_SURFACE_PDU_2 message and the codec context ADM.

这是一个导致Windows 8.1和ClearCodec的图形工件的序列:

Here is a sequence that results in graphical artifacts with Windows 8.1 and ClearCodec:

cmdId: RDPGFX_CMDID_STARTFRAME (0x000B) flags: 0x0000 pduLength: 16
RecvStartFramePdu: frameId: 35 timestamp: 0x0000
cmdId: RDPGFX_CMDID_CACHETOSURFACE (0x0007) flags: 0x0000 pduLength: 18
RdpGfxRecvCacheToSurfacePdu: cacheSlot: 206 surfaceId: 1 destPtsCount: 1
cmdId: RDPGFX_CMDID_CACHETOSURFACE (0x0007) flags: 0x0000 pduLength: 18
RdpGfxRecvCacheToSurfacePdu: cacheSlot: 205 surfaceId: 1 destPtsCount: 1
cmdId: RDPGFX_CMDID_WIRETOSURFACE_1 (0x0001) flags: 0x0000 pduLength: 2459
RecvWireToSurface1Pdu: surfaceId: 1 codecId: RDPGFX_CODECID_CLEARCODEC (0x0008) pixelFormat: 0x0020 destRect: left: 243 top: 640 right: 307 bottom: 676 bitmapDataLength: 2434
cmdId: RDPGFX_CMDID_WIRETOSURFACE_2 (0x0002) flags: 0x0000 pduLength: 2945
RecvWireToSurface2Pdu: surfaceId: 1 codecId: 0x0009 codecContextId: 8 pixelFormat: 0x0020 bitmapDataLength: 2924
cmdId: RDPGFX_CMDID_DELETEENCODINGCONTEXT (0x0003) flags: 0x0000 pduLength: 14
RecvDeleteEncodingContextPdu: surfaceId: 1 codecContextId: 8
cmdId: RDPGFX_CMDID_WIRETOSURFACE_2 (0x0002) flags: 0x0000 pduLength: 4491
RecvWireToSurface2Pdu: surfaceId: 1 codecId: 0x0009 codecContextId: 9 pixelFormat: 0x0020 bitmapDataLength: 4470
cmdId: RDPGFX_CMDID_DELETEENCODINGCONTEXT (0x0003) flags: 0x0000 pduLength: 14
RecvDeleteEncodingContextPdu: surfaceId: 1 codecContextId: 9
cmdId: RDPGFX_CMDID_ENDFRAME (0x000C) flags: 0x0000 pduLength: 12
RecvEndFramePdu: frameId: 35
SendFrameAcknowledgePdu: 35

我遇到的问题是RDPGFX_WIRE_TO_SURFACE_PDU_2与RDPGFX_WIRE_TO_SURFACE_PDU_1不同发送任何矩形我载文信息。通过观察,我注意到我在跟踪中获得了比类型2更多的类型1 pdus。我想知道为什么我的代码甚至
"工作"因为我在接收类型2 pdus时将更新矩形设置为null。一些编解码器如RDP7.1 RemoteFX在其压缩有效载荷中包含矩形信息,但这不是ClearCodec的情况。

The problem I have is that RDPGFX_WIRE_TO_SURFACE_PDU_2, unlike RDPGFX_WIRE_TO_SURFACE_PDU_1, does not send any rectangle information. By observation, I noticed that I am getting a lot more type 1 pdus in my traces than type 2. I wonder why my code even "works" because I set my update rectangle to null when receiving type 2 pdus. Some codecs like RDP7.1 RemoteFX contain rectangle information inside their compressed payloads, but this is not the case of ClearCodec.

类型2 PDU包含编解码器上下文ID,在类型中找不到1 pdus。关于在编解码器上下文ADM中应该包含哪种数据的规范是模糊的:

Type 2 PDUs contain the Codec Context Id, which is not found in type 1 pdus. The specification is vague about what sort of data is supposed to be contained within the codec context ADM:

codecContextId(4字节): 32位无符号整数标识与封装在
bitmapData 字段中的位图数据关联的压缩上下文。

codecContextId (4 byte): A 32-bit unsigned integer that identifies the compression context associated with the bitmap data encapsulated in the bitmapData field.

此编解码器上下文ID仅用于RDPGFX_WIRE_TO_SURFACE_PDU_2和RDPGFX_DELETE_ENCODING_CONTEXT_PDU,所以我假设RDPGFX_WIRE_TO_SURFACE_PDU_2"创建"上下文。

This codec context id is only used in RDPGFX_WIRE_TO_SURFACE_PDU_2 and RDPGFX_DELETE_ENCODING_CONTEXT_PDU, so I assume RDPGFX_WIRE_TO_SURFACE_PDU_2 "creates" the context.

编解码器上下文ADM记录如下:

The codec context ADM is documented as such:

https://msdn.microsoft.com/en-us/library/hh536864.aspx

编解码器上下文 ADM元素包含编解码器上下文列表。每个编解码器上下文与屏幕外表面和逐渐渲染到表面的位图相关联。上下文用于存储用于迭代构造位图的状态信息
。完全呈现位图后,不再需要关联的上下文。此外,如果服务器确定将不再使用特定上下文,则
RDPGFX_DELETE_ENCODING_CONTEXT_PDU
2.2.2.3
)消息被发送到客户端。

The Codec Contexts ADM element contains a list of codec contexts. Each codec context is associated with an offscreen surface and a bitmap that is being progressively rendered to the surface. The context is used to store state information that is used to iteratively construct the bitmap. Once the bitmap has been fully rendered, the associated context is no longer required. Furthermore, if the server determines that a specific context will no longer be used, then the RDPGFX_DELETE_ENCODING_CONTEXT_PDU (section 2.2.2.3) message is sent to the client.

对于ClearCodec,没有这样的事情"进步的"无论如何,上下文,所以我真的不知道这将用于什么。现在没有任何内容存储,编解码器上下文ADM被FreeRDP简单地忽略和使用。

In the case of ClearCodec, there is no such thing as a "progressive" context anyway, so I don't really know what this would be used for. Right now nothing is stored, and the codec context ADM is simply ignored and unused by FreeRDP.

这是生成的图形工件的屏幕截图。为了轻松重现该问题,我使用图像背景(没有纯色),启用全窗口拖动和菜单动画,并最小化窗口。工件通常在窗口最小化期间​​发生,
但可以在其他地方发生。我注意到的是,当产生工件时,在同一egfx帧中使用了多个编解码器上下文id。该工件显示窗口的一部分被最小化,因为没有刷新/更新。在引入之后,工件是持久的
,因此它不是与屏幕上没有在客户端刷新的区域相关的简单问题。例如,如果我在制作工件后恢复窗口并开始移动窗口,则工件仍会在其原始位置显示

Here is a screenshot of the resulting graphical artifact. To easily reproduce the issue, I use an image background (no solid colors), enable full window dragging and menu animations, and minimize a window. The artifacts usually occur during a window minimize, but can occur in other places. What I noticed is that when artifacts are produced, more than one codec context ids were used within the same egfx frame. The artifact shows part of the window being minimized as not being refreshed/updated. The artifact is persistent after is has been introduced, so it is not a simple problem related to a region of the screen not being refreshed on the client. For instance, if I restore the window after the artifact was produced and start moving the window around, the artifact still appears in its original place.

以下是我的两个问题:

Here are my two questions:

1)我如何知道RDPGFX_WIRE_TO_SURFACE_PDU_2的更新矩形是什么?

1) How do I know what the update rectangle is for RDPGFX_WIRE_TO_SURFACE_PDU_2?

2)Codec Context ADM中包含哪些内容,以及如何我能正确维护吗?

2) What exactly is contained within the Codec Context ADM, and how do I maintain it properly?










推荐答案

Hello Marc-Andre,

Hello Marc-Andre,

感谢您的提问。协议文档团队的成员将很快回复您。

Thank you for your question. A member of the protocol documentation team will respond to you soon.

致以最诚挚的问候,

Matt Weber | Microsoft开放规范团队

Best regards,
Matt Weber | Microsoft Open Specifications Team


这篇关于[MS-RDPEGFX] RDPGFX_WIRE_TO_SURFACE_PDU_2和编解码器上下文ADM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆