| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #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 <opencv2/core/types.hpp>
- #include <memory>
- 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<this_type>;
- 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<impl> pimpl;
- };
- #endif //REMOTEAR3_ENCODER_NVENC_H
|