Tag Parser: abstracttrack.h Source File

Tag Parser 12.5.3 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
abstracttrack.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_ABSTRACTTRACK_H
2#define TAG_PARSER_ABSTRACTTRACK_H
3
4#include "./aspectratio.h"
5#include "./diagnostics.h"
6#include "./localehelper.h"
7#include "./margin.h"
8#include "./mediaformat.h"
9#include "./size.h"
10
11#include <c++utilities/chrono/datetime.h>
12#include <c++utilities/chrono/timespan.h>
13#include <c++utilities/io/binaryreader.h>
14#include <c++utilities/io/binarywriter.h>
15#include <c++utilities/misc/flagenumclass.h>
16
17#include <iosfwd>
18#include <memory>
19#include <string>
20#include <string_view>
21
22namespace TagParser {
23
24class AbortableProgressFeedback;
25class MpegAudioFrameStream;
26class WaveAudioStream;
27class Mp4Track;
28
32 enum class TrackType {
33 Unspecified,
34 MatroskaTrack,
35 MpegAudioFrameStream,
36 Mp4Track,
37 WaveAudioStream,
38 OggStream,
39 AdtsStream,
40 FlacStream,
41 IvfStream,
42};
43
47 enum class TrackFlags : std::uint64_t {
48 None = 0,
49 HeaderValid = (1 << 0),
50 Enabled = (1 << 2),
51 Default = (1 << 3),
52 Forced = (1 << 4),
53 Lacing = (1 << 5),
54 Encrypted = (1 << 6),
55 UsedInPresentation = (1 << 7),
56 UsedWhenPreviewing = (1 << 8),
57 Interlaced = (1 << 9),
58};
59
63 enum class FieldOrder : std::uint64_t {
64 Progressive = 0,
65 Tff = 1,
66 Undetermined = 2,
67 Bff = 6,
68 BffSwapped = 9,
69 TffSwapped = 14,
70};
71
76 enum class StereoMode : std::uint64_t {
77 Unknown = std::numeric_limits<std::uint64_t>::max(),
78};
79
83 enum class AlphaMode : std::uint64_t {
84 Unknown = std::numeric_limits<std::uint64_t>::max(),
85};
86
90 enum class DisplayUnit : std::uint64_t { Pixels, Centimeters, Inches, DisplayAspectRatio, Unknown };
91
95 enum class AspectRatioType : std::uint64_t {
96 FreeResizing,
97 KeepAspectRatio,
98 Fixed,
99 Unknown = std::numeric_limits<std::uint64_t>::max(),
100};
101
102} // namespace TagParser
103
104 CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::TrackFlags)
105
106namespace TagParser {
107
108struct AbstractTrackPrivate;
109
110 class TAG_PARSER_EXPORT AbstractTrack {
111 friend class MpegAudioFrameStream;
112 friend class WaveAudioStream;
113 friend class Mp4Track;
114
115public:
116 virtual ~AbstractTrack();
117
118 virtual TrackType type() const;
119 std::istream &inputStream();
120 void setInputStream(std::istream &stream);
121 std::ostream &outputStream();
122 void setOutputStream(std::ostream &stream);
123 CppUtilities::BinaryReader &reader();
124 CppUtilities::BinaryWriter &writer();
125 std::uint64_t startOffset() const;
126 TrackFlags flags() const;
127 MediaFormat format() const;
128 double version() const;
129 std::string_view formatName() const;
130 std::string_view formatAbbreviation() const;
131 const std::string &formatId() const;
132 MediaType mediaType() const;
133 std::string_view mediaTypeName() const;
134 std::uint64_t size() const;
135 void setSize(std::uint64_t size);
136 std::uint32_t trackNumber() const;
137 void setTrackNumber(std::uint32_t trackNumber);
138 std::uint64_t id() const;
139 void setId(std::uint64_t id);
140 const std::string name() const;
141 void setName(std::string_view name);
142 const CppUtilities::TimeSpan &duration() const;
143 double bitrate() const;
144 double maxBitrate() const;
145 const CppUtilities::DateTime &creationTime() const;
146 const CppUtilities::DateTime &modificationTime() const;
147 const Locale &locale() const;
148 void setLocale(const Locale &locale);
149 std::uint32_t samplingFrequency() const;
150 std::uint32_t extensionSamplingFrequency() const;
151 std::uint16_t bitsPerSample() const;
152 std::uint16_t channelCount() const;
153 std::uint8_t channelConfig() const;
154 std::string_view channelConfigString() const;
155 std::uint8_t extensionChannelConfig() const;
156 std::string_view extensionChannelConfigString() const;
157 std::uint64_t sampleCount() const;
158 int quality() const;
159 const Size &pixelSize() const;
160 const Size &displaySize() const;
161 const Size &resolution() const;
162 const std::string &compressorName() const;
163 void setCompressorName(std::string_view compressorName);
164 std::uint16_t depth() const;
165 std::uint32_t fps() const;
166 std::string_view chromaFormat() const;
167 const AspectRatio &pixelAspectRatio() const;
168 bool isInterlaced() const;
169 std::uint32_t timeScale() const;
170 bool isEnabled() const;
171 void setEnabled(bool enabled);
172 bool isDefault() const;
173 void setDefault(bool isDefault);
174 bool isForced() const;
175 void setForced(bool forced);
176 bool hasLacing() const;
177 bool isEncrypted() const;
178 std::uint32_t colorSpace() const;
179 const Margin &cropping() const;
180 std::string label() const;
181 std::string description() const;
182 std::string shortDescription() const;
183
184 void parseHeader(Diagnostics &diag, AbortableProgressFeedback &progress);
185 bool isHeaderValid() const;
186
187protected:
188 AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset);
189 AbstractTrack(std::iostream &stream, std::uint64_t startOffset);
190 virtual void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) = 0;
191
192 std::istream *m_istream;
193 std::ostream *m_ostream;
194 CppUtilities::BinaryReader m_reader;
195 CppUtilities::BinaryWriter m_writer;
196 std::uint64_t m_startOffset;
197 TrackFlags m_flags;
198 MediaFormat m_format;
199 std::string m_formatId;
200 std::string m_formatName;
201 MediaType m_mediaType;
202 double m_version;
203 std::uint64_t m_size;
204 std::uint32_t m_trackNumber;
205 std::uint64_t m_id;
206 std::string m_name;
207 CppUtilities::TimeSpan m_duration;
208 double m_bitrate;
209 double m_maxBitrate;
210 CppUtilities::DateTime m_creationTime;
211 CppUtilities::DateTime m_modificationTime;
212 Locale m_locale;
213 std::uint32_t m_samplingFrequency;
214 std::uint32_t m_extensionSamplingFrequency;
215 std::uint16_t m_bitsPerSample;
216 std::uint32_t m_bytesPerSecond;
217 std::uint16_t m_channelCount;
218 std::uint8_t m_channelConfig;
219 std::uint8_t m_extensionChannelConfig;
220 std::uint16_t m_chunkSize;
221 std::uint64_t m_sampleCount;
222 int m_quality;
223 Size m_pixelSize;
224 Size m_displaySize;
225 Size m_resolution;
226 std::string m_compressorName;
227 std::uint16_t m_depth;
228 std::uint32_t m_fps;
229 std::string_view m_chromaFormat;
230 AspectRatio m_pixelAspectRatio;
231 std::uint32_t m_timeScale;
232 std::uint32_t m_colorSpace;
233 Margin m_cropping;
234 FieldOrder m_fieldOrder;
235 StereoMode m_stereoMode;
236 AlphaMode m_alphaMode;
237 DisplayUnit m_displayUnit;
238 AspectRatioType m_aspectRatioType;
239 std::unique_ptr<AbstractTrackPrivate> m_p;
240
241private:
242 std::string makeDescription(bool verbose) const;
243};
244
248 inline std::istream &AbstractTrack::inputStream()
249{
250 return *m_istream;
251}
252
259 inline void AbstractTrack::setInputStream(std::istream &stream)
260{
261 m_reader.setStream(m_istream = &stream);
262}
263
267 inline std::ostream &AbstractTrack::outputStream()
268{
269 return *m_ostream;
270}
271
278 inline void AbstractTrack::setOutputStream(std::ostream &stream)
279{
280 m_writer.setStream(m_ostream = &stream);
281}
282
289 inline CppUtilities::BinaryReader &AbstractTrack::reader()
290{
291 return m_reader;
292}
293
300 inline CppUtilities::BinaryWriter &AbstractTrack::writer()
301{
302 return m_writer;
303}
304
308 inline TrackType AbstractTrack::type() const
309{
310 return TrackType::Unspecified;
311}
312
316 inline std::uint64_t AbstractTrack::startOffset() const
317{
318 return m_startOffset;
319}
320
325 inline TrackFlags AbstractTrack::flags() const
326{
327 return m_flags;
328}
329
333 inline MediaFormat AbstractTrack::format() const
334{
335 return m_format;
336}
337
341 inline double AbstractTrack::version() const
342{
343 return m_version;
344}
345
351 inline std::string_view AbstractTrack::formatName() const
352{
353 return m_format || m_formatName.empty() ? m_format.name() : m_formatName;
354}
355
360 inline std::string_view AbstractTrack::formatAbbreviation() const
361{
362 const auto abbr = m_format.abbreviation();
363 return !abbr.empty() || m_formatId.empty() ? abbr : m_formatId;
364}
365
370 inline const std::string &AbstractTrack::formatId() const
371{
372 return m_formatId;
373}
374
378 inline MediaType AbstractTrack::mediaType() const
379{
380 return m_mediaType;
381}
382
386 inline std::string_view AbstractTrack::mediaTypeName() const
387{
388 return ::TagParser::mediaTypeName(m_mediaType);
389}
390
394 inline std::uint64_t AbstractTrack::size() const
395{
396 return m_size;
397}
398
407 inline void AbstractTrack::setSize(std::uint64_t size)
408{
409 m_size = size;
410}
411
415 inline std::uint32_t AbstractTrack::trackNumber() const
416{
417 return m_trackNumber;
418}
419
424 inline void AbstractTrack::setTrackNumber(std::uint32_t trackNumber)
425{
426 m_trackNumber = trackNumber;
427}
428
432 inline std::uint64_t AbstractTrack::id() const
433{
434 return m_id;
435}
436
441 inline void AbstractTrack::setId(std::uint64_t id)
442{
443 m_id = id;
444}
445
449 inline const std::string AbstractTrack::name() const
450{
451 return m_name;
452}
453
458 inline void AbstractTrack::setName(std::string_view name)
459{
460 m_name = name;
461}
462
466 inline const CppUtilities::TimeSpan &AbstractTrack::duration() const
467{
468 return m_duration;
469}
470
474 inline double AbstractTrack::bitrate() const
475{
476 return m_bitrate;
477}
478
482 inline double AbstractTrack::maxBitrate() const
483{
484 return m_maxBitrate;
485}
486
490 inline const CppUtilities::DateTime &AbstractTrack::creationTime() const
491{
492 return m_creationTime;
493}
494
498 inline const CppUtilities::DateTime &AbstractTrack::modificationTime() const
499{
500 return m_modificationTime;
501}
502
508 inline const Locale &AbstractTrack::locale() const
509{
510 return m_locale;
511}
512
517 inline void AbstractTrack::setLocale(const Locale &locale)
518{
519 m_locale = locale;
520}
521
525 inline std::uint32_t AbstractTrack::samplingFrequency() const
526{
527 return m_samplingFrequency;
528}
529
534 inline std::uint32_t AbstractTrack::extensionSamplingFrequency() const
535{
536 return m_extensionSamplingFrequency;
537}
538
542 inline std::uint16_t AbstractTrack::bitsPerSample() const
543{
544 return m_bitsPerSample;
545}
546
552 inline std::uint16_t AbstractTrack::channelCount() const
553{
554 return m_channelCount;
555}
556
563 inline std::uint8_t AbstractTrack::channelConfig() const
564{
565 return m_channelConfig;
566}
567
571 inline std::uint64_t AbstractTrack::sampleCount() const
572{
573 return m_sampleCount;
574}
575
581 inline int AbstractTrack::quality() const
582{
583 return m_quality;
584}
585
591 inline const Size &AbstractTrack::pixelSize() const
592{
593 return m_pixelSize;
594}
595
601 inline const Size &AbstractTrack::displaySize() const
602{
603 return m_displaySize;
604}
605
611 inline const Size &AbstractTrack::resolution() const
612{
613 return m_resolution;
614}
615
619 inline const std::string &AbstractTrack::compressorName() const
620{
621 return m_compressorName;
622}
623
628 inline void AbstractTrack::setCompressorName(std::string_view compressorName)
629{
630 m_compressorName = compressorName;
631}
632
636 inline std::uint16_t AbstractTrack::depth() const
637{
638 return m_depth;
639}
640
646 inline std::uint32_t AbstractTrack::fps() const
647{
648 return m_fps;
649}
650
656 inline std::string_view AbstractTrack::chromaFormat() const
657{
658 return m_chromaFormat;
659}
660
664 inline const AspectRatio &AbstractTrack::pixelAspectRatio() const
665{
666 return m_pixelAspectRatio;
667}
668
674 inline bool AbstractTrack::isInterlaced() const
675{
676 return m_flags & TrackFlags::Interlaced;
677}
678
684 inline std::uint32_t AbstractTrack::timeScale() const
685{
686 return m_timeScale;
687}
688
692 inline bool AbstractTrack::isEnabled() const
693{
694 return m_flags & TrackFlags::Enabled;
695}
696
701 inline void AbstractTrack::setEnabled(bool enabled)
702{
703 CppUtilities::modFlagEnum(m_flags, TrackFlags::Enabled, enabled);
704}
705
709 inline bool AbstractTrack::isDefault() const
710{
711 return m_flags & TrackFlags::Default;
712}
713
718 inline void AbstractTrack::setDefault(bool isDefault)
719{
720 CppUtilities::modFlagEnum(m_flags, TrackFlags::Default, isDefault);
721}
722
726 inline bool AbstractTrack::isForced() const
727{
728 return m_flags & TrackFlags::Forced;
729}
730
735 inline void AbstractTrack::setForced(bool forced)
736{
737 CppUtilities::modFlagEnum(m_flags, TrackFlags::Forced, forced);
738}
739
743 inline bool AbstractTrack::hasLacing() const
744{
745 return m_flags & TrackFlags::Lacing;
746}
747
751 inline bool AbstractTrack::isEncrypted() const
752{
753 return m_flags & TrackFlags::Encrypted;
754}
755
759 inline std::uint32_t AbstractTrack::colorSpace() const
760{
761 return m_colorSpace;
762}
763
767 inline const Margin &AbstractTrack::cropping() const
768{
769 return m_cropping;
770}
771
775 inline bool AbstractTrack::isHeaderValid() const
776{
777 return m_flags & TrackFlags::HeaderValid;
778}
779
780} // namespace TagParser
781
782#endif // TAG_PARSER_ABSTRACTTRACK_H
aspectratio.h
TagParser::AbortableProgressFeedback
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
Definition progressfeedback.h:186
TagParser::AbstractTrack::id
std::uint64_t id() const
Returns the track ID if known; otherwise returns 0.
Definition abstracttrack.h:432
TagParser::AbstractTrack::m_flags
TrackFlags m_flags
Definition abstracttrack.h:197
TagParser::AbstractTrack::m_ostream
std::ostream * m_ostream
Definition abstracttrack.h:193
TagParser::AbstractTrack::formatAbbreviation
std::string_view formatAbbreviation() const
Returns the a more or less common abbreviation for the format of the track if known; otherwise return...
Definition abstracttrack.h:360
TagParser::AbstractTrack::size
std::uint64_t size() const
Returns the size in bytes if known; otherwise returns 0.
Definition abstracttrack.h:394
TagParser::AbstractTrack::m_colorSpace
std::uint32_t m_colorSpace
Definition abstracttrack.h:232
TagParser::AbstractTrack::timeScale
std::uint32_t timeScale() const
Returns the time scale if known; otherwise returns 0.
Definition abstracttrack.h:684
TagParser::AbstractTrack::label
std::string label() const
Returns a label for the track.
Definition abstracttrack.cpp:131
TagParser::AbstractTrack::modificationTime
const CppUtilities::DateTime & modificationTime() const
Returns the time of the last modification if known; otherwise returns a DateTime of zero ticks.
Definition abstracttrack.h:498
TagParser::AbstractTrack::internalParseHeader
virtual void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress)=0
This method is internally called to parse header information.
TagParser::AbstractTrack::m_extensionChannelConfig
std::uint8_t m_extensionChannelConfig
Definition abstracttrack.h:219
TagParser::AbstractTrack::m_displaySize
Size m_displaySize
Definition abstracttrack.h:224
TagParser::AbstractTrack::extensionSamplingFrequency
std::uint32_t extensionSamplingFrequency() const
Returns the number of samples per second if known; otherwise returns 0.
Definition abstracttrack.h:534
TagParser::AbstractTrack::m_chromaFormat
std::string_view m_chromaFormat
Definition abstracttrack.h:229
TagParser::AbstractTrack::m_sampleCount
std::uint64_t m_sampleCount
Definition abstracttrack.h:221
TagParser::AbstractTrack::depth
std::uint16_t depth() const
Returns the bit depth if known; otherwise returns 0.
Definition abstracttrack.h:636
TagParser::AbstractTrack::startOffset
std::uint64_t startOffset() const
Returns the start offset of the track in the associated stream.
Definition abstracttrack.h:316
TagParser::AbstractTrack::locale
const Locale & locale() const
Returns the locale of the track if known; otherwise returns an empty locale.
Definition abstracttrack.h:508
TagParser::AbstractTrack::m_bytesPerSecond
std::uint32_t m_bytesPerSecond
Definition abstracttrack.h:216
TagParser::AbstractTrack::extensionChannelConfigString
std::string_view extensionChannelConfigString() const
Returns a string with the extension channel configuration if available; otherwise returns nullptr.
Definition abstracttrack.cpp:115
TagParser::AbstractTrack::compressorName
const std::string & compressorName() const
Returns the compressor name if known; otherwise returns an empty string.
Definition abstracttrack.h:619
TagParser::AbstractTrack::m_version
double m_version
Definition abstracttrack.h:202
TagParser::AbstractTrack::creationTime
const CppUtilities::DateTime & creationTime() const
Returns the creation time if known; otherwise returns a DateTime of zero ticks.
Definition abstracttrack.h:490
TagParser::AbstractTrack::bitrate
double bitrate() const
Returns the average bitrate in kbit/s if known; otherwise returns zero.
Definition abstracttrack.h:474
TagParser::AbstractTrack::m_quality
int m_quality
Definition abstracttrack.h:222
TagParser::AbstractTrack::m_aspectRatioType
AspectRatioType m_aspectRatioType
Definition abstracttrack.h:238
TagParser::AbstractTrack::formatName
std::string_view formatName() const
Returns the format of the track if known; otherwise returns the format abbreviation or an empty strin...
Definition abstracttrack.h:351
TagParser::AbstractTrack::m_formatName
std::string m_formatName
Definition abstracttrack.h:200
TagParser::AbstractTrack::m_pixelAspectRatio
AspectRatio m_pixelAspectRatio
Definition abstracttrack.h:230
TagParser::AbstractTrack::m_depth
std::uint16_t m_depth
Definition abstracttrack.h:227
TagParser::AbstractTrack::m_resolution
Size m_resolution
Definition abstracttrack.h:225
TagParser::AbstractTrack::displaySize
const Size & displaySize() const
Returns the size of the video frames to display if known; otherwise returns a zero size.
Definition abstracttrack.h:601
TagParser::AbstractTrack::m_size
std::uint64_t m_size
Definition abstracttrack.h:203
TagParser::AbstractTrack::setEnabled
void setEnabled(bool enabled)
Sets whether the track is enabled.
Definition abstracttrack.h:701
TagParser::AbstractTrack::version
double version() const
Returns the version/level of the track if known; otherwise returns 0.
Definition abstracttrack.h:341
TagParser::AbstractTrack::pixelSize
const Size & pixelSize() const
Returns the size of the encoded video frames if known; otherwise returns a zero size.
Definition abstracttrack.h:591
TagParser::AbstractTrack::m_bitsPerSample
std::uint16_t m_bitsPerSample
Definition abstracttrack.h:215
TagParser::AbstractTrack::setDefault
void setDefault(bool isDefault)
Sets whether the track is a default track.
Definition abstracttrack.h:718
TagParser::AbstractTrack::extensionChannelConfig
std::uint8_t extensionChannelConfig() const
Returns the extension channel configuration if available; otherwise returns nullptr.
Definition abstracttrack.cpp:107
TagParser::AbstractTrack::m_trackNumber
std::uint32_t m_trackNumber
Definition abstracttrack.h:204
TagParser::AbstractTrack::m_name
std::string m_name
Definition abstracttrack.h:206
TagParser::AbstractTrack::m_formatId
std::string m_formatId
Definition abstracttrack.h:199
TagParser::AbstractTrack::setId
void setId(std::uint64_t id)
Sets the track ID.
Definition abstracttrack.h:441
TagParser::AbstractTrack::inputStream
std::istream & inputStream()
Returns the associated input stream.
Definition abstracttrack.h:248
TagParser::AbstractTrack::type
virtual TrackType type() const
Returns the type of the track if known; otherwise returns TrackType::Unspecified.
Definition abstracttrack.h:308
TagParser::AbstractTrack::m_pixelSize
Size m_pixelSize
Definition abstracttrack.h:223
TagParser::AbstractTrack::setCompressorName
void setCompressorName(std::string_view compressorName)
Returns the compressor name if known; otherwise returns an empty string.
Definition abstracttrack.h:628
TagParser::AbstractTrack::m_cropping
Margin m_cropping
Definition abstracttrack.h:233
TagParser::AbstractTrack::AbstractTrack
AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
Constructs a new track.
Definition abstracttrack.cpp:33
TagParser::AbstractTrack::isEnabled
bool isEnabled() const
Returns true if the track is marked as enabled; otherwise returns false.
Definition abstracttrack.h:692
TagParser::AbstractTrack::m_channelCount
std::uint16_t m_channelCount
Definition abstracttrack.h:217
TagParser::AbstractTrack::hasLacing
bool hasLacing() const
Returns true if the track has lacing; otherwise returns false.
Definition abstracttrack.h:743
TagParser::AbstractTrack::sampleCount
std::uint64_t sampleCount() const
Returns the number of samples/frames if known; otherwise returns 0.
Definition abstracttrack.h:571
TagParser::AbstractTrack::m_channelConfig
std::uint8_t m_channelConfig
Definition abstracttrack.h:218
TagParser::AbstractTrack::samplingFrequency
std::uint32_t samplingFrequency() const
Returns the number of samples per second if known; otherwise returns 0.
Definition abstracttrack.h:525
TagParser::AbstractTrack::pixelAspectRatio
const AspectRatio & pixelAspectRatio() const
Returns the pixel aspect ratio (PAR).
Definition abstracttrack.h:664
TagParser::AbstractTrack::reader
CppUtilities::BinaryReader & reader()
Returns a binary reader for the associated stream.
Definition abstracttrack.h:289
TagParser::AbstractTrack::Mp4Track
friend class Mp4Track
Definition abstracttrack.h:113
TagParser::AbstractTrack::m_duration
CppUtilities::TimeSpan m_duration
Definition abstracttrack.h:207
TagParser::AbstractTrack::trackNumber
std::uint32_t trackNumber() const
Returns the track number if known; otherwise returns 0.
Definition abstracttrack.h:415
TagParser::AbstractTrack::formatId
const std::string & formatId() const
Returns the format/codec ID.
Definition abstracttrack.h:370
TagParser::AbstractTrack::m_reader
CppUtilities::BinaryReader m_reader
Definition abstracttrack.h:194
TagParser::AbstractTrack::quality
int quality() const
Returns the quality if known; otherwise returns 0.
Definition abstracttrack.h:581
TagParser::AbstractTrack::fps
std::uint32_t fps() const
Returns the number of frames per second if known; otherwise returns 0.
Definition abstracttrack.h:646
TagParser::AbstractTrack::setName
void setName(std::string_view name)
Sets the name.
Definition abstracttrack.h:458
TagParser::AbstractTrack::shortDescription
std::string shortDescription() const
Returns a short description about the track.
Definition abstracttrack.cpp:226
TagParser::AbstractTrack::m_chunkSize
std::uint16_t m_chunkSize
Definition abstracttrack.h:220
TagParser::AbstractTrack::mediaTypeName
std::string_view mediaTypeName() const
Returns the string representation of the media type of the track.
Definition abstracttrack.h:386
TagParser::AbstractTrack::m_startOffset
std::uint64_t m_startOffset
Definition abstracttrack.h:196
TagParser::AbstractTrack::colorSpace
std::uint32_t colorSpace() const
Returns the color space if known; otherwise returns 0.
Definition abstracttrack.h:759
TagParser::AbstractTrack::m_maxBitrate
double m_maxBitrate
Definition abstracttrack.h:209
TagParser::AbstractTrack::flags
TrackFlags flags() const
Returns flags (various boolean properties) of this track.
Definition abstracttrack.h:325
TagParser::AbstractTrack::parseHeader
void parseHeader(Diagnostics &diag, AbortableProgressFeedback &progress)
Parses technical information about the track from the header.
Definition abstracttrack.cpp:243
TagParser::AbstractTrack::m_timeScale
std::uint32_t m_timeScale
Definition abstracttrack.h:231
TagParser::AbstractTrack::mediaType
MediaType mediaType() const
Returns the media type if known; otherwise returns MediaType::Other.
Definition abstracttrack.h:378
TagParser::AbstractTrack::m_modificationTime
CppUtilities::DateTime m_modificationTime
Definition abstracttrack.h:211
TagParser::AbstractTrack::m_alphaMode
AlphaMode m_alphaMode
Definition abstracttrack.h:236
TagParser::AbstractTrack::setTrackNumber
void setTrackNumber(std::uint32_t trackNumber)
Sets the track number.
Definition abstracttrack.h:424
TagParser::AbstractTrack::m_writer
CppUtilities::BinaryWriter m_writer
Definition abstracttrack.h:195
TagParser::AbstractTrack::channelCount
std::uint16_t channelCount() const
Returns the number of channels if known; otherwise returns 0.
Definition abstracttrack.h:552
TagParser::AbstractTrack::bitsPerSample
std::uint16_t bitsPerSample() const
Returns the number of bits per sample; otherwise returns 0.
Definition abstracttrack.h:542
TagParser::AbstractTrack::isHeaderValid
bool isHeaderValid() const
Returns an indication whether the track header is valid.
Definition abstracttrack.h:775
TagParser::AbstractTrack::setOutputStream
void setOutputStream(std::ostream &stream)
Assigns another output stream.
Definition abstracttrack.h:278
TagParser::AbstractTrack::outputStream
std::ostream & outputStream()
Returns the associated output stream.
Definition abstracttrack.h:267
TagParser::AbstractTrack::setForced
void setForced(bool forced)
Sets whether the track is forced.
Definition abstracttrack.h:735
TagParser::AbstractTrack::m_fps
std::uint32_t m_fps
Definition abstracttrack.h:228
TagParser::AbstractTrack::setInputStream
void setInputStream(std::istream &stream)
Assigns another input stream.
Definition abstracttrack.h:259
TagParser::AbstractTrack::maxBitrate
double maxBitrate() const
Returns the maximum bitrate in kbit/s if known; otherwise returns zero.
Definition abstracttrack.h:482
TagParser::AbstractTrack::duration
const CppUtilities::TimeSpan & duration() const
Returns the duration if known; otherwise returns a TimeSpan of zero ticks.
Definition abstracttrack.h:466
TagParser::AbstractTrack::m_extensionSamplingFrequency
std::uint32_t m_extensionSamplingFrequency
Definition abstracttrack.h:214
TagParser::AbstractTrack::channelConfigString
std::string_view channelConfigString() const
Returns a string with the channel configuration if available; otherwise returns nullptr.
Definition abstracttrack.cpp:91
TagParser::AbstractTrack::chromaFormat
std::string_view chromaFormat() const
Returns the chroma subsampling format if known; otherwise returns nullptr.
Definition abstracttrack.h:656
TagParser::AbstractTrack::isForced
bool isForced() const
Returns true if the track is marked as forced; otherwise returns false.
Definition abstracttrack.h:726
TagParser::AbstractTrack::m_locale
Locale m_locale
Definition abstracttrack.h:212
TagParser::AbstractTrack::isEncrypted
bool isEncrypted() const
Returns true if the track is marked as encrypted; otherwise returns false.
Definition abstracttrack.h:751
TagParser::AbstractTrack::channelConfig
std::uint8_t channelConfig() const
Returns the channel configuration.
Definition abstracttrack.h:563
TagParser::AbstractTrack::MpegAudioFrameStream
friend class MpegAudioFrameStream
Definition abstracttrack.h:111
TagParser::AbstractTrack::WaveAudioStream
friend class WaveAudioStream
Definition abstracttrack.h:112
TagParser::AbstractTrack::resolution
const Size & resolution() const
Returns the resolution if known; otherwise returns a zero size.
Definition abstracttrack.h:611
TagParser::AbstractTrack::name
const std::string name() const
Returns the track name if known; otherwise returns an empty string.
Definition abstracttrack.h:449
TagParser::AbstractTrack::isDefault
bool isDefault() const
Returns true if the track is marked as default; otherwise returns false.
Definition abstracttrack.h:709
TagParser::AbstractTrack::m_creationTime
CppUtilities::DateTime m_creationTime
Definition abstracttrack.h:210
TagParser::AbstractTrack::setLocale
void setLocale(const Locale &locale)
Sets the locale of the track.
Definition abstracttrack.h:517
TagParser::AbstractTrack::m_fieldOrder
FieldOrder m_fieldOrder
Definition abstracttrack.h:234
TagParser::AbstractTrack::m_format
MediaFormat m_format
Definition abstracttrack.h:198
TagParser::AbstractTrack::m_bitrate
double m_bitrate
Definition abstracttrack.h:208
TagParser::AbstractTrack::m_compressorName
std::string m_compressorName
Definition abstracttrack.h:226
TagParser::AbstractTrack::m_istream
std::istream * m_istream
Definition abstracttrack.h:192
TagParser::AbstractTrack::m_samplingFrequency
std::uint32_t m_samplingFrequency
Definition abstracttrack.h:213
TagParser::AbstractTrack::isInterlaced
bool isInterlaced() const
Returns true if the video is interlaced; otherwise returns false.
Definition abstracttrack.h:674
TagParser::AbstractTrack::cropping
const Margin & cropping() const
Returns the cropping if known; otherwise returns zero margins.
Definition abstracttrack.h:767
TagParser::AbstractTrack::description
std::string description() const
Returns a description about the track.
Definition abstracttrack.cpp:212
TagParser::AbstractTrack::writer
CppUtilities::BinaryWriter & writer()
Returns a binary writer for the associated stream.
Definition abstracttrack.h:300
TagParser::AbstractTrack::m_p
std::unique_ptr< AbstractTrackPrivate > m_p
Definition abstracttrack.h:239
TagParser::AbstractTrack::m_stereoMode
StereoMode m_stereoMode
Definition abstracttrack.h:235
TagParser::AbstractTrack::setSize
void setSize(std::uint64_t size)
Sets the size in bytes.
Definition abstracttrack.h:407
TagParser::AbstractTrack::m_displayUnit
DisplayUnit m_displayUnit
Definition abstracttrack.h:237
TagParser::AbstractTrack::m_id
std::uint64_t m_id
Definition abstracttrack.h:205
TagParser::AbstractTrack::m_mediaType
MediaType m_mediaType
Definition abstracttrack.h:201
TagParser::AbstractTrack::format
MediaFormat format() const
Returns the format of the track if known; otherwise returns MediaFormat::Unknown.
Definition abstracttrack.h:333
TagParser::AdtsStream
Implementation of TagParser::AbstractTrack for ADTS streams.
Definition adtsstream.h:10
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition diagnostics.h:156
TagParser::FlacStream
Implementation of TagParser::AbstractTrack for raw FLAC streams.
Definition flacstream.h:14
TagParser::IvfStream
Implementation of TagParser::AbstractTrack for IVF streams.
Definition ivfstream.h:10
TagParser::Margin
The Margin class defines the four margins of a rectangle.
Definition margin.h:16
TagParser::MatroskaTrack
Implementation of TagParser::AbstractTrack for the Matroska container.
Definition matroskatrack.h:48
TagParser::MediaFormat
The MediaFormat class specifies the format of media data.
Definition mediaformat.h:247
TagParser::Mp4Track
Implementation of TagParser::AbstractTrack for the MP4 container.
Definition mp4track.h:120
TagParser::MpegAudioFrameStream
Implementation of TagParser::AbstractTrack MPEG audio streams.
Definition mpegaudioframestream.h:12
TagParser::OggStream
Implementation of TagParser::AbstractTrack for Ogg streams.
Definition oggstream.h:13
TagParser::Size
The Size class defines the size of a two-dimensional object using integer point precision.
Definition size.h:17
TagParser::WaveAudioStream
Implementation of TagParser::AbstractTrack for the RIFF WAVE container format.
Definition waveaudiostream.h:51
diagnostics.h
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
localehelper.h
margin.h
mediaformat.h
TagParser::SubFormats::None
@ None
Definition mediaformat.h:112
TagParser
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
TagParser::AspectRatioType
AspectRatioType
The AspectRatioType enum specifies the possible modifications to the aspect ratio.
Definition abstracttrack.h:95
TagParser::AspectRatioType::Fixed
@ Fixed
Definition abstracttrack.h:98
TagParser::AspectRatioType::FreeResizing
@ FreeResizing
Definition abstracttrack.h:96
TagParser::AspectRatioType::KeepAspectRatio
@ KeepAspectRatio
Definition abstracttrack.h:97
TagParser::StereoMode
StereoMode
The StereoMode enum specifies the Stereo-3D video mode.
Definition abstracttrack.h:76
TagParser::StereoMode::Unknown
@ Unknown
Definition abstracttrack.h:77
TagParser::DisplayUnit
DisplayUnit
The DisplayUnit enum specifies how display width and heigh are interpreted.
Definition abstracttrack.h:90
TagParser::DisplayUnit::DisplayAspectRatio
@ DisplayAspectRatio
Definition abstracttrack.h:90
TagParser::DisplayUnit::Centimeters
@ Centimeters
Definition abstracttrack.h:90
TagParser::DisplayUnit::Pixels
@ Pixels
Definition abstracttrack.h:90
TagParser::DisplayUnit::Inches
@ Inches
Definition abstracttrack.h:90
TagParser::AlphaMode
AlphaMode
The AlphaMode enum specifies the alpha video mode.
Definition abstracttrack.h:83
TagParser::MediaType
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
Definition mediaformat.h:14
TagParser::FieldOrder
FieldOrder
The FieldOrder enum declares the field ordering of the video.
Definition abstracttrack.h:63
TagParser::FieldOrder::Tff
@ Tff
Definition abstracttrack.h:65
TagParser::FieldOrder::BffSwapped
@ BffSwapped
Definition abstracttrack.h:68
TagParser::FieldOrder::Progressive
@ Progressive
Definition abstracttrack.h:64
TagParser::FieldOrder::Undetermined
@ Undetermined
Definition abstracttrack.h:66
TagParser::FieldOrder::TffSwapped
@ TffSwapped
Definition abstracttrack.h:69
TagParser::FieldOrder::Bff
@ Bff
Definition abstracttrack.h:67
TagParser::TrackType
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...
Definition abstracttrack.h:32
TagParser::TrackType::Unspecified
@ Unspecified
Definition abstracttrack.h:33
TagParser::TrackFlags
TrackFlags
The TrackFlags enum specifies miscellaneous boolean properties of a track.
Definition abstracttrack.h:47
TagParser::TrackFlags::Enabled
@ Enabled
Definition abstracttrack.h:50
TagParser::TrackFlags::HeaderValid
@ HeaderValid
Definition abstracttrack.h:49
TagParser::TrackFlags::Interlaced
@ Interlaced
Definition abstracttrack.h:57
TagParser::TrackFlags::Default
@ Default
Definition abstracttrack.h:51
TagParser::TrackFlags::UsedWhenPreviewing
@ UsedWhenPreviewing
Definition abstracttrack.h:56
TagParser::TrackFlags::UsedInPresentation
@ UsedInPresentation
Definition abstracttrack.h:55
TagParser::TrackFlags::Lacing
@ Lacing
Definition abstracttrack.h:53
TagParser::TrackFlags::Forced
@ Forced
Definition abstracttrack.h:52
TagParser::TrackFlags::Encrypted
@ Encrypted
Definition abstracttrack.h:54
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS
CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::TagCreationFlags)
size.h
TagParser::AbstractTrackPrivate
The AbstractTrackPrivate struct contains private fields of the AbstractTrack class.
Definition abstracttrack.cpp:15
TagParser::AspectRatio
The AspectRatio struct defines an aspect ratio.
Definition aspectratio.h:13
TagParser::Locale
The Locale struct specifies a language and/or a country using one or more LocaleDetail objects.
Definition localehelper.h:61