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

◆ append_frame() [3/3]

bool MayaFlux::Kakshya::DynamicVideoStream::append_frame ( std::span< const uint8_t >  pixels)

Write one frame at the write head and advance it.

Parameters
pixelsExactly get_frame_byte_size() bytes.
Returns
True if the frame was stored.

Definition at line 79 of file DynamicVideoStream.cpp.

80{
81 const size_t frame_bytes = get_frame_byte_size();
82
83 if (frame_bytes == 0 || pixels.size() != frame_bytes) {
85 "DynamicVideoStream::append_frame expected {} bytes, got {}", frame_bytes, pixels.size());
86 return false;
87 }
88
89 uint8_t* slot = claim_frame_slot();
90 if (!slot) {
91 return false;
92 }
93
94 std::memcpy(slot, pixels.data(), frame_bytes);
96 return true;
97}
#define MF_WARN(comp, ctx,...)
const std::vector< float > * pixels
Definition Decoder.cpp:48
size_t get_frame_byte_size() const
Total byte size of one frame: width * height * bytes_per_pixel.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References claim_frame_slot(), MayaFlux::Journal::ContainerProcessing, finish_frame(), MayaFlux::Kakshya::VideoStreamContainer::get_frame_byte_size(), MayaFlux::Journal::Kakshya, MF_WARN, and pixels.

Referenced by append_frame().

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