|
@@ -94,6 +94,7 @@ std::unique_ptr<vtk_viewer> augment_viewer;
|
|
|
|
|
|
|
|
std::unique_ptr<std::thread> encoder_thread;
|
|
std::unique_ptr<std::thread> encoder_thread;
|
|
|
bool output_full_frame = false;
|
|
bool output_full_frame = false;
|
|
|
|
|
+bool output_halve_width = false;
|
|
|
int output_width = -1, output_height = -1;
|
|
int output_width = -1, output_height = -1;
|
|
|
encoder_type chosen_encoder = ENCODER_JPEG;
|
|
encoder_type chosen_encoder = ENCODER_JPEG;
|
|
|
nvenc_config main_nvenc_conf;
|
|
nvenc_config main_nvenc_conf;
|
|
@@ -905,6 +906,10 @@ void prepare_imgui_frame() {
|
|
|
if (ImGui::Button("Close")) {
|
|
if (ImGui::Button("Close")) {
|
|
|
simple_eq.emplace(stop_encoder);
|
|
simple_eq.emplace(stop_encoder);
|
|
|
}
|
|
}
|
|
|
|
|
+ ImGui::SameLine();
|
|
|
|
|
+ if (ImGui::Button("Request IDR")) {
|
|
|
|
|
+ simple_eq.emplace([] { mq().update_variable(REQUEST_IDR, true); });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ImGui::SeparatorText("Configs");
|
|
ImGui::SeparatorText("Configs");
|
|
@@ -929,7 +934,11 @@ void prepare_imgui_frame() {
|
|
|
{
|
|
{
|
|
|
auto guard = imgui_disable_guard{is_encoding()};
|
|
auto guard = imgui_disable_guard{is_encoding()};
|
|
|
ImGui::Checkbox("Full Resolution", &output_full_frame);
|
|
ImGui::Checkbox("Full Resolution", &output_full_frame);
|
|
|
- ImGui::SameLine();
|
|
|
|
|
|
|
+ if (!output_full_frame) {
|
|
|
|
|
+ ImGui::SameLine();
|
|
|
|
|
+ ImGui::Checkbox("Halve Width", &output_halve_width);
|
|
|
|
|
+ }
|
|
|
|
|
+// ImGui::SameLine();
|
|
|
ImGui::Checkbox("Save Video", &encoder_save_file);
|
|
ImGui::Checkbox("Save Video", &encoder_save_file);
|
|
|
if (encoder_save_file) {
|
|
if (encoder_save_file) {
|
|
|
ImGui::SameLine();
|
|
ImGui::SameLine();
|
|
@@ -1058,9 +1067,7 @@ void render_main_window() {
|
|
|
// draw preview camera frame
|
|
// draw preview camera frame
|
|
|
assert(left->img_dev->size() == right->img_dev->size());
|
|
assert(left->img_dev->size() == right->img_dev->size());
|
|
|
float width_normal = left->img_dev->size().aspectRatio() / frame_size.aspectRatio();
|
|
float width_normal = left->img_dev->size().aspectRatio() / frame_size.aspectRatio();
|
|
|
- auto render_rect = simple_rect{
|
|
|
|
|
- -width_normal, -1, 2 * width_normal, 2
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ auto render_rect = simple_rect{-1, -1, 2, 2}.fit_aspect(width_normal);
|
|
|
if (preview_camera_index == 0) { // left camera
|
|
if (preview_camera_index == 0) { // left camera
|
|
|
if (!left->img_dev->empty()) {
|
|
if (!left->img_dev->empty()) {
|
|
|
left->render(render_rect);
|
|
left->render(render_rect);
|
|
@@ -1094,8 +1101,11 @@ void generate_output_frame() {
|
|
|
} else {
|
|
} else {
|
|
|
float width_normal = left->img_dev->size().aspectRatio() /
|
|
float width_normal = left->img_dev->size().aspectRatio() /
|
|
|
output_fbo->size().aspectRatio();
|
|
output_fbo->size().aspectRatio();
|
|
|
- left_rect = simple_rect{-0.5f - width_normal / 2, -1, width_normal, 2};
|
|
|
|
|
- right_rect = simple_rect{0.5f - width_normal / 2, -1, width_normal, 2};
|
|
|
|
|
|
|
+ if (output_halve_width) {
|
|
|
|
|
+ width_normal *= 0.5f;
|
|
|
|
|
+ }
|
|
|
|
|
+ left_rect = simple_rect{-1, -1, 1, 2}.fit_aspect(width_normal);
|
|
|
|
|
+ right_rect = simple_rect{0, -1, 1, 2}.fit_aspect(width_normal);
|
|
|
}
|
|
}
|
|
|
left->render(left_rect, true);
|
|
left->render(left_rect, true);
|
|
|
right->render(right_rect, true);
|
|
right->render(right_rect, true);
|