|
MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
|
| bool MayaFlux::IO::VideoStreamContext::rebuild_scaler_from_frame | ( | const AVFrame * | frame, |
| uint32_t | target_width = 0, |
||
| uint32_t | target_height = 0, |
||
| int | target_format = -1 |
||
| ) |
Rebuild the SwsContext using the pixel format resolved from a live decoded frame.
dshow and similar capture devices on Windows leave pix_fmt as AV_PIX_FMT_NONE until the first decoded frame arrives. Call this once from the camera's frame-receive loop on the very first valid AVFrame to finalise the scaler before calling sws_scale.
| frame | The first successfully decoded AVFrame. |
| target_width | Desired output width (0 = keep frame width). |
| target_height | Desired output height (0 = keep frame height). |
| target_format | Desired AVPixelFormat (negative = AV_PIX_FMT_RGBA). |
Definition at line 347 of file VideoStreamContext.cpp.
References codec_context, height, m_last_error, setup_scaler(), src_pixel_format, sws_context, target_format, target_height, target_width, and width.
Here is the call graph for this function: