#ifndef RK_ENCODER_H #define RK_ENCODER_H #include #include #include #include #include #include typedef struct { MppFrameFormat fmt; int width; int height; int hor_stride; int ver_stride; int header_size; int frame_size; int fps; int fix_qp; } Encoder_Param_t; class RkEncoder { public: RkEncoder(Encoder_Param_t param); ~RkEncoder(); int init(); int encode(void *inbuf, int insize, uint8_t *outbuf); int startCode3(uint8_t *buf); int startCode4(uint8_t *buf); private: Encoder_Param_t m_param; MppCtx m_contex; MppApi *m_mpi; MppPacket m_packet = nullptr; MppFrame m_frame = nullptr; MppBuffer m_buffer = nullptr; }; #endif