Debayer parameters and processing are currently run asynchronously. This can lead to assertion errors in case the processing tries to use not yet computed debayer parameters. To prevent this situation, specify some default values for DebayerParams members. This doesn't make correct parameters but prevents crashes or other crazy behaviours at least. Note this patch is just a workaround. The mutually asynchronous parameters computation and processing can cause more problems, like using parameters computed for a different frame. But it is non-trivial to fix that; in the meantime, setting the default values solves the worst problem. Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/311 Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
31 lines
628 B
C++
31 lines
628 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2023-2026 Red Hat Inc.
|
|
*
|
|
* Authors:
|
|
* Hans de Goede <hdegoede@redhat.com>
|
|
*
|
|
* DebayerParams header
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "libcamera/internal/matrix.h"
|
|
#include "libcamera/internal/vector.h"
|
|
|
|
namespace libcamera {
|
|
|
|
struct DebayerParams {
|
|
Matrix<float, 3, 3> combinedMatrix = { { 1.0, 0.0, 0.0,
|
|
0.0, 1.0, 0.0,
|
|
0.0, 0.0, 1.0 } };
|
|
RGB<float> blackLevel = RGB<float>({ 0.0, 0.0, 0.0 });
|
|
float gamma = 1.0;
|
|
float contrastExp = 1.0;
|
|
RGB<float> gains = RGB<float>({ 1.0, 1.0, 1.0 });
|
|
};
|
|
|
|
} /* namespace libcamera */
|