FreeRDP
Loading...
Searching...
No Matches
rdpgfx_common.h
1
21
22#ifndef FREERDP_CHANNEL_RDPGFX_COMMON_H
23#define FREERDP_CHANNEL_RDPGFX_COMMON_H
24
25#include <winpr/crt.h>
26#include <winpr/stream.h>
27
28#include <freerdp/config.h>
29#include <freerdp/channels/rdpgfx.h>
30#include <freerdp/api.h>
31#include <freerdp/utils/gfx.h>
32
33/* hard coded limit for update rectangles in any single AVC420/AVC444/HEVC frame.
34 * This is not from the spec but a best effort guess from common data:
35 *
36 * 1. We assume the server properly merges adjacent tiles into a single one reducing the average
37 * update rectangle count significantly.
38 * 2. The regions are for a single surface, which can (for the next decated realistically be)
39 * -> A 4K monitor can have 2160 64x64 tiles
40 * -> A 8K monitor can have 7680 64x64 tiles, so 3840
41 * 3. A worst case is a chessboard pattern with every second tile empty.
42 * -> 4K: 1080
43 * -> 8K: 3840
44 *
45 * so our best guess is just allow 4K worst case count and see what will happen.
46 */
47#define RDPGFX_MAX_META_REGION_COUNT 1080
48
49WINPR_ATTR_NODISCARD
50FREERDP_LOCAL UINT rdpgfx_read_header(wLog* log, wStream* s, RDPGFX_HEADER* header,
51 size_t* pPacketLength);
52
53WINPR_ATTR_NODISCARD
54FREERDP_LOCAL UINT rdpgfx_write_header(wStream* s, const RDPGFX_HEADER* header);
55
56WINPR_ATTR_NODISCARD
57FREERDP_LOCAL UINT rdpgfx_read_point16(wLog* log, wStream* s, RDPGFX_POINT16* pt16);
58
59WINPR_ATTR_NODISCARD
60FREERDP_LOCAL UINT rdpgfx_write_point16(wStream* s, const RDPGFX_POINT16* point16);
61
62WINPR_ATTR_NODISCARD
63FREERDP_LOCAL UINT rdpgfx_read_rect16(wLog* log, wStream* s, RECTANGLE_16* rect16, BOOL allowEmpty);
64
65WINPR_ATTR_NODISCARD
66FREERDP_LOCAL UINT rdpgfx_write_rect16(wStream* s, const RECTANGLE_16* rect16);
67
68WINPR_ATTR_NODISCARD
69FREERDP_LOCAL UINT rdpgfx_read_color32(wLog* log, wStream* s, RDPGFX_COLOR32* color32);
70
71WINPR_ATTR_NODISCARD
72FREERDP_LOCAL UINT rdpgfx_write_color32(wStream* s, const RDPGFX_COLOR32* color32);
73
74#endif /* FREERDP_CHANNEL_RDPGFX_COMMON_H */