20 #ifndef FREERDP_CODEC_H264_H
21 #define FREERDP_CODEC_H264_H
23 #include <winpr/wlog.h>
25 #include <freerdp/api.h>
26 #include <freerdp/types.h>
27 #include <freerdp/channels/rdpgfx.h>
36 typedef struct S_YUV_CONTEXT YUV_CONTEXT;
40 H264_RATECONTROL_VBR = 0,
42 } H264_RATECONTROL_MODE;
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,
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;
68 FREERDP_API BOOL h264_context_set_option(H264_CONTEXT* h264, H264_CONTEXT_OPTION option,
70 FREERDP_API UINT32 h264_context_get_option(H264_CONTEXT* h264, H264_CONTEXT_OPTION option);
72 FREERDP_API INT32 avc420_compress(H264_CONTEXT* h264,
const BYTE* pSrcData, DWORD SrcFormat,
73 UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight,
88 FREERDP_API INT32 h264_get_yuv_buffer(H264_CONTEXT* h264, UINT32 nSrcStride, UINT32 nSrcWidth,
89 UINT32 nSrcHeight, BYTE* YUVData[3], UINT32 stride[3]);
100 FREERDP_API INT32 h264_compress(H264_CONTEXT* h264, BYTE** ppDstData, UINT32* pDstSize);
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,
107 FREERDP_API INT32 avc444_compress(H264_CONTEXT* h264,
const BYTE* pSrcData, DWORD SrcFormat,
108 UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight,
110 BYTE** pDstData, UINT32* pDstSize, BYTE** pAuxDstData,
114 FREERDP_API INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op,
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);
122 FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height);
124 FREERDP_API
void h264_context_free(H264_CONTEXT* h264);
126 WINPR_ATTR_MALLOC(h264_context_free, 1)
127 FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor);