优化编解码相关代码

This commit is contained in:
ziyue
2022-05-25 15:11:26 +08:00
parent 0739b1ddd2
commit 9736badcea
9 changed files with 630 additions and 395 deletions

View File

@@ -7,13 +7,10 @@
* LICENSE file in the root of the source tree. All contributing project authors
* may be found in the AUTHORS file in the root of the source tree.
*/
#ifndef CODEC_H264ENCODER_H_
#define CODEC_H264ENCODER_H_
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
@@ -32,14 +29,16 @@ public:
uint8_t *pucData;
} H264Frame;
H264Encoder(void);
virtual ~H264Encoder(void);
bool init(int iWidth, int iHeight, int iFps);
int inputData(char *apcYuv[3], int aiYuvLen[3], int64_t i64Pts, H264Frame **ppFrame);
H264Encoder();
~H264Encoder();
bool init(int iWidth, int iHeight, int iFps, int iBitRate);
int inputData(char *yuv[3], int linesize[3], int64_t cts, H264Frame **out_frame);
private:
x264_t* _pX264Handle = nullptr;
x264_picture_t* _pPicIn = nullptr;
x264_picture_t* _pPicOut = nullptr;
x264_t *_pX264Handle = nullptr;
x264_picture_t *_pPicIn = nullptr;
x264_picture_t *_pPicOut = nullptr;
H264Frame _aFrames[10];
};