From 72bc33a6d8ccc708c05d9d647f93d3a486bbfc69 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Thu, 3 Oct 2019 15:00:05 +0100 Subject: [PATCH] Raspicam: Add 3D controls to RaspistillYUV and RaspiVidYUV These two apps had missed the relevant calls to configure 3D capture. https://github.com/raspberrypi/userland/issues/579 --- host_applications/linux/apps/raspicam/RaspiStillYUV.c | 10 ++++++++++ host_applications/linux/apps/raspicam/RaspiVidYUV.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/host_applications/linux/apps/raspicam/RaspiStillYUV.c b/host_applications/linux/apps/raspicam/RaspiStillYUV.c index 61d80c4ee..601c14e89 100644 --- a/host_applications/linux/apps/raspicam/RaspiStillYUV.c +++ b/host_applications/linux/apps/raspicam/RaspiStillYUV.c @@ -559,6 +559,16 @@ static MMAL_STATUS_T create_camera_component(RASPISTILLYUV_STATE *state) goto error; } + status = raspicamcontrol_set_stereo_mode(camera->output[0], &state->camera_parameters.stereo_mode); + status += raspicamcontrol_set_stereo_mode(camera->output[1], &state->camera_parameters.stereo_mode); + status += raspicamcontrol_set_stereo_mode(camera->output[2], &state->camera_parameters.stereo_mode); + + if (status != MMAL_SUCCESS) + { + vcos_log_error("Could not set stereo mode : error %d", status); + goto error; + } + MMAL_PARAMETER_INT32_T camera_num = {{MMAL_PARAMETER_CAMERA_NUM, sizeof(camera_num)}, state->common_settings.cameraNum}; diff --git a/host_applications/linux/apps/raspicam/RaspiVidYUV.c b/host_applications/linux/apps/raspicam/RaspiVidYUV.c index 22ceed49d..c02e578f9 100644 --- a/host_applications/linux/apps/raspicam/RaspiVidYUV.c +++ b/host_applications/linux/apps/raspicam/RaspiVidYUV.c @@ -843,6 +843,16 @@ static MMAL_STATUS_T create_camera_component(RASPIVIDYUV_STATE *state) goto error; } + status = raspicamcontrol_set_stereo_mode(camera->output[0], &state->camera_parameters.stereo_mode); + status += raspicamcontrol_set_stereo_mode(camera->output[1], &state->camera_parameters.stereo_mode); + status += raspicamcontrol_set_stereo_mode(camera->output[2], &state->camera_parameters.stereo_mode); + + if (status != MMAL_SUCCESS) + { + vcos_log_error("Could not set stereo mode : error %d", status); + goto error; + } + MMAL_PARAMETER_INT32_T camera_num = {{MMAL_PARAMETER_CAMERA_NUM, sizeof(camera_num)}, state->common_settings.cameraNum};