#ifndef TRANSCODE_H #define TRANSCODE_H #include "PlayerGlobalInfo.h" extern "C" { #include "libswscale/swscale.h" } class TransCode { public: TransCode(); ~TransCode(); /* 使用ffmpeg将yv12转换成RGB24 */ bool YV12ToRGB24_FFmpeg(unsigned char *pYV12Data, unsigned char *pRGB24Data, int width, int height); // bool YV12ToRGB24_FFmpeg(unsigned char *pYV12Data, unsigned char *pRGB24Data, int width, int height, int stride); /* YV12转RGB888 */ void YV12ToRGB888(unsigned char *pYV12Data, unsigned char *pRGB24Data, int width, int height); /* RGB888转QImage */ void YV12ToQImage(unsigned char *pYV12Data, Image_QImage& image, int width, int height); /* YV12转YUV */ void YV12ToYUV420(unsigned char *pYV12Data, Image_YUV420& yuvData, int width, int height); private: /* 转码上下文 */ SwsContext* m_swsCtx = nullptr; }; #endif /* TRANSCODE_H */