def _init_camera(self, num, stereo_mode, stereo_decimate):
    try:
        self._camera = mo.MMALCamera()
    except PiCameraMMALError as e:
        if (e.status == mmal.MMAL_ENOMEM):
            raise PiCameraError("Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.")
        else:
            raise
    self._camera_config = self._camera.control.params[mmal.MMAL_PARAMETER_CAMERA_CONFIG]
    if (stereo_mode != mmal.MMAL_STEREOSCOPIC_MODE_NONE):
        for p in self._camera.outputs:
            mp = mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE_T(mmal.MMAL_PARAMETER_HEADER_T(mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE, ct.sizeof(mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE_T)), mode=stereo_mode, decimate=stereo_decimate, swap_eyes=False)
            p.params[mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE] = mp
    self._camera.control.params[mmal.MMAL_PARAMETER_CAMERA_NUM] = num
def _init_camera(self, num, stereo_mode, stereo_decimate):
    try:
        self._camera = mo.MMALCamera()
    except PiCameraMMALError as e:
        if (e.status == mmal.MMAL_ENOMEM):
            raise PiCameraError("Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.")
        else:
            raise
    self._camera_config = self._camera.control.params[mmal.MMAL_PARAMETER_CAMERA_CONFIG]
    if (stereo_mode != mmal.MMAL_STEREOSCOPIC_MODE_NONE):
        for p in self._camera.outputs:
            mp = mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE_T(mmal.MMAL_PARAMETER_HEADER_T(mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE, ct.sizeof(mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE_T)), mode=stereo_mode, decimate=stereo_decimate, swap_eyes=False)
            p.params[mmal.MMAL_PARAMETER_STEREOSCOPIC_MODE] = mp
    self._camera.control.params[mmal.MMAL_PARAMETER_CAMERA_NUM] = num