Home
AV module

IEncoder

This is the abstract class for all encoders.

IEncoder

#include <icy/av/iencoder.h>
class IEncoder

Defined in src/av/include/icy/av/iencoder.h:81

Inherits: Stateful< EncoderState > Subclassed by: MultiplexEncoder

This is the abstract class for all encoders.

List of all members

NameKindOwner
initfunctionDeclared here
uninitfunctionDeclared here
cleanupfunctionDeclared here
optionsfunctionDeclared here
createVideofunctionDeclared here
freeVideofunctionDeclared here
encodeVideofunctionDeclared here
createAudiofunctionDeclared here
freeAudiofunctionDeclared here
flushfunctionDeclared here
isNonefunctionDeclared here
isReadyfunctionDeclared here
isEncodingfunctionDeclared here
isActivefunctionDeclared here
isStoppedfunctionDeclared here
isErrorfunctionDeclared here
TypeenumDeclared here
StateChangevariableInherited from Stateful
StatefulfunctionInherited from Stateful
~StatefulfunctionInherited from Stateful
stateEqualsfunctionInherited from Stateful
stateBetweenfunctionInherited from Stateful
statefunctionInherited from Stateful
statefunctionInherited from Stateful
_statevariableInherited from Stateful
beforeStateChangefunctionInherited from Stateful
onStateChangefunctionInherited from Stateful
setStatefunctionInherited from Stateful
setStatefunctionInherited from Stateful

Inherited from Stateful

KindNameDescription
variableStateChangeSignals when the state changes.
functionStateful inline
function~Stateful virtual inline
functionstateEquals virtual const inlineReturns true if the current state ID equals the given ID.
functionstateBetween virtual const inlineReturns true if the current state ID is in the inclusive range [lid, rid].
functionstate virtual inlineReturns a mutable reference to the current state.
functionstate virtual const inlineReturns a copy of the current state.
variable_state
functionbeforeStateChange virtual inlineOverride to handle pre state change logic. Return false to prevent state change.
functiononStateChange virtual inlineOverride to handle post state change logic.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.
functionsetState virtual inlineSets the state and sends the state signal if the state change was successful.

Public Methods

ReturnNameDescription
voidinit virtualInitialise the encoder, open codec contexts, and transition to Ready or Encoding state.
voiduninit virtualFlush remaining packets, close codec contexts, and release all encoder resources.
voidcleanup virtual inlinePerform any additional cleanup after uninit(). Default is a no-op.
const EncoderOptions &options virtual const
voidcreateVideo virtual inlineInitialise the video codec context and stream.
voidfreeVideo virtual inlineFree the video codec context and stream.
boolencodeVideo virtual inlineEncode a single AVFrame of video.
voidcreateAudio virtual inlineInitialise the audio codec context and stream.
voidfreeAudio virtual inlineFree the audio codec context and stream.
voidflush virtual inlineFlush any internally buffered packets to the output.
boolisNone const inline
boolisReady const inline
boolisEncoding virtual const inline
boolisActive virtual const inline
boolisStopped virtual const inline
boolisError virtual const inline

init

virtual

virtual void init()

Defined in src/av/include/icy/av/iencoder.h:93

Initialise the encoder, open codec contexts, and transition to Ready or Encoding state.

Reimplemented by

uninit

virtual

virtual void uninit()

Defined in src/av/include/icy/av/iencoder.h:96

Flush remaining packets, close codec contexts, and release all encoder resources.

Reimplemented by

cleanup

virtual inline

virtual inline void cleanup()

Defined in src/av/include/icy/av/iencoder.h:99

Perform any additional cleanup after uninit(). Default is a no-op.

Reimplemented by

options

virtual const

virtual const EncoderOptions & options() const

Defined in src/av/include/icy/av/iencoder.h:102

Returns

A read-only view of the encoder's configuration options.

Reimplemented by

createVideo

virtual inline

virtual inline void createVideo()

Defined in src/av/include/icy/av/iencoder.h:105

Initialise the video codec context and stream.

Reimplemented by

freeVideo

virtual inline

virtual inline void freeVideo()

Defined in src/av/include/icy/av/iencoder.h:108

Free the video codec context and stream.

Reimplemented by

encodeVideo

virtual inline

virtual inline bool encodeVideo(AVFrame * frame)

Defined in src/av/include/icy/av/iencoder.h:113

Encode a single AVFrame of video.

Parameters

  • frame The source video frame; all fields (format, width, height, pts) must be set.

Returns

True if a packet was successfully encoded and written.

Reimplemented by

createAudio

virtual inline

virtual inline void createAudio()

Defined in src/av/include/icy/av/iencoder.h:116

Initialise the audio codec context and stream.

Reimplemented by

freeAudio

virtual inline

virtual inline void freeAudio()

Defined in src/av/include/icy/av/iencoder.h:119

Free the audio codec context and stream.

Reimplemented by

flush

virtual inline

virtual inline void flush()

Defined in src/av/include/icy/av/iencoder.h:122

Flush any internally buffered packets to the output.

Reimplemented by

isNone

const inline

inline bool isNone() const

Defined in src/av/include/icy/av/iencoder.h:125

Returns

True if the encoder is in the None state.


isReady

const inline

inline bool isReady() const

Defined in src/av/include/icy/av/iencoder.h:128

Returns

True if the encoder is ready but not yet encoding.


isEncoding

virtual const inline

virtual inline bool isEncoding() const

Defined in src/av/include/icy/av/iencoder.h:131

Returns

True if the encoder is actively encoding.


isActive

virtual const inline

virtual inline bool isActive() const

Defined in src/av/include/icy/av/iencoder.h:134

Returns

True if the encoder is in the Ready or Encoding state.


isStopped

virtual const inline

virtual inline bool isStopped() const

Defined in src/av/include/icy/av/iencoder.h:137

Returns

True if the encoder has stopped.


isError

virtual const inline

virtual inline bool isError() const

Defined in src/av/include/icy/av/iencoder.h:140

Returns

True if the encoder is in an error state.

Public Types

NameDescription
Type

Type

enum Type

Defined in src/av/include/icy/av/iencoder.h:84

ValueDescription
Nonehuh?
Videovideo only
Audioaudio only
Multiplexboth video & audio