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

◆ append_frame() [2/3]

bool MayaFlux::Kakshya::DynamicVideoStream::append_frame ( const std::shared_ptr< Core::VKImage > &  image,
const std::shared_ptr< Buffers::VKBuffer > &  staging = nullptr 
)

Download a GPU image straight into the next frame slot.

Blocking, like TextureContainer::from_image. The image must match the stream's width, height and format. Pass a persistent staging buffer (Buffers::create_image_staging_buffer(get_frame_byte_size())) to avoid a per-call Vulkan allocation.

Parameters
imageInitialised source image.
stagingOptional host-visible staging buffer.
Returns
True if the frame was stored.

Definition at line 99 of file DynamicVideoStream.cpp.

101{
102 if (!image || !image->is_initialized()) {
104 "DynamicVideoStream::append_frame called with an uninitialised image");
105 return false;
106 }
107
108 uint8_t* slot = claim_frame_slot();
109 if (!slot) {
110 return false;
111 }
112
114 finish_frame();
115 return true;
116}
#define MF_ERROR(comp, ctx,...)
IO::ImageData image
Definition Decoder.cpp:47
size_t get_frame_byte_size() const
Total byte size of one frame: width * height * bytes_per_pixel.
void download_data(const std::shared_ptr< Core::VKImage > &image, void *data, size_t size, const std::shared_ptr< Buffers::VKBuffer > &staging, bool deferred=false, vk::ImageLayout restore_layout=vk::ImageLayout::eShaderReadOnlyOptimal, vk::PipelineStageFlags restore_stage=vk::PipelineStageFlagBits::eFragmentShader)
Download pixel data from a VKImage, reusing a caller-supplied persistent staging buffer.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References claim_frame_slot(), MayaFlux::Journal::ContainerProcessing, MayaFlux::Portal::Graphics::TextureLoom::download_data(), finish_frame(), MayaFlux::Kakshya::VideoStreamContainer::get_frame_byte_size(), image, MayaFlux::Portal::Graphics::TextureLoom::instance(), MayaFlux::Journal::Kakshya, and MF_ERROR.

+ Here is the call graph for this function: