1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef TRANSCODE_H
- #define TRANSCODE_H
- #include "PlayerGlobalInfo.h"
- #define USING_FFMPEG false
- #if(USING_FFMPEG == true)
- extern "C"
- {
- #include "libswscale/swscale.h"
- }
- #endif // USING_FFMPEG
- 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 */
|