MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / init

Method init

source/MaaAdbControlUnit/Manager/ScreencapAgent.cpp:140–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140bool ScreencapAgent::init()
141{
142 LogFunc;
143
144 if (active_unit_) {
145 LogError << "already initialized" << VAR(active_unit_);
146 return false;
147 }
148
149 for (auto it = units_.begin(); it != units_.end();) {
150 if (it->second->init()) {
151 ++it;
152 }
153 else {
154 it = units_.erase(it);
155 }
156 }
157
158 active_unit_ = speed_test();
159 if (!active_unit_) {
160 LogError << "No available screencap method";
161 return false;
162 }
163
164 units_.clear();
165 return true;
166}
167
168std::optional<cv::Mat> ScreencapAgent::screencap()
169{

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected