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

◆ claim_frame_slot()

uint8_t * MayaFlux::Kakshya::DynamicVideoStream::claim_frame_slot ( )
private

Definition at line 46 of file DynamicVideoStream.cpp.

47{
48 const size_t frame_bytes = get_frame_byte_size();
49
50 if (frame_bytes == 0) {
51 return nullptr;
52 }
53
54 if (is_ring_mode()) {
56 }
57
58 Memory::SeqlockWriteGuard guard(m_data_lock);
59
60 auto& bytes = flat_bytes();
61 const size_t needed = (m_write_head + 1) * frame_bytes;
62 if (bytes.size() < needed) {
63 bytes.resize(needed);
64 }
65
66 return bytes.data() + m_write_head * frame_bytes;
67}
uint8_t * mutable_slot_ptr(uint64_t frame_index)
Mutable pointer into m_data[0] for the decode thread to write into.
bool is_ring_mode() const
True if the container is operating in ring mode.
size_t get_frame_byte_size() const
Total byte size of one frame: width * height * bytes_per_pixel.

References flat_bytes(), MayaFlux::Kakshya::VideoStreamContainer::get_frame_byte_size(), MayaFlux::Kakshya::VideoStreamContainer::is_ring_mode(), MayaFlux::Kakshya::VideoStreamContainer::m_data_lock, m_write_head, and MayaFlux::Kakshya::VideoStreamContainer::mutable_slot_ptr().

Referenced by append_frame(), and append_frame().

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