Codec
Codec
#include <icy/av/codec.h>Subclassed by:
AudioCodec,VideoCodec
Codec for encoding/decoding media.
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | name | The display name for this codec. |
std::string | encoder | The encoder name for FFmpeg. |
int | sampleRate | The sampling rate or RTP clock rate. |
int | bitRate | The bit rate to encode at. |
int | quality | Optional quality value, variable range depending on codec. |
int | compliance | FFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL). |
bool | enabled | Weather or not the codec is available for use. |
std::map< std::string, std::string > | options | 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. |
name
std::string nameThe display name for this codec.
encoder
std::string encoderThe encoder name for FFmpeg.
sampleRate
int sampleRateThe sampling rate or RTP clock rate.
bitRate
int bitRateThe bit rate to encode at.
quality
int qualityOptional quality value, variable range depending on codec.
compliance
int complianceFFmpeg strict_std_compliance level (default: FF_COMPLIANCE_EXPERIMENTAL).
enabled
bool enabledWeather or not the codec is available for use.
options
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.
Public Methods
| Return | Name | Description |
|---|---|---|
Codec | Construct a disabled codec with zeroed parameters. | |
Codec | Construct a codec with a display name, sample rate, bit rate, and enabled flag. | |
Codec | Construct a codec with an explicit FFmpeg encoder name. | |
~Codec virtual | Codec(const Codec& r);. | |
std::string | toString virtual const | Return a compact string representation of this codec. |
bool | specified const | Returns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use. |
void | print virtual | Print a multi-line human-readable description to the given stream. |
Codec
Codec()Construct a disabled codec with zeroed parameters.
Codec
Codec(const std::string & name, int sampleRate, int bitRate, bool enabled)Construct a codec with a display name, sample rate, bit rate, and enabled flag.
Parameters
nameThe codec display name.sampleRateThe sampling rate or RTP clock rate in Hz.bitRateThe target bit rate in bits per second.enabledWhether the codec is available for use.
Codec
Codec(const std::string & name, const std::string & encoder, int sampleRate, int bitRate, bool enabled)Construct a codec with an explicit FFmpeg encoder name.
Parameters
nameThe codec display name.encoderThe FFmpeg encoder name (e.g. "libx264").sampleRateThe sampling rate or RTP clock rate in Hz.bitRateThe target bit rate in bits per second.enabledWhether the codec is available for use.
~Codec
virtual
virtual ~Codec() noexceptCodec(const Codec& r);.
toString
virtual const
virtual std::string toString() constReturn a compact string representation of this codec.
Returns
A string in the form "Codec[name:encoder:sampleRate:enabled]".
specified
const
bool specified() constReturns true when this codec explicitly names either an RTP/media codec or an FFmpeg encoder and is enabled for use.
virtual
virtual void print(std::ostream & ost)Print a multi-line human-readable description to the given stream.
Parameters
ostThe output stream to write to.
