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

◆ extract_frame_data()

void MayaFlux::Buffers::VideoStreamReader::extract_frame_data ( const std::shared_ptr< TextureBuffer > &  texture_buffer)
private

Extract frame pixel data from processed_data into the TextureBuffer.

Parameters
texture_bufferThe TextureBuffer to write into.

Definition at line 128 of file VideoContainerBuffer.cpp.

129{
130 if (!m_container) {
131 return;
132 }
133
134 auto& processed_data = m_container->get_processed_data();
135 if (processed_data.empty()) {
136 return;
137 }
138
139 const auto* pixel_vec = std::get_if<std::vector<uint8_t>>(&processed_data[0]);
140 if (!pixel_vec || pixel_vec->empty()) {
141 return;
142 }
143
144 uint64_t expected_size = static_cast<uint64_t>(texture_buffer->get_width())
145 * texture_buffer->get_height() * 4;
146
147 size_t copy_size = std::min(pixel_vec->size(), static_cast<size_t>(expected_size));
148
149 texture_buffer->set_pixel_data(pixel_vec->data(), copy_size);
150}
std::shared_ptr< Kakshya::StreamContainer > m_container

References m_container.

Referenced by on_attach(), and processing_function().

+ Here is the caller graph for this function: