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_HW_ACCEL,
66 } H264_CONTEXT_OPTION;
71 FREERDP_API BOOL h264_context_set_option(H264_CONTEXT* h264, H264_CONTEXT_OPTION option,
75 FREERDP_API UINT32 h264_context_get_option(H264_CONTEXT* h264, H264_CONTEXT_OPTION option);
78 FREERDP_API INT32 avc420_compress(H264_CONTEXT* h264,
const BYTE* pSrcData, DWORD SrcFormat,
79 UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight,
95 FREERDP_API INT32 h264_get_yuv_buffer(H264_CONTEXT* h264, UINT32 nSrcStride, UINT32 nSrcWidth,
96 UINT32 nSrcHeight, BYTE* YUVData[3], UINT32 stride[3]);
108 FREERDP_API INT32 h264_compress(H264_CONTEXT* h264, BYTE** ppDstData, UINT32* pDstSize);
111 FREERDP_API INT32 avc420_decompress(H264_CONTEXT* h264,
const BYTE* pSrcData, UINT32 SrcSize,
112 BYTE* pDstData, DWORD DstFormat, UINT32 nDstStep,
113 UINT32 nDstWidth, UINT32 nDstHeight,
117 FREERDP_API INT32 avc444_compress(H264_CONTEXT* h264,
const BYTE* pSrcData, DWORD SrcFormat,
118 UINT32 nSrcStep, UINT32 nSrcWidth, UINT32 nSrcHeight,
120 BYTE** pDstData, UINT32* pDstSize, BYTE** pAuxDstData,
125 FREERDP_API INT32 avc444_decompress(H264_CONTEXT* h264, BYTE op,
127 const BYTE* pSrcData, UINT32 SrcSize,
128 const RECTANGLE_16* auxRegionRects, UINT32 numAuxRegionRect,
129 const BYTE* pAuxSrcData, UINT32 AuxSrcSize, BYTE* pDstData,
130 DWORD DstFormat, UINT32 nDstStep, UINT32 nDstWidth,
131 UINT32 nDstHeight, UINT32 codecId);
134 FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height);
136 FREERDP_API
void h264_context_free(H264_CONTEXT* h264);
138 WINPR_ATTR_MALLOC(h264_context_free, 1)
140 FREERDP_API H264_CONTEXT* h264_context_new(BOOL Compressor);