FreeRDP
libfreerdp/codec/h264.h
1 
21 #ifndef FREERDP_LIB_CODEC_H264_H
22 #define FREERDP_LIB_CODEC_H264_H
23 
24 #include <freerdp/api.h>
25 #include <freerdp/config.h>
26 #include <freerdp/codec/h264.h>
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33  typedef BOOL (*pfnH264SubsystemInit)(H264_CONTEXT* h264);
34  typedef void (*pfnH264SubsystemUninit)(H264_CONTEXT* h264);
35 
36  typedef int (*pfnH264SubsystemDecompress)(H264_CONTEXT* WINPR_RESTRICT h264,
37  const BYTE* WINPR_RESTRICT pSrcData, UINT32 SrcSize);
38  typedef int (*pfnH264SubsystemCompress)(H264_CONTEXT* WINPR_RESTRICT h264,
39  const BYTE** WINPR_RESTRICT pSrcYuv,
40  const UINT32* WINPR_RESTRICT pStride,
41  BYTE** WINPR_RESTRICT ppDstData,
42  UINT32* WINPR_RESTRICT pDstSize);
43 
45  {
46  const char* name;
47  pfnH264SubsystemInit Init;
48  pfnH264SubsystemUninit Uninit;
49  pfnH264SubsystemDecompress Decompress;
50  pfnH264SubsystemCompress Compress;
51  };
52 
54  {
55  BOOL Compressor;
56 
57  UINT32 width;
58  UINT32 height;
59 
60  H264_RATECONTROL_MODE RateControlMode;
61  UINT32 BitRate;
62  UINT32 FrameRate;
63  UINT32 QP;
64  UINT32 UsageType;
65  UINT32 NumberOfThreads;
66 
67  UINT32 iStride[3];
68  BYTE* pOldYUVData[3];
69  BYTE* pYUVData[3];
70 
71  UINT32 iYUV444Size[3];
72  UINT32 iYUV444Stride[3];
73  BYTE* pOldYUV444Data[3];
74  BYTE* pYUV444Data[3];
75 
76  UINT32 numSystemData;
77  void* pSystemData;
78  const H264_CONTEXT_SUBSYSTEM* subsystem;
79  YUV_CONTEXT* yuv;
80 
81  BOOL encodingBuffer;
82  BOOL firstLumaFrameDone;
83  BOOL firstChromaFrameDone;
84 
85  void* lumaData;
86  wLog* log;
87  };
88 
89  FREERDP_LOCAL BOOL avc420_ensure_buffer(H264_CONTEXT* h264, UINT32 stride, UINT32 width,
90  UINT32 height);
91 
92 #ifdef WITH_MEDIACODEC
93  extern const H264_CONTEXT_SUBSYSTEM g_Subsystem_mediacodec;
94 #endif
95 #if defined(_WIN32) && defined(WITH_MEDIA_FOUNDATION)
96  extern const H264_CONTEXT_SUBSYSTEM g_Subsystem_MF;
97 #endif
98 #ifdef WITH_OPENH264
99  extern const H264_CONTEXT_SUBSYSTEM g_Subsystem_OpenH264;
100 #endif
101 #ifdef WITH_VIDEO_FFMPEG
102  extern const H264_CONTEXT_SUBSYSTEM g_Subsystem_libavcodec;
103 #endif
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* FREERDP_LIB_CODEC_H264_H */