VideoContext
VideoContext
#include <icy/av/videocontext.h>struct VideoContextDefined in src/av/include/icy/av/videocontext.h:42
Subclassed by:
VideoDecoder,VideoEncoder
Base video context from which all video encoders and decoders derive.
List of all members
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
iparams | variable | Declared here |
oparams | variable | Declared here |
stream | variable | Declared here |
ctx | variable | Declared here |
codec | variable | Declared here |
frame | variable | Declared here |
conv | variable | Declared here |
time | variable | Declared here |
pts | variable | Declared here |
seconds | variable | Declared here |
error | variable | Declared here |
VideoContext | function | Declared here |
~VideoContext | function | Declared here |
VideoContext | function | Declared here |
operator= | function | Declared here |
VideoContext | function | Declared here |
operator= | function | Declared here |
create | function | Declared here |
open | function | Declared here |
close | function | Declared here |
decode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
flush | function | Declared here |
convert | function | Declared here |
recreateConverter | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter | |
VideoCodec | iparams | input parameters |
VideoCodec | oparams | output parameters |
AVStream * | stream | encoder or decoder stream |
AVCodecContext * | ctx | encoder or decoder context |
const AVCodec * | codec | encoder or decoder codec |
AVFrame * | frame | encoder or decoder frame |
std::unique_ptr< VideoConverter > | conv | video conversion context |
int64_t | time | stream time in codec time base |
int64_t | pts | last packet pts value |
double | seconds | video time in seconds |
std::string | error | error message |
emitter
PacketSignal emitterDefined in src/av/include/icy/av/videocontext.h:103
iparams
VideoCodec iparamsDefined in src/av/include/icy/av/videocontext.h:105
input parameters
oparams
VideoCodec oparamsDefined in src/av/include/icy/av/videocontext.h:106
output parameters
stream
AVStream * streamDefined in src/av/include/icy/av/videocontext.h:107
encoder or decoder stream
ctx
AVCodecContext * ctxDefined in src/av/include/icy/av/videocontext.h:108
encoder or decoder context
codec
const AVCodec * codecDefined in src/av/include/icy/av/videocontext.h:109
encoder or decoder codec
frame
AVFrame * frameDefined in src/av/include/icy/av/videocontext.h:110
encoder or decoder frame
conv
std::unique_ptr< VideoConverter > convDefined in src/av/include/icy/av/videocontext.h:111
video conversion context
time
int64_t timeDefined in src/av/include/icy/av/videocontext.h:112
stream time in codec time base
pts
int64_t ptsDefined in src/av/include/icy/av/videocontext.h:113
last packet pts value
seconds
double secondsDefined in src/av/include/icy/av/videocontext.h:114
video time in seconds
error
std::string errorDefined in src/av/include/icy/av/videocontext.h:115
error message
Public Methods
| Return | Name | Description |
|---|---|---|
VideoContext | ||
VideoContext | Deleted constructor. | |
VideoContext | Deleted constructor. | |
void | create virtual | Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder. |
void | open virtual | Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created. |
void | close virtual | Close the codec context, free the frame, and reset timestamps. |
bool | decode virtual | Decode a compressed video packet and emit the resulting frame. |
bool | encode virtual | Encode a buffer of interleaved video data. |
bool | encode virtual | Encode a planar video frame. |
bool | encode virtual | Encode a single AVFrame. |
void | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
AVFrame * | convert virtual | Convert the video frame and return the result. |
bool | recreateConverter virtual | Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert(). |
VideoContext
VideoContext()Defined in src/av/include/icy/av/videocontext.h:44
VideoContext
VideoContext(const VideoContext &) = deleteDefined in src/av/include/icy/av/videocontext.h:47
Deleted constructor.
VideoContext
VideoContext(VideoContext &&) = deleteDefined in src/av/include/icy/av/videocontext.h:49
Deleted constructor.
create
virtual
virtual void create()Defined in src/av/include/icy/av/videocontext.h:54
Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder.
Reimplemented by
open
virtual
virtual void open()Defined in src/av/include/icy/av/videocontext.h:58
Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created.
Reimplemented by
close
virtual
virtual void close()Defined in src/av/include/icy/av/videocontext.h:61
Close the codec context, free the frame, and reset timestamps.
Reimplemented by
decode
virtual
virtual bool decode(AVPacket & ipacket)Defined in src/av/include/icy/av/videocontext.h:66
Decode a compressed video packet and emit the resulting frame.
Parameters
ipacketThe compressed video packet to decode.
Returns
True if an output frame was decoded and emitted, false otherwise.
Reimplemented by
encode
virtual
virtual bool encode(uint8_t * data, int size, int64_t pts)Defined in src/av/include/icy/av/videocontext.h:73
Encode a buffer of interleaved video data.
Parameters
dataPointer to the interleaved frame buffer.sizeSize of the buffer in bytes.ptsPresentation timestamp in stream time base units.
Returns
True if an encoded packet was produced and emitted.
Reimplemented by
encode
virtual
virtual bool encode(uint8_t * data, int linesize, int64_t pts)Defined in src/av/include/icy/av/videocontext.h:80
Encode a planar video frame.
Parameters
dataArray of per-plane data pointers (up to 4 planes).linesizeArray of per-plane byte strides.ptsPresentation timestamp in stream time base units.
Returns
True if an encoded packet was produced and emitted.
Reimplemented by
encode
virtual
virtual bool encode(AVFrame * iframe)Defined in src/av/include/icy/av/videocontext.h:85
Encode a single AVFrame.
Parameters
iframeThe source video frame; must have all fields set correctly.
Returns
True if an encoded packet was produced and emitted.
Reimplemented by
flush
virtual
virtual void flush()Defined in src/av/include/icy/av/videocontext.h:88
Flush any frames buffered inside the codec and emit remaining output.
Reimplemented by
convert
virtual
virtual AVFrame * convert(AVFrame * iframe)Defined in src/av/include/icy/av/videocontext.h:96
Convert the video frame and return the result.
The input frame will only be converted if it doesn't match the output format. If the frame is not converted the input frame will be returned. If the input frame format does not match the [VideoConverter](icy-av-VideoConverter.html#videoconverter) context then the [VideoConverter](icy-av-VideoConverter.html#videoconverter) will be recreated with the input frame params.
recreateConverter
virtual
virtual bool recreateConverter()Defined in src/av/include/icy/av/videocontext.h:101
Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert().
Returns
True if the converter was (re)created, false if it is already up to date.
