MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / Encode

Method Encode

src/render/plugins/ffmpeg_encoder/ffmpeg_encoder_plugin.cpp:99–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);
101 auto monitor_name = std::string(cap_video_frame.display_name_);
102 if (!i420_image) {
103 return VideoEncoderError::InvalidInput();
104 }
105 if (!HasEncoderForMonitor(monitor_name)) {
106 return VideoEncoderError::NotFound();
107 }
108 if (!video_encoders_[monitor_name]->Encode(i420_image, frame_index, extra)) {
109 return VideoEncoderError::EncodeFailed();
110 }
111 return VideoEncoderError::Ok();
112 }
113
114 void FFmpegEncoderPlugin::Exit(const std::string& monitor_name) {
115 if (HasEncoderForMonitor(monitor_name)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected