Skip to content

Commit 3f47531

Browse files
committed
Camera width was not being updated right
1 parent f19ede2 commit 3f47531

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

Client/src/camera/CameraSettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CameraSettings::CameraSettings(CameraSettings& settings)
1616
gain = settings.gain;
1717
fps = settings.fps;
1818
width = settings.width;
19-
height = settings.width;
19+
height = settings.height;
2020
}
2121

2222
CameraSettings::~CameraSettings()

Client/src/camera/OCVCamera.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ OCVCamera::OCVCamera(int width, int height, int fps, int index) :
3232
cap.set(cv::CAP_PROP_FRAME_HEIGHT, this->height);
3333
cap.set(cv::CAP_PROP_FPS, this->fps);
3434

35-
36-
37-
//w_scale = (float)width / w;//(float)cam_native_width;
3835
exposure, gain = -1;
3936
}
4037

Client/src/presenter/presenter.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,12 @@ void Presenter::update_camera_params()
232232
this->logger->info("Updating camera parameters...");
233233
all_cameras[state.selected_camera]->set_settings(build_camera_params());
234234

235-
//if (state.video_height < 0 || state.video_width < 0)
236-
//{
237-
// The camera is using its default resolution so we must update our state
238-
// to it. If we are using our custom resolution that wont be necessary.
235+
// The camera can be using its default resolution so we must sync our state
236+
// to it. If we are using our custom resolution that wont be necessary.
239237
state.video_height = all_cameras[state.selected_camera]->height;
240238
state.video_width = all_cameras[state.selected_camera]->width;
241239
state.video_fps = all_cameras[state.selected_camera]->fps;
242-
//}
243-
244-
this->logger->info("Updated camera parameters.");
240+
this->logger->info("Updated camera parameters. {}x{}@{}", state.video_width, state.video_height, state.video_fps);
245241
}
246242

247243

@@ -292,6 +288,7 @@ void Presenter::save_prefs(const ConfigData& data)
292288
state.video_fps = data.video_fps;
293289
state.video_height = data.video_height;
294290
state.video_width = data.video_width;
291+
295292
update_camera_params();
296293

297294

0 commit comments

Comments
 (0)