#ifndef __VIDEODECODER_H__ #define __VIDEODECODER_H__ #include #include #include struct AVPacket; struct AVCodec; struct AVCodecContext; struct AVCodecParameters; class VideoDecoder { public: VideoDecoder(const AVCodec *codec, const AVCodecParameters *parameters); void start(); void push(const std::shared_ptr &packet); protected: void run(); private: bool m_exit; std::thread m_thread; AVCodecContext *m_context; std::mutex m_mutex; std::queue> m_packets; }; #endif // __VIDEODECODER_H__