| 80 | } |
| 81 | |
| 82 | bool FFmpegEncoderPlugin::Init(const EncoderConfig& config, const std::string& monitor_name) { |
| 83 | if (!plugin_enabled_) { |
| 84 | LOGE("This plugin is disabled!"); |
| 85 | return false; |
| 86 | } |
| 87 | GrVideoEncoderPlugin::Init(config, monitor_name); |
| 88 | auto encoder = std::make_shared<FFmpegEncoder>(this); |
| 89 | auto ok = encoder->Init(config, monitor_name); |
| 90 | if (!ok) { |
| 91 | LOGE("Init ffmpeg encoder for: {} failed.", monitor_name); |
| 92 | return false; |
| 93 | } |
| 94 | LOGI("FFmpeg encoder init success for: {}", monitor_name); |
| 95 | video_encoders_[monitor_name] = encoder; |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | VideoEncoderError FFmpegEncoderPlugin::Encode(const std::shared_ptr<Image>& i420_image, uint64_t frame_index, const std::any& extra) { |
| 100 | auto cap_video_frame = std::any_cast<CaptureVideoFrame>(extra); |
nothing calls this directly
no outgoing calls
no test coverage detected