Transcode.h 997 B

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