FreeRDP
include/freerdp/codec/h264.h
1 
20 #ifndef FREERDP_CODEC_H264_H
21 #define FREERDP_CODEC_H264_H
22 
23 #include <winpr/wlog.h>
24 
25 #include <freerdp/api.h>
26 #include <freerdp/types.h>
27 #include <freerdp/channels/rdpgfx.h>
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34  typedef struct S_H264_CONTEXT_SUBSYSTEM H264_CONTEXT_SUBSYSTEM;
35  typedef struct S_H264_CONTEXT H264_CONTEXT;
36  typedef struct S_YUV_CONTEXT YUV_CONTEXT;
37 
38  typedef enum
39  {
40  H264_RATECONTROL_VBR = 0,
41  H264_RATECONTROL_CQP
42  } H264_RATECONTROL_MODE;
43 
48  typedef enum
49  {
50  H264_SCREEN_CONTENT_REAL_TIME = 0,
51  H264_SCREEN_CONTENT_NON_REAL_TIME,
52  H264_CAMERA_VIDEO_REAL_TIME,
53  H264_CAMERA_VIDEO_NON_REAL_TIME,
54 
55  } H264_USAGETYPE;
56 
57  typedef enum
58  {
59  H264_CONTEXT_OPTION_RATECONTROL,
60  H264_CONTEXT_OPTION_BITRATE,
61  H264_CONTEXT_OPTION_FRAMERATE,
62  H264_CONTEXT_OPTION_QP,
63  H264_CONTEXT_OPTION_USAGETYPE,
64  } H264_CONTEXT_OPTION;
65 
66  FREERDP_API void free_h264_metablock(RDPGFX_H264_METABLOCK* meta);
67 
68  FREERDP_API BOOL h264_context_set_option(H264_CONTEXT* h264, H264_CONTEXT_OPTION option,
69  UINT32 value);
70  FREERDP_API UINT32 h264_context_get_option(H264_CONTEXT* h264, H264_CONTEXT_OPTION option);
71 
72  FREERDP_API INT32 avc420_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat,
73  UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight,
74  const RECTANGLE_16* regionRect, BYTE** ppDstData,
75  UINT32* pDstSize, RDPGFX_H264_METABLOCK* meta);
76 
88  FREERDP_API INT32 h264_get_yuv_buffer(H264_CONTEXT* h264, UINT32 nSrcStride, UINT32 nSrcWidth,
89  UINT32 nSrcHeight, BYTE* YUVData[3], UINT32 stride[3]);
90 
100  FREERDP_API INT32 h264_compress(H264_CONTEXT* h264, BYTE** ppDstData, UINT32* pDstSize);
101 
102  FREERDP_API INT32 avc420_decompress(H264_CONTEXT* h264, const BYTE* pSrcData, UINT32 SrcSize,
103  BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep,
104  UINT32 nDstWidth, UINT32 nDstHeight,
105  const RECTANGLE_16* regionRects, UINT32 numRegionRect);
106 
107  FREERDP_API INT32 avc444_compress(H264_CONTEXT* h264, const BYTE* pSrcData, DWORD SrcFormat,
108  UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight,
109  BYTE version, const RECTANGLE_16* regionRect, BYTE* op,
110  BYTE** pDstData, UINT32* pDstSize, BYTE** pAuxDstData,
111  UINT32* pAuxDstSize, RDPGFX_H264_METABLOCK* meta,
112  RDPGFX_H264_METABLOCK* auxMeta);
113 
114  FREERDP_API INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op,
115  const RECTANGLE_16* regionRects, UINT32 numRegionRect,
116  const BYTE* pSrcData, UINT32 SrcSize,
117  const RECTANGLE_16* auxRegionRects, UINT32 numAuxRegionRect,
118  const BYTE* pAuxSrcData, UINT32 AuxSrcSize, BYTE* pDstData,
119  DWORD DstFormat, UINT32 nDstStep, UINT32 nDstWidth,
120  UINT32 nDstHeight, UINT32 codecId);
121 
122  FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height);
123 
124  FREERDP_API void h264_context_free(H264_CONTEXT* h264);
125 
126  WINPR_ATTR_MALLOC(h264_context_free, 1)
127  FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor);
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif /* FREERDP_CODEC_H264_H */