Add auto close on connection failure
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled

This commit is contained in:
Lorenzooone 2024-12-21 00:49:04 +01:00
parent b9cd5ceca0
commit d69c2ca31e
2 changed files with 10 additions and 3 deletions

View File

@ -77,7 +77,8 @@ void is_twl_acquisition_capture_main_loop(CaptureData* capture_data, ISDeviceCap
bool is_acquisition_off = true;
uint32_t last_read_frame_index = 0;
CaptureScreensType curr_capture_type = capture_data->status.capture_type;
CaptureSpeedsType curr_capture_speed = capture_data->status.capture_speed;
//CaptureSpeedsType curr_capture_speed = capture_data->status.capture_speed;
CaptureSpeedsType curr_capture_speed = CAPTURE_SPEEDS_FULL;
bool audio_enabled = true;
std::chrono::time_point<std::chrono::high_resolution_clock> clock_last_frame = std::chrono::high_resolution_clock::now();
float last_frame_length = 0.0;
@ -123,7 +124,7 @@ void is_twl_acquisition_capture_main_loop(CaptureData* capture_data, ISDeviceCap
return;
}
if(processed) {
curr_capture_speed = capture_data->status.capture_speed;
//curr_capture_speed = capture_data->status.capture_speed;
ret = SetLastFrameInfo(handlers, video_address, video_length, audio_address, audio_length, usb_device_desc);
if(ret < 0) {
capture_error_print(true, capture_data, "Frame Info Set: Failed");

View File

@ -470,6 +470,10 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
std::thread joint_thread(screen_display_thread, joint_screen);
capture_data->status.connected = connect(true, capture_data, &frontend_data, override_data.auto_connect_to_first);
if(override_data.quit_on_first_connection_failure && (!capture_data->status.connected)) {
capture_data->status.running = false;
ret_val = -3;
}
bool last_connected = capture_data->status.connected;
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
int no_data_consecutive = 0;
@ -712,7 +716,7 @@ int main(int argc, char **argv) {
continue;
if(parse_existence_arg(i, argv, override_data.auto_connect_to_first, true, "--auto_connect"))
continue;
if(parse_existence_arg(i, argv, override_data.quit_on_first_connection_failure, true, "--close_first_on_failure"))
if(parse_existence_arg(i, argv, override_data.quit_on_first_connection_failure, true, "--failure_close"))
continue;
if(parse_int_arg(i, argc, argv, override_data.loaded_profile, "--profile"))
continue;
@ -752,6 +756,8 @@ int main(int argc, char **argv) {
std::cout << " --no_cursor Prevents the mouse cursor from showing, unless moved." << std::endl;
std::cout << " --auto_connect Automatically connects to the first available device," << std::endl;
std::cout << " even if multiple are present." << std::endl;
std::cout << " --failure_close Automatically closes the software if the first connection" << std::endl;
std::cout << " doesn't succeed." << std::endl;
std::cout << " --profile Loads the profile with the specified ID at startup" << std::endl;
std::cout << " instead of the default one. When the program closes," << std::endl;
std::cout << " the data is also saved to the specified profile." << std::endl;