Transcode.h 917 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef TRANSCODE_H
  2. #define TRANSCODE_H
  3. #include "PlayerGlobalInfo.h"
  4. extern "C"
  5. {
  6. #include "libswscale/swscale.h"
  7. }
  8. class TransCode
  9. {
  10. public:
  11. TransCode();
  12. ~TransCode();
  13. /* 使用ffmpeg将yv12转换成RGB24 */
  14. bool YV12ToRGB24_FFmpeg(unsigned char *pYV12Data, unsigned char *pRGB24Data, int width, int height);
  15. // bool YV12ToRGB24_FFmpeg(unsigned char *pYV12Data, unsigned char *pRGB24Data, int width, int height, int stride);
  16. /* YV12转RGB888 */
  17. void YV12ToRGB888(unsigned char *pYV12Data, unsigned char *pRGB24Data, int width, int height);
  18. /* RGB888转QImage */
  19. void YV12ToQImage(unsigned char *pYV12Data, Image_QImage& image, int width, int height);
  20. /* YV12转YUV */
  21. void YV12ToYUV420(unsigned char *pYV12Data, Image_YUV420& yuvData, int width, int height);
  22. private:
  23. /* 转码上下文 */
  24. SwsContext* m_swsCtx = nullptr;
  25. };
  26. #endif /* TRANSCODE_H */