Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
imx500::Camera::Impl Struct Reference

Capture resources and the callback-to-owner handoff, not model results. More...

Public Member Functions

 ~Impl ()
 Unwind partial/full startup in libcamera's resource-lifetime order.
void recycle (libcamera::Request *request)
 Return an unneeded or fully consumed request to the bounded camera queue.
void complete (libcamera::Request *request)
 Hold one fresh requested exposure; immediately recycle other callbacks.

Static Public Member Functions

static void release_lease (void *owner) noexcept
 Recycle the sole leased request without throwing through its destructor.
static void configure_model (const char *model)
 Load an RPK or clear a retained network through the driver control.

Data Fields

libcamera::CameraManager manager
std::shared_ptr< libcamera::Camera > camera
std::unique_ptr< libcamera::CameraConfiguration > configuration
std::unique_ptr< libcamera::FrameBufferAllocator > allocator
std::vector< std::unique_ptr< libcamera::Request > > requests
std::array< int64_t, 2 > frame_duration {camera_frame_duration_us, camera_frame_duration_us}
std::mutex mutex
std::condition_variable ready
libcamera::Request * completed = nullptr
libcamera::Request * leased = nullptr
int64_t minimum_timestamp = 0
bool wanted = false
bool failed = false
bool acquired = false
bool started = false

Detailed Description

Capture resources and the callback-to-owner handoff, not model results.

The mutex protects callback-visible readiness state. Control calls and lease release remain serialized by the owner, as required by the public API.

Definition at line 370 of file imx500_camera.cpp.

Constructor & Destructor Documentation

◆ ~Impl()

imx500::Camera::Impl::~Impl ( )
inline

Unwind partial/full startup in libcamera's resource-lifetime order.

Definition at line 388 of file imx500_camera.cpp.

Member Function Documentation

◆ complete()

void imx500::Camera::Impl::complete ( libcamera::Request * request)
inline

Hold one fresh requested exposure; immediately recycle other callbacks.

Parameters
requestCompleted or cancelled libcamera request.

The timestamp gate is set when capture() starts. A previously queued frame is not automatically the photograph requested by the current SHOT.

Definition at line 441 of file imx500_camera.cpp.

◆ configure_model()

void imx500::Camera::Impl::configure_model ( const char * model)
inlinestatic

Load an RPK or clear a retained network through the driver control.

Parameters
modelAccessible readable model path, or NULL to select image-only capture.
Exceptions
std::runtime_errorfor ambiguous/missing devices or failed controls.

The driver's INT32_MAX control value clears a retained volatile network. Full-array inference ROI is set only when loading a model.

Definition at line 481 of file imx500_camera.cpp.

◆ recycle()

void imx500::Camera::Impl::recycle ( libcamera::Request * request)
inline

Return an unneeded or fully consumed request to the bounded camera queue.

Parameters
requestCompleted request with no remaining borrowed consumers.

A requeue failure wakes the owner as a failure; it must not wait for a callback that can no longer arrive or silently reuse stale evidence.

Definition at line 409 of file imx500_camera.cpp.

◆ release_lease()

void imx500::Camera::Impl::release_lease ( void * owner)
inlinestaticnoexcept

Recycle the sole leased request without throwing through its destructor.

Parameters
ownerCapture implementation that outlives the lease.

Clear ownership before requeueing. Unexpected exceptions cannot be hidden as a successful release, so this nonthrowing boundary terminates.

Definition at line 423 of file imx500_camera.cpp.

Field Documentation

◆ acquired

bool imx500::Camera::Impl::acquired = false

Cleanup owes camera release only after acquisition succeeds.

Definition at line 384 of file imx500_camera.cpp.

◆ allocator

std::unique_ptr<libcamera::FrameBufferAllocator> imx500::Camera::Impl::allocator

Owns CMA-backed buffers, not CPU copies.

Definition at line 374 of file imx500_camera.cpp.

◆ camera

std::shared_ptr<libcamera::Camera> imx500::Camera::Impl::camera

The sole selected sensor, acquired exclusively.

Definition at line 372 of file imx500_camera.cpp.

◆ completed

libcamera::Request* imx500::Camera::Impl::completed = nullptr

Callback-held request awaiting owner handoff.

Definition at line 379 of file imx500_camera.cpp.

◆ configuration

std::unique_ptr<libcamera::CameraConfiguration> imx500::Camera::Impl::configuration

Validated stream geometry/layout.

Definition at line 373 of file imx500_camera.cpp.

◆ failed

bool imx500::Camera::Impl::failed = false

Queue failure prevents treating capture as healthy.

Definition at line 383 of file imx500_camera.cpp.

◆ frame_duration

std::array<int64_t, 2> imx500::Camera::Impl::frame_duration {camera_frame_duration_us, camera_frame_duration_us}

Fixed cadence range.

Definition at line 376 of file imx500_camera.cpp.

◆ leased

libcamera::Request* imx500::Camera::Impl::leased = nullptr

Request held until its sole lease releases it.

Definition at line 380 of file imx500_camera.cpp.

◆ manager

libcamera::CameraManager imx500::Camera::Impl::manager

Owns camera discovery/event processing.

Definition at line 371 of file imx500_camera.cpp.

◆ minimum_timestamp

int64_t imx500::Camera::Impl::minimum_timestamp = 0

Earliest eligible sensor timestamp for the current request.

Definition at line 381 of file imx500_camera.cpp.

◆ mutex

std::mutex imx500::Camera::Impl::mutex

Protects callback readiness, failure and waiting-request state.

Definition at line 377 of file imx500_camera.cpp.

◆ ready

std::condition_variable imx500::Camera::Impl::ready

Wakes a waiter for a fresh frame or queue failure.

Definition at line 378 of file imx500_camera.cpp.

◆ requests

std::vector<std::unique_ptr<libcamera::Request> > imx500::Camera::Impl::requests

One reusable request per allocated buffer.

Definition at line 375 of file imx500_camera.cpp.

◆ started

bool imx500::Camera::Impl::started = false

Cleanup owes stream stop only after startup succeeds.

Definition at line 385 of file imx500_camera.cpp.

◆ wanted

bool imx500::Camera::Impl::wanted = false

A capture call is awaiting one post-request exposure.

Definition at line 382 of file imx500_camera.cpp.


The documentation for this struct was generated from the following file: