From 7e64d0c78e8a21f2ede7eab1303758391001c0dc Mon Sep 17 00:00:00 2001 From: kartofen Date: Mon, 17 Oct 2022 23:04:12 +0300 Subject: many changes in progess --- src/camera.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/camera.c') diff --git a/src/camera.c b/src/camera.c index 6842a12..8d74217 100644 --- a/src/camera.c +++ b/src/camera.c @@ -1,20 +1,20 @@ #include "camera.h" #include "common_v4l2.h" -CommonV4l2 common_v4l2; - -void camera_init(char *dev_name, unsigned int x_res, unsigned int y_res) +void camera_init(camera_handle *handle, camera_params params) { - CommonV4l2_init(&common_v4l2, dev_name, x_res, y_res); + handle->handle = malloc(sizeof(CommonV4l2)); + CommonV4l2_init(handle->handle, params.device, params.x_res, params.y_res); } -char *camera_get_image() +char *camera_get_image(camera_handle *handle) { - CommonV4l2_update_image(&common_v4l2); - return CommonV4l2_get_image(&common_v4l2); + CommonV4l2_update_image(handle->handle); + return CommonV4l2_get_image(handle->handle); } -void camera_deinit() +void camera_deinit(camera_handle *handle) { - CommonV4l2_deinit(&common_v4l2); + CommonV4l2_deinit(handle->handle); + free(handle->handle); } -- cgit v1.2.3