diff options
author | kartofen <mladenovnasko0@gmail.com> | 2022-10-17 23:04:12 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2022-10-17 23:04:12 +0300 |
commit | 7e64d0c78e8a21f2ede7eab1303758391001c0dc (patch) | |
tree | a01e44b12d66de3e4fbc5cf5ab20f439fc8d6fc8 /src/camera.c | |
parent | b1b7c92aa96af5502f276819b628b05d54f4655c (diff) |
many changes in progess
Diffstat (limited to 'src/camera.c')
-rw-r--r-- | src/camera.c | 18 |
1 files changed, 9 insertions, 9 deletions
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); } |