#ifndef REMOTEAR3_ENCODER_NVENC_H #define REMOTEAR3_ENCODER_NVENC_H #include "codec_base.hpp" #include "core/cuda_helper.hpp" #include "core/image_utility.hpp" #include #include class encoder_nvenc { public: ~encoder_nvenc(); struct create_config { cv::Size frame_size; int frame_rate; float bitrate_mbps; bool save_file; bool save_length; CUcontext *ctx = nullptr; smart_cuda_stream *stream = nullptr; }; using this_type = encoder_nvenc; using pointer = std::unique_ptr; static pointer create(create_config conf); struct modifiable_config { int frame_rate; float bitrate_mbps; }; void change_config(modifiable_config conf); frame_info encode(const image_u8c4 &img, bool force_idr = false); cv::Size frame_size() const; private: struct impl; std::unique_ptr pimpl; }; #endif //REMOTEAR3_ENCODER_NVENC_H