recorder.h 645 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef RECORDER_H
  2. #define RECORDER_H
  3. #include "simple/graphical/surface.h"
  4. #include "utils.hpp"
  5. #if defined ENABLE_THEORA_RECORDER
  6. #include <fstream>
  7. #include <ogg/ogg.h>
  8. #include <theora/theoraenc.h>
  9. #endif
  10. class recorder
  11. {
  12. public:
  13. recorder(std::string, int2);
  14. void record(const simple::graphical::surface&, int, bool);
  15. ~recorder();
  16. private:
  17. #if defined ENABLE_THEORA_RECORDER
  18. std::fstream file;
  19. ogg_stream_state video_stream;
  20. th_info video_info;
  21. th_enc_ctx* video_encoder;
  22. ogg_packet packet;
  23. ogg_page page;
  24. th_ycbcr_buffer ycbcr_view;
  25. std::vector<unsigned char> ycbcr_buffer;
  26. #endif
  27. };
  28. #endif /* end of include guard */