Loading...
Searching...
No Matches
imx500_camera.hpp
Go to the documentation of this file.
82 uint64_t sequence = 0; /**< Camera request sequence; deliberately distinct from an FC shot number. */
83 uint64_t sensor_timestamp_ns = 0; /**< Sensor timestamp in its camera clock domain; zero when absent. */
89 bool crop_valid = false; /**< Distinguishes a reported crop from zero-initialized placeholder geometry. */
110 const char *sidecar_suffix; /**< Trusted application-owned suffix with a lifetime covering the call. */
111 bool (*validate)(const FrameView &frame); /**< Qualify model-specific readiness without retaining borrowed data. */
169 /** @brief Acquire one eligible camera and configure bounded capture, uploading an RPK only when requested.
198 * @param visitor Callback consuming validated YUV420 planes and stride before mappings are released.
202 * @details Prepare a model-sized tensor here, then release the lease before expensive inference. */
Camera & operator=(const Camera &)=delete
Assignment cannot replace an acquired sensor owner.
bool with_pixels(const FrameLease &frame, bool(*visitor)(const FrameView &, const std::array< const uint8_t *, 3 > &, unsigned, void *), void *context)
Grant scoped CPU pixel access without transferring DMA/frame ownership.
Definition imx500_camera.cpp:785
bool save(const FrameLease &frame, const char *filename, const FrameProcessor &processor)
Map a leased frame and publish its JPEG plus available evidence.
Definition imx500_camera.cpp:771
~Camera()
Stop streaming before freeing requests/buffers and releasing the camera.
Camera()
Construct unopened camera state; construction does not acquire the sensor.
Definition imx500_camera.cpp:539
FrameLease capture()
Lease a fresh post-request exposure and its own tensor metadata.
Definition imx500_camera.cpp:642
Exactly-once release of a borrowed frame, including exception exits.
Definition imx500_camera.hpp:119
FrameLease(const FrameLease &)=delete
Copies are forbidden because two destructors cannot own one request.
FrameLease(FrameView view, void *owner, Release release) noexcept
Associate borrowed evidence with exactly one release operation.
Definition imx500_camera.cpp:238
void(*)(void *) noexcept Release
Nonthrowing release callback; a destructor must never unwind through it.
Definition imx500_camera.hpp:122
FrameLease & operator=(FrameLease &&)=delete
Assignment is disabled; move construction is the supported transfer.
~FrameLease()
Release once on every scope exit, including a processing exception.
Definition imx500_camera.cpp:244
const FrameView & view() const noexcept
Read evidence only while this unmoved lease remains alive.
Definition imx500_camera.hpp:145
FrameLease & operator=(const FrameLease &)=delete
Copy assignment cannot duplicate capture ownership.
Bounded C11 EXIF metadata and JPEG streaming interfaces.
Definition imx500_camera.hpp:35
constexpr FrameStatus frame_status(libcamera::FrameMetadata::Status status)
Map libcamera metadata to this worker's frame disposition.
Definition imx500_camera.hpp:42
bool photo_only_frame(const FrameView &frame)
Confirm that a frame carries no neural output.
Definition imx500_camera.hpp:98
Definition imx500_camera.cpp:54
bool encode_jpeg(const char *path, const std::array< const uint8_t *, 3 > &planes, unsigned width, unsigned height, unsigned stride)
Encode validated YUV420 planes directly, without full-frame RGB staging.
Definition imx500_camera.cpp:359
int run_worker(int argc, char **argv, const FrameProcessor &processor, const char *application)
Run the shared probe/capture/READY-SHOT-OK worker with supplied model policy.
Definition imx500_camera.cpp:817
constexpr bool valid_capture_dimensions(unsigned width, unsigned height)
Check that capture dimensions meet the worker's raster policy.
Definition imx500_camera.hpp:68
bool publish_frame(const FrameView &view, const std::array< const uint8_t *, 3 > &planes, unsigned stride, const char *filename, const FrameProcessor &processor)
Publish caller-validated YUV420 planes and same-exposure evidence.
Definition imx500_camera.cpp:712
int run_photo_worker(int argc, char **argv, const char *application)
Run photo-only probe, capture or serve without model loading or inference.
Definition imx500_camera.cpp:931
constexpr unsigned sensor_height
Physical IMX500 array height; model input dimensions are separate policy.
Definition imx500_camera.hpp:60
constexpr unsigned sensor_width
Physical IMX500 array width, used to reject an unexpected sensor geometry.
Definition imx500_camera.hpp:58
Capture resources and the callback-to-owner handoff, not model results.
Definition imx500_camera.cpp:370
Stack-owned model-specific operations; no dynamic plugin allocation.
Definition imx500_camera.hpp:109
bool(* validate)(const FrameView &frame)
Definition imx500_camera.hpp:111
bool(* embed)(const FrameView &frame, exif_document *document)
Definition imx500_camera.hpp:113
bool(* write)(const FrameView &frame, const char *filename)
Definition imx500_camera.hpp:112
Borrowed same-exposure evidence, without object or navigation semantics.
Definition imx500_camera.hpp:77