subtitle_sampler.h 743 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "defs.h"
  3. namespace ffmpeg {
  4. /**
  5. * Class transcode audio frames from one format into another
  6. */
  7. class SubtitleSampler : public MediaSampler {
  8. public:
  9. SubtitleSampler() = default;
  10. ~SubtitleSampler() override;
  11. bool init(const SamplerParameters& params) override;
  12. int sample(const ByteStorage* in, ByteStorage* out) override;
  13. void shutdown() override;
  14. // returns number processed/scaling bytes
  15. int sample(AVSubtitle* sub, ByteStorage* out);
  16. // helper serialization/deserialization methods
  17. static void serialize(const AVSubtitle& sub, ByteStorage* out);
  18. static bool deserialize(const ByteStorage& buf, AVSubtitle* sub);
  19. private:
  20. // close resources
  21. void cleanUp();
  22. };
  23. } // namespace ffmpeg