Home
AV module

VideoConverter

Converts video frames between pixel formats and resolutions.

VideoConverter

#include <icy/av/videoconverter.h>
struct VideoConverter

Defined in src/av/include/icy/av/videoconverter.h:32

Converts video frames between pixel formats and resolutions.

List of all members

NameKindOwner
ctxvariableDeclared here
oframevariableDeclared here
iparamsvariableDeclared here
oparamsvariableDeclared here
VideoConverterfunctionDeclared here
~VideoConverterfunctionDeclared here
VideoConverterfunctionDeclared here
operator=functionDeclared here
VideoConverterfunctionDeclared here
operator=functionDeclared here
createfunctionDeclared here
closefunctionDeclared here
convertfunctionDeclared here

Public Attributes

ReturnNameDescription
SwsContext *ctxlibswscale conversion context.
AVFrame *oframeReusable output frame allocated by create().
VideoCodeciparamsExpected input video parameters.
VideoCodecoparamsTarget output video parameters.

ctx

SwsContext * ctx

Defined in src/av/include/icy/av/videoconverter.h:56

libswscale conversion context.


oframe

AVFrame * oframe

Defined in src/av/include/icy/av/videoconverter.h:57

Reusable output frame allocated by create().


iparams

VideoCodec iparams

Defined in src/av/include/icy/av/videoconverter.h:58

Expected input video parameters.


oparams

VideoCodec oparams

Defined in src/av/include/icy/av/videoconverter.h:59

Target output video parameters.

Public Methods

ReturnNameDescription
VideoConverter
VideoConverterDeleted constructor.
VideoConverterDeleted constructor.
voidcreate virtualInitialise the libswscale context and allocate the output frame. Uses iparams and oparams to configure the conversion pipeline. Throws std::runtime_error if already initialised or if parameters are invalid.
voidclose virtualFree the libswscale context and the output frame.
AVFrame *convert virtualConvert iframe to the output pixel format and resolution. The returned frame is owned by this converter and is overwritten on the next call.

VideoConverter

VideoConverter()

Defined in src/av/include/icy/av/videoconverter.h:34


VideoConverter

VideoConverter(const VideoConverter &) = delete

Defined in src/av/include/icy/av/videoconverter.h:37

Deleted constructor.


VideoConverter

VideoConverter(VideoConverter &&) = delete

Defined in src/av/include/icy/av/videoconverter.h:39

Deleted constructor.


create

virtual

virtual void create()

Defined in src/av/include/icy/av/videoconverter.h:45

Initialise the libswscale context and allocate the output frame. Uses iparams and oparams to configure the conversion pipeline. Throws std::runtime_error if already initialised or if parameters are invalid.


close

virtual

virtual void close()

Defined in src/av/include/icy/av/videoconverter.h:48

Free the libswscale context and the output frame.


convert

virtual

virtual AVFrame * convert(AVFrame * iframe)

Defined in src/av/include/icy/av/videoconverter.h:54

Convert iframe to the output pixel format and resolution. The returned frame is owned by this converter and is overwritten on the next call.

Parameters

  • iframe The source AVFrame; must match iparams dimensions and pixel format.

Returns

The converted output AVFrame.