Converts video frames between sizes and pixel formats.
More...
#include <videorescaler.h>
|
| | VideoRescaler () |
| | Create an uninitialised scaler.
|
| | VideoRescaler (int dstWidth, int dstHeight, PixelFormat dstPixelFormat, int srcWidth, int srcHeight, PixelFormat srcPixelFormat, int32_t flags=SwsFlagAuto) |
| | Create a scaler with explicit source and destination.
|
| | VideoRescaler (int m_dstWidth, int m_dstHeight, PixelFormat m_dstPixelFormat, int32_t flags=SwsFlagAuto) |
| | Create a scaler that keeps the input geometry and only converts formats.
|
| | VideoRescaler (const VideoRescaler &other) |
| | Copy the scaler configuration.
|
| | VideoRescaler (VideoRescaler &&other) |
| | Move the scaler.
|
| VideoRescaler & | operator= (const VideoRescaler &rhs) |
| | Copy assignment: replaces the configuration and the libswscale context.
|
| VideoRescaler & | operator= (VideoRescaler &&rhs) |
| | Move assignment.
|
| int | dstWidth () const |
| | Output width.
|
| int | dstHeight () const |
| | Output height.
|
| PixelFormat | dstPixelFormat () |
| | Output pixel format.
|
| int | srcWidth () const |
| | Input width.
|
| int | srcHeight () const |
| | Input height.
|
| PixelFormat | srcPixelFormat () |
| | Input pixel format.
|
| int32_t | flags () const |
| | Scaling options in use.
|
| void | rescale (VideoFrame &dst, const VideoFrame &src, OptionalErrorCode ec=throws()) |
| | Scale into an existing frame.
|
| VideoFrame | rescale (const VideoFrame &src, OptionalErrorCode ec=throws()) |
| | Scale into a newly allocated frame.
|
| bool | isValid () const |
| | Whether the scaler has a libswscale context.
|
|
| FFWrapperPtr ()=default |
| | Create an empty wrapper; isNull() is true.
|
| const SwsContext * | raw () const |
| | Read access to the wrapped object.
|
| void | reset (SwsContext *raw=nullptr) |
| | Replace the stored pointer.
|
| bool | isNull () const |
| | Whether the wrapper is empty.
|
| void | _log (int level, const char *fmt) const |
| | Log through the FFmpeg log system, using this wrapper as the context.
|
|
|
| noncopyable (const noncopyable &)=delete |
|
void | operator= (const noncopyable &)=delete |
|
SwsContext * | m_raw |
| | The wrapped pointer; owned by the derived class, not by this template.
|
The scaler works on system memory only: a hardware frame must be transferred with VideoFrame::toSystemMemory() first and uploaded back afterwards. Both the source and the destination geometry are fixed at construction, because libswscale allocates its tables for one conversion.
- Examples
- api2-scale-video.cpp.
◆ VideoRescaler() [1/5]
| av::VideoRescaler::VideoRescaler |
( |
| ) |
|
Configure it with rescale() by passing frames of the target geometry, or construct it with explicit sizes.
◆ VideoRescaler() [2/5]
| av::VideoRescaler::VideoRescaler |
( |
int | dstWidth, |
|
|
int | dstHeight, |
|
|
PixelFormat | dstPixelFormat, |
|
|
int | srcWidth, |
|
|
int | srcHeight, |
|
|
PixelFormat | srcPixelFormat, |
|
|
int32_t | flags = SwsFlagAuto ) |
- Parameters
-
| dstWidth | output width in pixels |
| dstHeight | output height in pixels |
| dstPixelFormat | output pixel format |
| srcWidth | input width in pixels |
| srcHeight | input height in pixels |
| srcPixelFormat | input pixel format |
| flags | a combination of SwsFlags |
◆ VideoRescaler() [3/5]
| av::VideoRescaler::VideoRescaler |
( |
int | m_dstWidth, |
|
|
int | m_dstHeight, |
|
|
PixelFormat | m_dstPixelFormat, |
|
|
int32_t | flags = SwsFlagAuto ) |
- Parameters
-
| m_dstWidth | output width in pixels |
| m_dstHeight | output height in pixels |
| m_dstPixelFormat | output pixel format |
| flags | a combination of SwsFlags |
◆ VideoRescaler() [4/5]
| av::VideoRescaler::VideoRescaler |
( |
const VideoRescaler & | other | ) |
|
◆ VideoRescaler() [5/5]
| av::VideoRescaler::VideoRescaler |
( |
VideoRescaler && | other | ) |
|
- Parameters
-
| other | the scaler to move from; left uninitialised |
◆ dstHeight()
| int av::VideoRescaler::dstHeight |
( |
| ) |
const |
|
inline |
- Returns
- the height in pixels, or -1 when it is not configured
◆ dstPixelFormat()
- Returns
- the format, or AV_PIX_FMT_NONE when it is not configured
◆ dstWidth()
| int av::VideoRescaler::dstWidth |
( |
| ) |
const |
|
inline |
- Returns
- the width in pixels, or -1 when it is not configured
◆ flags()
| int32_t av::VideoRescaler::flags |
( |
| ) |
const |
|
inline |
◆ isValid()
| bool av::VideoRescaler::isValid |
( |
| ) |
const |
◆ operator=() [1/2]
- Parameters
-
| rhs | the scaler to copy from |
- Returns
- this scaler
◆ operator=() [2/2]
- Parameters
-
| rhs | the scaler to move from; left uninitialised |
- Returns
- this scaler
◆ rescale() [1/2]
- Parameters
-
| src | source frame in system memory |
| ec | holder for the error code |
- Returns
- the scaled frame, or an invalid frame on failure
◆ rescale() [2/2]
- Parameters
-
| dst | destination frame; it must be allocated with the output geometry and format |
| src | source frame in system memory |
| ec | holder for the error code |
- Examples
- api2-scale-video.cpp.
◆ srcHeight()
| int av::VideoRescaler::srcHeight |
( |
| ) |
const |
|
inline |
- Returns
- the height in pixels, or -1 when it is not configured
◆ srcPixelFormat()
- Returns
- the format, or AV_PIX_FMT_NONE when it is not configured
◆ srcWidth()
| int av::VideoRescaler::srcWidth |
( |
| ) |
const |
|
inline |
- Returns
- the width in pixels, or -1 when it is not configured
The documentation for this class was generated from the following file: