1 #ifndef TAG_PARSER_ABSTRACTTRACK_H 2 #define TAG_PARSER_ABSTRACTTRACK_H 10 #include <c++utilities/chrono/datetime.h> 11 #include <c++utilities/chrono/timespan.h> 12 #include <c++utilities/conversion/types.h> 13 #include <c++utilities/io/binaryreader.h> 14 #include <c++utilities/io/binarywriter.h> 48 std::istream &inputStream();
49 void setInputStream(std::istream &stream);
50 std::ostream &outputStream();
51 void setOutputStream(std::ostream &stream);
52 IoUtilities::BinaryReader &reader();
53 IoUtilities::BinaryWriter &writer();
54 uint64 startOffset()
const;
57 const char *formatName()
const;
58 const char *formatAbbreviation()
const;
59 const std::string &formatId()
const;
66 void setId(uint64
id);
67 const std::string name()
const;
68 void setName(
const std::string &name);
71 double maxBitrate()
const;
75 void setLanguage(
const std::string &
language);
76 uint32 samplingFrequency()
const;
77 uint32 extensionSamplingFrequency()
const;
78 uint16 bitsPerSample()
const;
80 byte channelConfig()
const;
82 byte extensionChannelConfig()
const;
83 const char *extensionChannelConfigString()
const;
84 uint64 sampleCount()
const;
86 const Size &pixelSize()
const;
87 const Size &displaySize()
const;
88 const Size &resolution()
const;
89 const std::string &compressorName()
const;
90 void setCompressorName(
const std::string &compressorName);
93 const char *chromaFormat()
const;
95 bool isInterlaced()
const;
96 uint32 timeScale()
const;
97 bool isEnabled()
const;
98 void setEnabled(
bool enabled);
99 bool isDefault()
const;
100 void setDefault(
bool isDefault);
101 bool isForced()
const;
102 void setForced(
bool forced);
103 bool hasLacing()
const;
104 bool isEncrypted()
const;
105 uint32 colorSpace()
const;
106 const Margin &cropping()
const;
107 std::string
label()
const;
111 bool isHeaderValid()
const;
114 AbstractTrack(std::istream &inputStream, std::ostream &outputStream, uint64 startOffset);
116 virtual void internalParseHeader(
Diagnostics &diag) = 0;
687 #endif // TAG_PARSER_ABSTRACTTRACK_H const std::string & language() const
Returns the language of the track if known; otherwise returns an empty string.
TAG_PARSER_EXPORT const char * language()
TAG_PARSER_EXPORT byte channelCount(byte config)
Returns the channel count for the specified MPEG-4 channel config.
IoUtilities::BinaryWriter m_writer
bool isEncrypted() const
Returns true if the track is denoted as encrypted; otherwise returns false.
bool isDefault() const
Returns true if the track is denoted as default; otherwise returns false.
The Margin class defines the four margins of a rectangle.
TAG_PARSER_EXPORT const char * description()
IoUtilities::BinaryReader m_reader
const std::string name() const
Returns the track name if known; otherwise returns an empty string.
byte m_extensionChannelConfig
Implementation of TagParser::AbstractTrack for the RIFF WAVE container format.
uint32 trackNumber() const
Returns the track number if known; otherwise returns 0.
const char * m_chromaFormat
uint32 timeScale() const
Returns the time scale if known; otherwise returns 0.
TAG_PARSER_EXPORT const char * fps()
byte channelConfig() const
Returns the channel configuration.
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
void setInputStream(std::istream &stream)
Assigns another input stream.
std::string m_compressorName
bool hasLacing() const
Returns true if the track has lacing; otherwise returns false.
std::ostream & outputStream()
Returns the associated output stream.
void setCompressorName(const std::string &compressorName)
Returns the compressor name if known; otherwise returns an empty string.
TAG_PARSER_EXPORT const char * bitrate()
The track's bit rate in bits per second.
uint32 extensionSamplingFrequency() const
Returns the number of samples per second if known; otherwise returns 0.
IoUtilities::BinaryReader & reader()
Returns a binary reader for the associated stream.
uint32 m_extensionSamplingFrequency
uint32 colorSpace() const
Returns the color space if known; otherwise returns 0.
double bitrate() const
Returns the average bitrate in kbit/s if known; otherwise returns zero.
const std::string & formatId() const
Returns the format/codec ID.
const ChronoUtilities::DateTime & creationTime() const
Returns the creation time if known; otherwise returns a DateTime of zero ticks.
const char * formatAbbreviation() const
Returns the a more or less common abbreviation for the format of the track as C-style string if known...
double version() const
Returns the version/level of the track if known; otherwise returns 0.
void setForced(bool forced)
Sets whether the track is forced.
Implementation of TagParser::AbstractTrack for the MP4 container.
The Size class defines the size of a two-dimensional object using integer point precision.
double maxBitrate() const
Returns the maximum bitrate in kbit/s if known; otherwise returns zero.
AspectRatio m_pixelAspectRatio
const AspectRatio & pixelAspectRatio() const
Returns the pixel aspect ratio (PAR).
uint64 startOffset() const
Returns the start offset of the track in the associated stream.
const char * formatName() const
Returns the format of the track as C-style string if known; otherwise returns the format abbreviation...
MediaType mediaType() const
Returns the media type if known; otherwise returns MediaType::Other.
const std::string & compressorName() const
Returns the compressor name if known; otherwise returns an empty string.
ChronoUtilities::TimeSpan m_duration
void setOutputStream(std::ostream &stream)
Assigns another output stream.
uint64 size() const
Returns the size in bytes if known; otherwise returns 0.
TAG_PARSER_EXPORT const char * channelConfigString(byte config)
Returns the string representation for the specified MPEG-4 channel config.
bool m_usedInPresentation
MediaFormat format() const
Returns the format of the track if known; otherwise returns MediaFormat::Unknown. ...
int quality() const
Returns the quality if known; otherwise returns 0.
std::istream & inputStream()
Returns the associated input stream.
const Size & resolution() const
Returns the resolution if known; otherwise returns a zero size.
const Margin & cropping() const
Returns the cropping if known; otherwise returns zero margins.
bool m_usedWhenPreviewing
void setName(const std::string &name)
Sets the name.
uint32 samplingFrequency() const
Returns the number of samples per second if known; otherwise returns 0.
bool isEnabled() const
Returns true if the track is denoted as enabled; otherwise returns false.
const char *TAG_PARSER_EXPORT mediaTypeName(MediaType mediaType)
Returns the string representation for the specified mediaType.
const Size & pixelSize() const
Returns the size of the encoded video frames if known; otherwise returns a zero size.
uint64 id() const
Returns the track ID if known; otherwise returns 0.
uint64 sampleCount() const
Returns the number of samples/frames if known; otherwise returns 0.
ChronoUtilities::DateTime m_creationTime
const char * mediaTypeName() const
Returns the string representation of the media type of the track.
void setId(uint64 id)
Sets the track ID.
virtual TrackType type() const
Returns the type of the track if known; otherwise returns TrackType::Unspecified. ...
Implementation of TagParser::AbstractTrack MPEG audio streams.
TAG_PARSER_EXPORT const char * duration()
const ChronoUtilities::TimeSpan & duration() const
Returns the duration if known; otherwise returns a TimeSpan of zero ticks.
bool isInterlaced() const
Returns true if the video is denoted as interlaced; otherwise returns false.
const ChronoUtilities::DateTime & modificationTime() const
Returns the time of the last modification if known; otherwise returns a DateTime of zero ticks...
void setTrackNumber(uint32 trackNumber)
Sets the track number.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
bool isHeaderValid() const
Returns an indication whether the track header is valid.
bool isForced() const
Returns true if the track is denoted as forced; otherwise returns false.
ChronoUtilities::DateTime m_modificationTime
const char * chromaFormat() const
Returns the chroma subsampling format if known; otherwise returns nullptr.
const Size & displaySize() const
Returns the size of the video frames to display if known; otherwise returns a zero size...
void setEnabled(bool enabled)
Sets whether the track is enabled.
uint32 fps() const
Returns the number of frames per second if known; otherwise returns 0.
uint32 m_samplingFrequency
void setLanguage(const std::string &language)
Sets the language of the track.
Contains all classes and functions of the TagInfo library.
IoUtilities::BinaryWriter & writer()
Returns a binary writer for the associated stream.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TrackType
Specifies the track type.
The AspectRatio struct defines an aspect ratio.
The Diagnostics class is a container for DiagMessage.
uint16 channelCount() const
Returns the number of channels if known; otherwise returns 0.
void setDefault(bool isDefault)
Sets whether the track is a default track.
uint16 bitsPerSample() const
Returns the number of bits per sample; otherwise returns 0.
uint16 depth() const
Returns the bit depth if known; otherwise returns 0.