ffmpeg_frame_generator.h 883 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "ui/effects/frame_generator.h"
  9. #include <QtGui/QImage>
  10. #include <memory>
  11. namespace FFmpeg {
  12. class FrameGenerator final : public Ui::FrameGenerator {
  13. public:
  14. explicit FrameGenerator(const QByteArray &bytes);
  15. ~FrameGenerator();
  16. int count() override;
  17. double rate() override;
  18. Frame renderNext(
  19. QImage storage,
  20. QSize size,
  21. Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) override;
  22. Frame renderCurrent(
  23. QImage storage,
  24. QSize size,
  25. Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) override;
  26. void jumpToStart() override;
  27. private:
  28. class Impl;
  29. std::unique_ptr<Impl> _impl;
  30. };
  31. } // namespace FFmpeg