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

◆ create_container()

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

Create a CameraContainer sized to the negotiated device resolution.

Returns
Initialised container, ready for pull_frame().

Implements MayaFlux::IO::CameraSource.

Definition at line 210 of file FFmpegCameraReader.cpp.

211{
212 std::shared_lock lock(m_ctx_mutex);
213 if (!m_video->is_codec_valid()) {
214 m_last_error = "Cannot create container: reader not open";
215 return nullptr;
216 }
217
219 if (!fmt) {
220 m_last_error = "Requested pixel format has no ImageFormat equivalent";
221 return nullptr;
222 }
223
224 return std::make_shared<Kakshya::CameraContainer>(
225 m_video->out_width,
226 m_video->out_height,
227 *fmt,
228 m_video->frame_rate);
229}
std::shared_ptr< VideoStreamContext > m_video
int m_requested_pixel_format
Pixel format requested at open() time, as an AVPixelFormat int.
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: