David
2023-12-04 19:46:00 +01:00
committed by GitHub
parent 6ddd902ce2
commit 889cd0a3f3
2 changed files with 4 additions and 4 deletions

View File

@@ -378,7 +378,7 @@ bool asst::AdbController::screencap(cv::Mat& image_payload, bool allow_reconnect
auto start_time = high_resolution_clock::now();
if (m_support_socket && m_server_started &&
screencap(m_adb.screencap_raw_by_nc, decode_raw, allow_reconnect, true)) {
screencap(m_adb.screencap_raw_by_nc, decode_raw, allow_reconnect, true, 5000)) {
auto duration = duration_cast<milliseconds>(high_resolution_clock::now() - start_time);
if (duration < min_cost) {
m_adb.screencap_method = AdbProperty::ScreencapMethod::RawByNc;
@@ -455,13 +455,13 @@ bool asst::AdbController::screencap(cv::Mat& image_payload, bool allow_reconnect
}
bool asst::AdbController::screencap(const std::string& cmd, const DecodeFunc& decode_func, bool allow_reconnect,
bool by_socket)
bool by_socket, int timeout)
{
if ((!m_support_socket || !m_server_started) && by_socket) [[unlikely]] {
return false;
}
auto ret = call_command(cmd, 20000, allow_reconnect, by_socket);
auto ret = call_command(cmd, timeout, allow_reconnect, by_socket);
if (!ret || ret.value().empty()) [[unlikely]] {
Log.warn("data is empty!");