Tag Parser
9.1.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
Go to the documentation of this file.
31 AbstractTrack::AbstractTrack(istream &inputStream, ostream &outputStream, std::uint64_t startOffset)
32 : m_istream(&inputStream)
33 , m_ostream(&outputStream)
34 , m_reader(BinaryReader(&inputStream))
35 , m_writer(BinaryWriter(&outputStream))
36 , m_startOffset(startOffset)
37 , m_headerValid(false)
46 , m_samplingFrequency(0)
47 , m_extensionSamplingFrequency(0)
52 , m_extensionChannelConfig(0)
57 , m_chromaFormat(nullptr)
65 , m_usedInPresentation(true)
66 , m_usedWhenPreviewing(true)
136 ss <<
"ID: " <<
id();
138 if (!
name().empty()) {
139 ss <<
", name: \"" <<
name() <<
"\"";
168 const char *additionalInfo =
nullptr;
192 if (additionalInfo) {
193 return argsToString(
format,
'-', additionalInfo);
std::uint16_t channelCount() const
Returns the number of channels if known; otherwise returns 0.
const char * channelConfigString() const
Returns a string with the channel configuration if available; otherwise returns nullptr.
std::string label() const
Returns a label for the track.
std::uint8_t extensionChannelConfig() const
Returns the extension channel configuration if available; otherwise returns nullptr.
The Diagnostics class is a container for DiagMessage.
Contains all classes and functions of the TagInfo library.
const TAG_PARSER_EXPORT std::string & languageNameFromIsoWithFallback(const std::string &isoCode)
Returns the language name for the specified ISO-639-2 code (bibliographic, 639-2/B).
bool isLanguageDefined(const std::string &languageSpecification)
Returns whether languageSpecification is not empty or undefined.
MediaFormat format() const
Returns the format of the track if known; otherwise returns MediaFormat::Unknown.
The class inherits from std::exception and serves as base class for exceptions thrown by the elements...
virtual ~AbstractTrack()
Destroys the track.
const TAG_PARSER_EXPORT char * mpegChannelModeString(MpegChannelMode channelMode)
Returns the string representation for the specified channelMode.
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
void parseHeader(Diagnostics &diag)
Parses technical information about the track from the header.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
std::string description() const
Returns a short description about the track.
std::uint64_t m_startOffset
const std::string & language() const
Returns the language of the track if known; otherwise returns an empty string.
std::uint64_t id() const
Returns the track ID if known; otherwise returns 0.
AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
Constructs a new track.
std::uint8_t m_channelConfig
const Size & displaySize() const
Returns the size of the video frames to display if known; otherwise returns a zero size.
const Size & pixelSize() const
Returns the size of the encoded video frames if known; otherwise returns a zero size.
virtual void internalParseHeader(Diagnostics &diag)=0
This method is internally called to parse header information. It needs to be implemented when subclas...
const char * mediaTypeName() const
Returns the string representation of the media type of the track.
const TAG_PARSER_EXPORT char * channelConfigString(std::uint8_t config)
Returns the string representation for the specified MPEG-4 channel config.
const char * abbreviation() const
Returns an abbreviation for the current instance, eg.
const char * extensionChannelConfigString() const
Returns a string with the extension channel configuration if available; otherwise returns nullptr.
const std::string name() const
Returns the track name if known; otherwise returns an empty string.
std::uint8_t m_extensionChannelConfig