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{
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>(
227 *fmt,
229}
std::shared_ptr< VideoStreamContext > m_video
int m_requested_pixel_format
Pixel format requested at open() time, as an AVPixelFormat int.
std::shared_mutex m_ctx_mutex
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().