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

◆ get_frames_impl()

void MayaFlux::Kakshya::VideoStreamContainer::get_frames_impl ( void *  output,
size_t  count,
uint64_t  start_frame,
uint64_t  num_frames,
const std::type_info &  type 
) const
overrideprotectedvirtual

Implementation-specific method to retrieve multiple frames.

Implementations write up to count * frame_size elements into output, starting from start_frame. The type parameter indicates the expected element type; implementations may choose to support or reject it based on their native data type, but must not write past the output buffer regardless.

Parameters
outputPointer to caller-owned buffer for frame data
countNumber of frames to retrieve (output buffer size in frames)
start_frameFirst frame index to retrieve
num_framesNumber of frames to retrieve
typeType information for the expected element type (e.g. float, uint8_t)

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 569 of file VideoStreamContainer.cpp.

572{
573 if (!output)
574 return;
575
576 const size_t element_size = storage_element_size(m_format);
577
578 if (type == typeid(uint8_t) && element_size == 1) {
579 get_frames_typed_as(std::span<uint8_t>(static_cast<uint8_t*>(output), count),
580 start_frame, num_frames);
581 return;
582 }
583 if (type == typeid(uint16_t) && element_size == 2) {
584 get_frames_typed_as(std::span<uint16_t>(static_cast<uint16_t*>(output), count),
585 start_frame, num_frames);
586 return;
587 }
588 if (type == typeid(float) && element_size == 4) {
589 get_frames_typed_as(std::span<float>(static_cast<float*>(output), count),
590 start_frame, num_frames);
591 return;
592 }
593
594 error<std::runtime_error>(
596 std::source_location::current(),
597 "VideoStreamContainer::get_frames_impl: requested type does not match storage");
598}
vk::PhysicalDeviceType type
Definition VKDevice.cpp:146
size_t count
std::shared_ptr< Core::VKImage > output
void get_frames_typed_as(std::span< T > output, uint64_t start_frame, uint64_t num_frames) const
@ Runtime
General runtime operations (default fallback)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
size_t storage_element_size(ImageFormat format)

References count, get_frames_typed_as(), MayaFlux::Journal::Kakshya, m_format, output, MayaFlux::Journal::Runtime, MayaFlux::Kakshya::storage_element_size(), and type.

+ Here is the call graph for this function: