AV module

Format

Defines a media container format which is available through the FormatRegistry for encoding or decoding.

#include <icy/av/format.h>

struct Format

Defined in src/av/include/icy/av/format.h:30

A format bundles the preferred default audio and video codec settings for a named container such as MP4, MKV, or WAV.

Public Attributes

ReturnNameDescription
std::stringnameBase Format Variables.
std::stringidThe short name of this format.
VideoCodecvideoThe video codec.
AudioCodecaudioThe audio codec.
intpriorityThe priority this format will be displayed on the list.

name

std::string name

Defined in src/av/include/icy/av/format.h:43

Base Format Variables.

The display name of this format.


id

std::string id

Defined in src/av/include/icy/av/format.h:44

The short name of this format.


video

VideoCodec video

Type: VideoCodec

Defined in src/av/include/icy/av/format.h:46

The video codec.


audio

AudioCodec audio

Type: AudioCodec

Defined in src/av/include/icy/av/format.h:47

The audio codec.


priority

int priority

Defined in src/av/include/icy/av/format.h:49

The priority this format will be displayed on the list.

Public Methods

ReturnNameDescription
FormatCtors/Dtors.
FormatConstruct a multiplex (audio + video) format.
FormatConstruct a video-only format.
FormatConstruct an audio-only format.
Format
Format &operator=Defaulted assignment operator.
~Format virtualDefaulted destructor.
Typetype constReturn the media type (None, Video, Audio, or Multiplex) derived from which codecs are enabled.
std::stringtoString virtual const
voidprint virtualPrint a multi-line human-readable description to the given stream.

Format

Format()

Defined in src/av/include/icy/av/format.h:56

Ctors/Dtors.

Construct an empty format with no codecs enabled.


Format

Format(const std::string & name, const std::string & id, const VideoCodec & video, const AudioCodec & audio, int priority = 0)

Defined in src/av/include/icy/av/format.h:64

Construct a multiplex (audio + video) format.

Parameters

ParameterTypeDescription
nameconst std::string &The display name of the format.
idconst std::string &The short FFmpeg muxer ID (e.g. "mp4").
videoconst VideoCodec &The video codec parameters.
audioconst AudioCodec &The audio codec parameters.
priorityintSort priority; higher values appear first.

Format

Format(const std::string & name, const std::string & id, const VideoCodec & video, int priority = 0)

Defined in src/av/include/icy/av/format.h:73

Construct a video-only format.

Parameters

ParameterTypeDescription
nameconst std::string &The display name of the format.
idconst std::string &The short FFmpeg muxer ID.
videoconst VideoCodec &The video codec parameters.
priorityintSort priority; higher values appear first.

Format

Format(const std::string & name, const std::string & id, const AudioCodec & audio, int priority = 0)

Defined in src/av/include/icy/av/format.h:82

Construct an audio-only format.

Parameters

ParameterTypeDescription
nameconst std::string &The display name of the format.
idconst std::string &The short FFmpeg muxer ID.
audioconst AudioCodec &The audio codec parameters.
priorityintSort priority; higher values appear first.

Format

Format(const Format & r)

Defined in src/av/include/icy/av/format.h:87


operator=

Format & operator=(const Format &) = default

Defined in src/av/include/icy/av/format.h:88

Defaulted assignment operator.


~Format

virtual

virtual ~Format() = default

Defined in src/av/include/icy/av/format.h:90

Defaulted destructor.


type

const

Type type() const

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

Return the media type (None, Video, Audio, or Multiplex) derived from which codecs are enabled.


toString

virtual const

virtual std::string toString() const

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

Returns

A compact string representation of the format and its enabled codecs.


print

virtual

virtual void print(std::ostream & ost)

Defined in src/av/include/icy/av/format.h:100

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

Parameters

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

Public Static Methods

ReturnNameDescription
boolpreferable static inlineComparator returning true if first has higher priority than second.

preferable

static inline

static inline bool preferable(const Format & first, const Format & second)

Defined in src/av/include/icy/av/format.h:106

Comparator returning true if first has higher priority than second.

Returns

True if first.priority > second.priority.

Parameters

ParameterTypeDescription
firstconst Format &The format to compare.
secondconst Format &The format to compare against.

Public Types

NameDescription
Type

Type

enum Type

Defined in src/av/include/icy/av/format.h:32

ValueDescription
None
Videovideo only
Audioaudio only
Multiplexboth video & audio