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

◆ create_container()

std::shared_ptr< Kakshya::CameraContainer > MayaFlux::IO::CameraReader::create_container ( ) const

Create a CameraContainer sized to the negotiated device resolution.

Returns
Initialised container with slot-0 allocated, ready for pull_frame().

Definition at line 131 of file CameraReader.cpp.

132{
133 std::shared_lock lock(m_ctx_mutex);
134 if (!m_video->is_codec_valid()) {
135 m_last_error = "Cannot create container: reader not open";
136 return nullptr;
137 }
138
140 if (!fmt) {
141 m_last_error = "Requested pixel format has no ImageFormat equivalent";
142 return nullptr;
143 }
144
145 return std::make_shared<Kakshya::CameraContainer>(
146 m_video->out_width,
147 m_video->out_height,
148 *fmt,
149 m_video->frame_rate);
150}
int m_requested_pixel_format
Pixel format requested at open() time, as an AVPixelFormat int.
std::shared_mutex m_ctx_mutex
std::shared_ptr< VideoStreamContext > m_video
std::optional< Portal::Graphics::ImageFormat > to_image_format(int av_pixel_format)
Map an AVPixelFormat to the Portal ImageFormat backing it.

References m_ctx_mutex, m_last_error, m_requested_pixel_format, m_video, and MayaFlux::IO::to_image_format().

+ Here is the call graph for this function: