Screen image transmission uses H.264 compression #65

This commit is contained in:
yuanyuanxiang
2025-03-30 18:03:01 +08:00
parent 7bcf11ce0a
commit 1358fecc7c
152 changed files with 44123 additions and 62 deletions

35
client/X264Encoder.h Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
extern "C"{
#include <libyuv\libyuv.h>
#include <x264\x264.h>
}
class CX264Encoder
{
private:
x264_t* m_pCodec; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
x264_picture_t *m_pPicIn;
x264_picture_t *m_pPicOut;
x264_param_t m_Param;
public:
bool open(int width, int height, int fps,int bitrate);
bool open(x264_param_t * param);
void close();
int encode(
uint8_t * rgb,
uint8_t bpp,
uint32_t stride,
uint32_t width,
uint32_t height,
uint8_t ** lppData,
uint32_t * lpSize,
int direction = 1
);
CX264Encoder();
~CX264Encoder();
};