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

◆ mutable_slot_ptr()

uint8_t * MayaFlux::Kakshya::VideoStreamContainer::mutable_slot_ptr ( uint64_t  frame_index)

Mutable pointer into m_data[0] for the decode thread to write into.

Parameters
frame_indexAbsolute frame index; mapped to slot via modulo.
Returns
Pointer into the pixel vector, or nullptr if not in ring mode.

Definition at line 124 of file VideoStreamContainer.cpp.

125{
126 if (m_ring_capacity == 0 || frame_index >= m_total_source_frames)
127 return nullptr;
128
129 auto* pixels = std::get_if<std::vector<uint8_t>>(&m_data[0]);
130 if (!pixels)
131 return nullptr;
132
133 return pixels->data() + slot_for(frame_index) * get_frame_byte_size();
134}
uint32_t slot_for(uint64_t frame_index) const
size_t get_frame_byte_size() const
Get the total byte size of one frame (width * height * channels).

References get_frame_byte_size(), m_data, m_ring_capacity, m_total_source_frames, and slot_for().

Referenced by MayaFlux::IO::VideoFileReader::decode_batch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: