12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef MPPDECODER_H
- #define MPPDECODER_H
- #include <rockchip/rk_mpi.h>
- #include <rockchip/mpp_buffer.h>
- #include <rockchip/mpp_frame.h>
- #include <rockchip/mpp_packet.h>
- #include <rockchip/rk_type.h>
- #include <rockchip/rk_mpi_cmd.h>
- #define MPP_ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1))
- class MppDecoder
- {
- public:
- MppDecoder(const MppDecoder &) = delete;
- MppDecoder &operator=(const MppDecoder &) = delete;
- bool init();
- int getDecodeIndex(){return m_index;}
- bool decodeJpegToRgb(const char *jpegData, size_t jpegSize, unsigned char **rgbData, int *width, int *height);
- MppDecoder() = default;
- ~MppDecoder() = default;
- private:
- MppCtx m_ctx{nullptr};
- MppApi *m_mpi{nullptr};
- MppDecCfg m_decCfg{nullptr};
- uint32_t m_needSplit{0};
- MppBufferGroup m_PacketGroup{nullptr};
- MppBufferGroup m_frameGroup{nullptr};
- MppFrame m_frame{nullptr};
- MppPacket m_packet{nullptr};
- RK_U32 m_width{3840};
- RK_U32 m_height{2160};
- RK_U32 m_format;
- MppBuffer m_packetBuffer{nullptr};
- MppBuffer m_frameBuffer{nullptr};
- void *m_inputBufferPtr{nullptr};
- MppTask m_task{nullptr};
- unsigned char *m_rgbData{nullptr};
- // init flag
- bool m_initFlag{false};
- // decoder index
- int m_index{0};
- };
- #endif // MPPDECODER_H
|