AV module

Format

Defines a media container format which is available through the [FormatRegistry]({#ref classicy_1_1av_1_1FormatRegistry #}) for encoding or decoding.

Format

#include <icy/av/format.h>

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

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

Base Format Variables.

The display name of this format.


id

std::string id

The short name of this format.


video

VideoCodec video

The video codec.


audio

AudioCodec audio

The audio codec.


priority

int priority

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
Typetype constReturn the media type (None, Video, Audio, or Multiplex) derived from which codecs are enabled.
std::stringtoString virtual const#### Returns
voidprint virtualPrint a multi-line human-readable description to the given stream.

Format

Format()

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)

Construct a multiplex (audio + video) format.

Parameters

  • name The display name of the format.

  • id The short FFmpeg muxer ID (e.g. "mp4").

  • video The video codec parameters.

  • audio The audio codec parameters.

  • priority Sort priority; higher values appear first.


Format

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

Construct a video-only format.

Parameters

  • name The display name of the format.

  • id The short FFmpeg muxer ID.

  • video The video codec parameters.

  • priority Sort priority; higher values appear first.


Format

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

Construct an audio-only format.

Parameters

  • name The display name of the format.

  • id The short FFmpeg muxer ID.

  • audio The audio codec parameters.

  • priority Sort priority; higher values appear first.


Format

Format(const Format & r)

type

const

Type type() const

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


toString

virtual const

virtual std::string toString() const

Returns

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


print

virtual

virtual void print(std::ostream & ost)

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

Parameters

  • ost 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)

Comparator returning true if first has higher priority than second.

Parameters

  • first The format to compare.

  • second The format to compare against.

Returns

True if first.priority > second.priority.

Public Types

NameDescription
Type

Type

enum Type
ValueDescription
None
Videovideo only
Audioaudio only
Multiplexboth video & audio