format_converter.h 377 B

123456789101112131415161718
  1. #pragma once
  2. extern "C" {
  3. #include "libavformat/avformat.h"
  4. #include "libswscale/swscale.h"
  5. }
  6. class FormatConverter {
  7. public:
  8. FormatConverter(
  9. size_t width, size_t height,
  10. AVPixelFormat input_pixel_format, AVPixelFormat output_pixel_format);
  11. void operator()(AVFrame* src, AVFrame* dst);
  12. private:
  13. size_t width_;
  14. size_t height_;
  15. SwsContext* conversion_context_{};
  16. };