MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ mutable_frame_ptr()

uint8_t * MayaFlux::Kakshya::CameraContainer::mutable_frame_ptr ( )

Mutable pointer into m_data[0] for the caller to write decoded pixels.

Mirrors VideoStreamContainer::mutable_slot_ptr() for ring mode, but operates on the single flat-mode frame. The caller (CameraReader) writes width * height * channels bytes at this address, then calls mark_ready_for_processing(true).

Returns
Pointer to the start of the frame pixel buffer, or nullptr if the container is not properly initialised.

Definition at line 27 of file CameraContainer.cpp.

28{
29 if (m_data.empty())
30 return nullptr;
31
32 auto [ptr, bytes] = variant_bytes_mutable(m_data[0]);
33 if (!ptr || bytes < get_frame_byte_size())
34 return nullptr;
35
36 return ptr;
37}
const uint8_t * ptr
size_t get_frame_byte_size() const
Total byte size of one frame: width * height * bytes_per_pixel.
std::pair< uint8_t *, size_t > variant_bytes_mutable(DataVariant &v)
Get a mutable pointer to the raw bytes of a DataVariant and its size.

References MayaFlux::Kakshya::VideoStreamContainer::get_frame_byte_size(), MayaFlux::Kakshya::VideoStreamContainer::m_data, ptr, and MayaFlux::Kakshya::variant_bytes_mutable().

+ Here is the call graph for this function: