MayaFlux 0.2.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 29 of file CameraContainer.cpp.

30{
31 if (m_data.empty())
32 return nullptr;
33
34 auto* pixels = std::get_if<std::vector<uint8_t>>(&m_data[0]);
35 if (!pixels || pixels->empty())
36 return nullptr;
37
38 return pixels->data();
39}

References MayaFlux::Kakshya::VideoStreamContainer::m_data.