diff --git a/spa/plugins/libcamera/libcamera-utils.c b/spa/plugins/libcamera/libcamera-utils.c index bc34d9082..4a57c6774 100644 --- a/spa/plugins/libcamera/libcamera-utils.c +++ b/spa/plugins/libcamera/libcamera-utils.c @@ -470,9 +470,6 @@ static int spa_libcamera_set_format(struct impl *this, struct spa_video_info *fo if ((res = spa_libcamera_open(dev)) < 0) return res; - /* stop the camera first. It might have opened with different configuration*/ - libcamera_stop_capture(dev->camera); - spa_log_info(dev->log, "libcamera: set %s %dx%d %d/%d\n", (char *)&info->fourcc, fmt.width, fmt.height, fmt.denominator, fmt.numerator); @@ -485,9 +482,6 @@ static int spa_libcamera_set_format(struct impl *this, struct spa_video_info *fo return -EINVAL; } - /* start the camera now with the configured params */ - libcamera_start_capture(dev->camera); - dev->have_format = true; size->width = libcamera_get_streamcfg_width(dev->camera); size->height = libcamera_get_streamcfg_height(dev->camera); @@ -871,6 +865,8 @@ static int spa_libcamera_stream_on(struct impl *this) libcamera_connect(dev->camera); + libcamera_start_capture(dev->camera); + port->source.func = libcamera_on_fd_events; port->source.data = this; port->source.fd = spa_system_eventfd_create(this->system, SPA_FD_CLOEXEC | SPA_FD_NONBLOCK); diff --git a/spa/plugins/libcamera/libcamera_wrapper.cpp b/spa/plugins/libcamera/libcamera_wrapper.cpp index 00dda7a91..037058af0 100644 --- a/spa/plugins/libcamera/libcamera_wrapper.cpp +++ b/spa/plugins/libcamera/libcamera_wrapper.cpp @@ -540,7 +540,6 @@ extern "C" { } void LibCamera::close() { - this->stop(); this->cam_->release(); }