video_encoder.h 595 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef REMOTEAR2_VIDEO_ENCODER_H
  2. #define REMOTEAR2_VIDEO_ENCODER_H
  3. #include <cuda_gl_interop.h>
  4. #include <memory>
  5. class video_encoder {
  6. public:
  7. video_encoder();
  8. ~video_encoder();
  9. bool initialize();
  10. bool start_encode(int width, int height, int fps);
  11. void stop_encode();
  12. bool encode_frame(void *frame_ptr, void **output_ptr, size_t *output_size);
  13. bool encode_frame(cudaGraphicsResource *res, void **output_ptr, size_t *output_size);
  14. bool is_encoding();
  15. private:
  16. struct impl;
  17. std::unique_ptr<impl> pimpl;
  18. };
  19. #endif //REMOTEAR2_VIDEO_ENCODER_H