AV module

Codec

Codec for encoding/decoding media.

#include <icy/av/codec.h>

struct Codec

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

Subclassed by
AudioCodec, VideoCodec

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

ParameterTypeDescription
nameconst std::string &The codec display name.
sampleRateintThe sampling rate or RTP clock rate in Hz.
bitRateintThe target bit rate in bits per second.
enabledboolWhether 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

ParameterTypeDescription
nameconst std::string &The codec display name.
encoderconst std::string &The FFmpeg encoder name (e.g. "libx264").
sampleRateintThe sampling rate or RTP clock rate in Hz.
bitRateintThe target bit rate in bits per second.
enabledboolWhether 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.

Reimplemented by

Parameters

ParameterTypeDescription
oststd::ostream &The output stream to write to.