Home
AV module

Codec

Codec for encoding/decoding media.

Codec

#include <icy/av/codec.h>
struct Codec

Defined in src/av/include/icy/av/codec.h:29

Subclassed by: AudioCodec, VideoCodec

Codec for encoding/decoding media.

List of all members

NameKindOwner
namevariableDeclared here
encodervariableDeclared here
sampleRatevariableDeclared here
bitRatevariableDeclared here
qualityvariableDeclared here
compliancevariableDeclared here
enabledvariableDeclared here
optionsvariableDeclared here
CodecfunctionDeclared here
CodecfunctionDeclared here
CodecfunctionDeclared here
~CodecfunctionDeclared here
toStringfunctionDeclared here
specifiedfunctionDeclared here
printfunctionDeclared here

Public Attributes

ReturnNameDescription
std::stringnameThe display name for this codec.
std::stringencoderThe encoder name for FFmpeg.
intsampleRateThe sampling rate or RTP clock rate.
intbitRateThe bit rate to encode at.
intqualityOptional quality value, variable range depending on codec.
intcomplianceFFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).
boolenabledWeather or not the codec is available for use.
std::map< std::string, std::string >optionsArbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.

name

std::string name

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

The display name for this codec.


encoder

std::string encoder

Defined in src/av/include/icy/av/codec.h:35

The encoder name for FFmpeg.


sampleRate

int sampleRate

Defined in src/av/include/icy/av/codec.h:36

The sampling rate or RTP clock rate.


bitRate

int bitRate

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

The bit rate to encode at.


quality

int quality

Defined in src/av/include/icy/av/codec.h:38

Optional quality value, variable range depending on codec.


compliance

int compliance

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

FFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).


enabled

bool enabled

Defined in src/av/include/icy/av/codec.h:40

Weather or not the codec is available for use.


options

std::map< std::string, std::string > options

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

Arbitrary encoder options passed to FFmpeg via av_opt_set(). Keys are FFmpeg option names (e.g. "preset", "tune", "profile"). Applied after codec-specific defaults, so they override everything.

Public Methods

ReturnNameDescription
CodecConstruct a disabled codec with zeroed parameters.
CodecConstruct a codec with a display name, sample rate, bit rate, and enabled flag.
CodecConstruct a codec with an explicit FFmpeg encoder name.
~Codec virtual noexceptCodec(const Codec& r);.
std::stringtoString virtual constReturn a compact string representation of this codec.
boolspecified constReturns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.
voidprint virtualPrint a multi-line human-readable description to the given stream.

Codec

Codec()

Defined in src/av/include/icy/av/codec.h:51

Construct a disabled codec with zeroed parameters.


Codec

Codec(const std::string & name, int sampleRate = 0, int bitRate = 0, bool enabled = true)

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

Construct a codec with a display name, sample rate, bit rate, and enabled flag.

Parameters

  • name The codec display name.

  • sampleRate The sampling rate or RTP clock rate in Hz.

  • bitRate The target bit rate in bits per second.

  • enabled Whether the codec is available for use.


Codec

Codec(const std::string & name, const std::string & encoder, int sampleRate = 0, int bitRate = 0, bool enabled = true)

Defined in src/av/include/icy/av/codec.h:67

Construct a codec with an explicit FFmpeg encoder name.

Parameters

  • name The codec display name.

  • encoder The FFmpeg encoder name (e.g. "libx264").

  • sampleRate The sampling rate or RTP clock rate in Hz.

  • bitRate The target bit rate in bits per second.

  • enabled Whether the codec is available for use.


~Codec

virtual noexcept

virtual ~Codec() noexcept

Defined in src/av/include/icy/av/codec.h:70

Codec(const Codec& r);.


toString

virtual const

virtual std::string toString() const

Defined in src/av/include/icy/av/codec.h:77

Return a compact string representation of this codec.

Returns

A string in the form "Codec[name:encoder:sampleRate:enabled]".

Reimplemented by

specified

const

bool specified() const

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

Returns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.


print

virtual

virtual void print(std::ostream & ost)

Defined in src/av/include/icy/av/codec.h:85

Print a multi-line human-readable description to the given stream.

Parameters

  • ost The output stream to write to.
Reimplemented by