video_decoder.h 388 B

12345678910111213141516171819
  1. #pragma once
  2. extern "C" {
  3. #include "libavcodec/avcodec.h"
  4. }
  5. class VideoDecoder {
  6. public:
  7. VideoDecoder(AVCodecParameters* codec_parameters);
  8. ~VideoDecoder();
  9. bool send(AVPacket* packet);
  10. bool receive(AVFrame* frame);
  11. unsigned width() const;
  12. unsigned height() const;
  13. AVPixelFormat pixel_format() const;
  14. AVRational time_base() const;
  15. private:
  16. AVCodecContext* codec_context_{};
  17. };