MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Buffers::VideoStreamReader Class Reference

Adapter bridging VideoStreamContainer processed data to TextureBuffer pixel storage. More...

#include <VideoContainerBuffer.hpp>

+ Inheritance diagram for MayaFlux::Buffers::VideoStreamReader:
+ Collaboration diagram for MayaFlux::Buffers::VideoStreamReader:

Public Member Functions

 VideoStreamReader (const std::shared_ptr< Kakshya::StreamContainer > &container)
 Construct a VideoStreamReader for the given container.
 
void processing_function (const std::shared_ptr< Buffer > &buffer) override
 Extract the current frame from the container into the TextureBuffer.
 
void on_attach (const std::shared_ptr< Buffer > &buffer) override
 Attach the reader to a TextureBuffer.
 
void on_detach (const std::shared_ptr< Buffer > &buffer) override
 Detach the reader from its TextureBuffer.
 
void set_container (const std::shared_ptr< Kakshya::StreamContainer > &container)
 Replace the backing container.
 
std::shared_ptr< Kakshya::StreamContainerget_container () const
 Get the backing container.
 
void set_update_flags (bool update)
 Enable or disable automatic buffer state flag updates.
 
bool get_update_flags () const
 Get the current state flag update setting.
 
- Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor
virtual ~BufferProcessor ()=default
 Virtual destructor for proper cleanup of derived classes.
 
void process (const std::shared_ptr< Buffer > &buffer)
 Applies a computational transformation to the data in the provided buffer.
 
virtual void set_processing_token (ProcessingToken token)
 Gets the preferred processing backend for this processor.
 
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 
virtual bool is_compatible_with (const std::shared_ptr< Buffer > &) const
 Checks if this processor can handle the specified buffer type.
 

Private Member Functions

void extract_frame_data (const std::shared_ptr< TextureBuffer > &texture_buffer)
 Extract frame pixel data from processed_data into the TextureBuffer.
 
void on_container_state_change (const std::shared_ptr< Kakshya::SignalSourceContainer > &container, Kakshya::ProcessingState state)
 Respond to container state changes.
 

Private Attributes

std::shared_ptr< Kakshya::StreamContainerm_container
 
uint32_t m_reader_id {}
 
bool m_update_flags { true }
 

Additional Inherited Members

- Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor
ProcessingToken m_processing_token { ProcessingToken::AUDIO_BACKEND }
 

Detailed Description

Adapter bridging VideoStreamContainer processed data to TextureBuffer pixel storage.

VideoStreamReader is the video counterpart of SoundStreamReader. Where SoundStreamReader extracts per-channel audio samples from a container's processed_data into an AudioBuffer, VideoStreamReader extracts full-frame RGBA pixel data from a container's processed_data into a TextureBuffer's pixel storage, marking it dirty for GPU upload.

The pipeline mirrors audio exactly:

VideoStreamContainer → FrameAccessProcessor (extracts frame into processed_data) → VideoStreamReader (copies processed_data into TextureBuffer pixels) → TextureProcessor (uploads dirty pixels to GPU VKImage) → RenderProcessor (draws textured quad)

VideoStreamReader triggers the container's default processor (FrameAccessProcessor) if the container is in READY state, then copies the resulting uint8_t RGBA data into the TextureBuffer via set_pixel_data(). This marks the texture dirty, causing TextureProcessor to re-upload on the next frame.

Unlike SoundStreamReader, there is no channel selection — video frames are atomic spatial units. The reader always extracts the entire frame surface.

See also
SoundStreamReader, FrameAccessProcessor, TextureBuffer, VideoStreamContainer

Definition at line 37 of file VideoContainerBuffer.hpp.


The documentation for this class was generated from the following files: