diff options
author | kartofen <mladenovnasko0@gmail.com> | 2022-10-19 22:38:27 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2022-10-19 22:38:27 +0300 |
commit | 9d88d471ac059c93523c00b96ae1cbbc52e07b69 (patch) | |
tree | 1c696d196b86084a0208e338e5aaecff24361842 /src/camera.c | |
parent | 0e6accd72e2b27cd348c6d43eac01cf4d73b752d (diff) |
minor refactor
Diffstat (limited to 'src/camera.c')
-rw-r--r-- | src/camera.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/camera.c b/src/camera.c index 8d74217..61eb592 100644 --- a/src/camera.c +++ b/src/camera.c @@ -3,18 +3,18 @@ void camera_init(camera_handle *handle, camera_params params) { - handle->handle = malloc(sizeof(CommonV4l2)); - CommonV4l2_init(handle->handle, params.device, params.x_res, params.y_res); + *handle = malloc(sizeof(CommonV4l2)); + CommonV4l2_init(*handle, params.device, params.x_res, params.y_res); } char *camera_get_image(camera_handle *handle) { - CommonV4l2_update_image(handle->handle); - return CommonV4l2_get_image(handle->handle); + CommonV4l2_update_image(*handle); + return CommonV4l2_get_image(*handle); } void camera_deinit(camera_handle *handle) { - CommonV4l2_deinit(handle->handle); - free(handle->handle); + CommonV4l2_deinit(*handle); + free(*handle); } |