mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-15 00:19:44 +03:00
ipa: raspberrypi: Add line length to DeviceStatus
Add a lineLength field to the DeviceStatus structure to store the line length used for a particular frame. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
51ac3e2671
commit
dd667e3864
3 changed files with 6 additions and 1 deletions
|
@ -12,6 +12,7 @@ std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)
|
||||||
{
|
{
|
||||||
out << "Exposure: " << d.shutterSpeed
|
out << "Exposure: " << d.shutterSpeed
|
||||||
<< " Frame length: " << d.frameLength
|
<< " Frame length: " << d.frameLength
|
||||||
|
<< " Line length: " << d.lineLength
|
||||||
<< " Gain: " << d.analogueGain;
|
<< " Gain: " << d.analogueGain;
|
||||||
|
|
||||||
if (d.aperture)
|
if (d.aperture)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
struct DeviceStatus {
|
struct DeviceStatus {
|
||||||
DeviceStatus()
|
DeviceStatus()
|
||||||
: shutterSpeed(std::chrono::seconds(0)), frameLength(0),
|
: shutterSpeed(std::chrono::seconds(0)), frameLength(0),
|
||||||
analogueGain(0.0)
|
lineLength(std::chrono::seconds(0)), analogueGain(0.0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ struct DeviceStatus {
|
||||||
libcamera::utils::Duration shutterSpeed;
|
libcamera::utils::Duration shutterSpeed;
|
||||||
/* frame length given in number of lines */
|
/* frame length given in number of lines */
|
||||||
uint32_t frameLength;
|
uint32_t frameLength;
|
||||||
|
/* line length for the current frame */
|
||||||
|
libcamera::utils::Duration lineLength;
|
||||||
double analogueGain;
|
double analogueGain;
|
||||||
/* 1.0/distance-in-metres, or 0 if unknown */
|
/* 1.0/distance-in-metres, or 0 if unknown */
|
||||||
std::optional<double> lensPosition;
|
std::optional<double> lensPosition;
|
||||||
|
|
|
@ -1107,7 +1107,9 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls)
|
||||||
int32_t exposureLines = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();
|
int32_t exposureLines = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();
|
||||||
int32_t gainCode = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>();
|
int32_t gainCode = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>();
|
||||||
int32_t vblank = sensorControls.get(V4L2_CID_VBLANK).get<int32_t>();
|
int32_t vblank = sensorControls.get(V4L2_CID_VBLANK).get<int32_t>();
|
||||||
|
int32_t hblank = sensorControls.get(V4L2_CID_HBLANK).get<int32_t>();
|
||||||
|
|
||||||
|
deviceStatus.lineLength = helper_->hblankToLineLength(hblank);
|
||||||
deviceStatus.shutterSpeed = helper_->exposure(exposureLines, mode_.minLineLength);
|
deviceStatus.shutterSpeed = helper_->exposure(exposureLines, mode_.minLineLength);
|
||||||
deviceStatus.analogueGain = helper_->gain(gainCode);
|
deviceStatus.analogueGain = helper_->gain(gainCode);
|
||||||
deviceStatus.frameLength = mode_.height + vblank;
|
deviceStatus.frameLength = mode_.height + vblank;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue