初始提交

This commit is contained in:
xzl
2017-04-01 16:35:56 +08:00
parent aef0ecbcb9
commit 3f73024a9b
131 changed files with 18216 additions and 0 deletions

48
src/Codec/H264Encoder.h Normal file
View File

@@ -0,0 +1,48 @@
/*
* H264Encoder.h
*
* Created on: 2016年8月11日
* Author: xzl
*/
#ifndef CODEC_H264ENCODER_H_
#define CODEC_H264ENCODER_H_
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
#include <x264.h>
#ifdef __cplusplus
}
#endif //__cplusplus
namespace ZL {
namespace Codec {
class H264Encoder {
public:
typedef struct {
int iType;
int iLength;
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);
private:
x264_t* m_pX264Handle = nullptr;
x264_picture_t* m_pPicIn = nullptr;
x264_picture_t* m_pPicOut = nullptr;
H264Frame m_aFrames[10];
};
} /* namespace Codec */
} /* namespace ZL */
#endif /* CODEC_H264ENCODER_H_ */