11 uint32_t channels,
double frame_rate)
19 auto& pixels =
m_data[0].emplace<std::vector<uint8_t>>();
20 pixels.resize(frame_bytes, 0);
25 "CameraContainer created: {}x{} @{:.1f}fps ({} bytes/frame)",
26 width, height, frame_rate, frame_bytes);
34 auto* pixels = std::get_if<std::vector<uint8_t>>(&
m_data[0]);
35 if (!pixels || pixels->empty())
38 return pixels->data();
48 "CameraContainer: wired IOService with reader_id={}", reader_id);
53 auto processor = std::make_shared<FrameAccessProcessor>();
54 processor->set_auto_advance(
false);
#define MF_INFO(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
void create_default_processor() override
Create FrameAccessProcessor with auto_advance disabled.
uint8_t * mutable_frame_ptr()
Mutable pointer into m_data[0] for the caller to write decoded pixels.
void process_default() override
Override to fire request_frame after each processor cycle.
CameraContainer(uint32_t width, uint32_t height, uint32_t channels=4, double frame_rate=30.0)
Construct a CameraContainer with specified resolution.
Registry::Service::IOService * m_io_service
void setup_io(uint64_t reader_id)
Wire the CameraIOService callback for demand-driven frame pulls.
std::vector< DataVariant > m_data
void set_default_processor(const std::shared_ptr< DataProcessor > &processor) override
Set the default data processor for this container.
size_t get_frame_byte_size() const
Get the total byte size of one frame (width * height * channels).
void process_default() override
Process the container's data using the default processor.
Concrete base implementation for streaming video containers.
Interface * get_service()
Query for a backend service.
static BackendRegistry & instance()
Get the global registry instance.
@ Init
Engine/subsystem initialization.
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
std::function< void(uint64_t reader_id)> request_frame
Request the identified camera reader to pull the next frame.
Backend IO streaming service interface.