| 81 | } |
| 82 | |
| 83 | std::optional<cv::Mat> AndrowsExtras::screencap() |
| 84 | { |
| 85 | if (display_id_.empty() && !query_display_id()) { |
| 86 | LogError << "Androws: display ID not available"; |
| 87 | return std::nullopt; |
| 88 | } |
| 89 | |
| 90 | auto argv_opt = screencap_encode_argv_.gen(argv_replace_); |
| 91 | if (!argv_opt) { |
| 92 | LogError << "Androws: failed to generate screencap encode argv"; |
| 93 | return std::nullopt; |
| 94 | } |
| 95 | |
| 96 | auto output_opt = startup_and_read_pipe(*argv_opt); |
| 97 | if (!output_opt) { |
| 98 | LogWarn << "Androws: screencap encode failed"; |
| 99 | return std::nullopt; |
| 100 | } |
| 101 | |
| 102 | return screencap_helper_.process_data(*output_opt, ScreencapHelper::decode_png); |
| 103 | } |
| 104 | |
| 105 | bool AndrowsExtras::request_display_info() |
| 106 | { |
nothing calls this directly
no test coverage detected