spa: libcamera: remove unnecessary have_config member

An extra flag is not needed because the `config` pointer can be
checked to determine if a configuration has already been retrieved.
This commit is contained in:
Barnabás Pőcze 2022-09-04 03:48:51 +02:00 committed by Wim Taymans
parent 9374c15c3d
commit 02f2d6b48d
2 changed files with 1 additions and 3 deletions

View file

@ -171,7 +171,6 @@ typedef struct impl {
void requestComplete(libcamera::Request *request);
unsigned int have_config;
std::unique_ptr<CameraConfiguration> config;
struct spa_source source = {};

View file

@ -69,13 +69,12 @@ int spa_libcamera_close(struct impl *impl)
static void spa_libcamera_get_config(struct impl *impl)
{
if (impl->have_config)
if (impl->config)
return;
StreamRoles roles;
roles.push_back(VideoRecording);
impl->config = impl->camera->generateConfiguration(roles);
impl->have_config = true;
}
static int spa_libcamera_buffer_recycle(struct impl *impl, struct port *port, uint32_t buffer_id)