Tag Parser  9.2.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | Protected Member Functions | Friends | List of all members
TagParser::OggStream Class Reference

Implementation of TagParser::AbstractTrack for OGG streams. More...

#include <oggstream.h>

Inheritance diagram for TagParser::OggStream:
[legend]
Collaboration diagram for TagParser::OggStream:
[legend]

Public Member Functions

 OggStream (OggContainer &container, std::vector< OggPage >::size_type startPage)
 Constructs a new track for the stream at the specified startOffset. More...
 
 ~OggStream () override
 Destroys the track. More...
 
TrackType type () const override
 Returns the type of the track if known; otherwise returns TrackType::Unspecified. More...
 
std::size_t startPage () const
 
- Public Member Functions inherited from TagParser::AbstractTrack
virtual ~AbstractTrack ()
 Destroys the track. More...
 
std::istream & inputStream ()
 Returns the associated input stream. More...
 
void setInputStream (std::istream &stream)
 Assigns another input stream. More...
 
std::ostream & outputStream ()
 Returns the associated output stream. More...
 
void setOutputStream (std::ostream &stream)
 Assigns another output stream. More...
 
CppUtilities::BinaryReader & reader ()
 Returns a binary reader for the associated stream. More...
 
CppUtilities::BinaryWriter & writer ()
 Returns a binary writer for the associated stream. More...
 
std::uint64_t startOffset () const
 Returns the start offset of the track in the associated stream. More...
 
MediaFormat format () const
 Returns the format of the track if known; otherwise returns MediaFormat::Unknown. More...
 
double version () const
 Returns the version/level of the track if known; otherwise returns 0. More...
 
const char * formatName () const
 Returns the format of the track as C-style string if known; otherwise returns the format abbreviation or an empty string. More...
 
const char * formatAbbreviation () const
 Returns the a more or less common abbreviation for the format of the track as C-style string if known; otherwise returns an empty string. More...
 
const std::string & formatId () const
 Returns the format/codec ID. More...
 
MediaType mediaType () const
 Returns the media type if known; otherwise returns MediaType::Other. More...
 
const char * mediaTypeName () const
 Returns the string representation of the media type of the track. More...
 
std::uint64_t size () const
 Returns the size in bytes if known; otherwise returns 0. More...
 
std::uint32_t trackNumber () const
 Returns the track number if known; otherwise returns 0. More...
 
void setTrackNumber (std::uint32_t trackNumber)
 Sets the track number. More...
 
std::uint64_t id () const
 Returns the track ID if known; otherwise returns 0. More...
 
void setId (std::uint64_t id)
 Sets the track ID. More...
 
const std::string name () const
 Returns the track name if known; otherwise returns an empty string. More...
 
void setName (const std::string &name)
 Sets the name. More...
 
const CppUtilities::TimeSpan & duration () const
 Returns the duration if known; otherwise returns a TimeSpan of zero ticks. More...
 
double bitrate () const
 Returns the average bitrate in kbit/s if known; otherwise returns zero. More...
 
double maxBitrate () const
 Returns the maximum bitrate in kbit/s if known; otherwise returns zero. More...
 
const CppUtilities::DateTime & creationTime () const
 Returns the creation time if known; otherwise returns a DateTime of zero ticks. More...
 
const CppUtilities::DateTime & modificationTime () const
 Returns the time of the last modification if known; otherwise returns a DateTime of zero ticks. More...
 
const std::string & language () const
 Returns the language of the track if known; otherwise returns an empty string. More...
 
void setLanguage (const std::string &language)
 Sets the language of the track. More...
 
std::uint32_t samplingFrequency () const
 Returns the number of samples per second if known; otherwise returns 0. More...
 
std::uint32_t extensionSamplingFrequency () const
 Returns the number of samples per second if known; otherwise returns 0. More...
 
std::uint16_t bitsPerSample () const
 Returns the number of bits per sample; otherwise returns 0. More...
 
std::uint16_t channelCount () const
 Returns the number of channels if known; otherwise returns 0. More...
 
std::uint8_t channelConfig () const
 Returns the channel configuration. More...
 
const char * channelConfigString () const
 Returns a string with the channel configuration if available; otherwise returns nullptr. More...
 
std::uint8_t extensionChannelConfig () const
 Returns the extension channel configuration if available; otherwise returns nullptr. More...
 
const char * extensionChannelConfigString () const
 Returns a string with the extension channel configuration if available; otherwise returns nullptr. More...
 
std::uint64_t sampleCount () const
 Returns the number of samples/frames if known; otherwise returns 0. More...
 
int quality () const
 Returns the quality if known; otherwise returns 0. More...
 
const SizepixelSize () const
 Returns the size of the encoded video frames if known; otherwise returns a zero size. More...
 
const SizedisplaySize () const
 Returns the size of the video frames to display if known; otherwise returns a zero size. More...
 
const Sizeresolution () const
 Returns the resolution if known; otherwise returns a zero size. More...
 
const std::string & compressorName () const
 Returns the compressor name if known; otherwise returns an empty string. More...
 
void setCompressorName (const std::string &compressorName)
 Returns the compressor name if known; otherwise returns an empty string. More...
 
std::uint16_t depth () const
 Returns the bit depth if known; otherwise returns 0. More...
 
std::uint32_t fps () const
 Returns the number of frames per second if known; otherwise returns 0. More...
 
const char * chromaFormat () const
 Returns the chroma subsampling format if known; otherwise returns nullptr. More...
 
const AspectRatiopixelAspectRatio () const
 Returns the pixel aspect ratio (PAR). More...
 
bool isInterlaced () const
 Returns true if the video is denoted as interlaced; otherwise returns false. More...
 
std::uint32_t timeScale () const
 Returns the time scale if known; otherwise returns 0. More...
 
bool isEnabled () const
 Returns true if the track is denoted as enabled; otherwise returns false. More...
 
void setEnabled (bool enabled)
 Sets whether the track is enabled. More...
 
bool isDefault () const
 Returns true if the track is denoted as default; otherwise returns false. More...
 
void setDefault (bool isDefault)
 Sets whether the track is a default track. More...
 
bool isForced () const
 Returns true if the track is denoted as forced; otherwise returns false. More...
 
void setForced (bool forced)
 Sets whether the track is forced. More...
 
bool hasLacing () const
 Returns true if the track has lacing; otherwise returns false. More...
 
bool isEncrypted () const
 Returns true if the track is denoted as encrypted; otherwise returns false. More...
 
std::uint32_t colorSpace () const
 Returns the color space if known; otherwise returns 0. More...
 
const Margincropping () const
 Returns the cropping if known; otherwise returns zero margins. More...
 
std::string label () const
 Returns a label for the track. More...
 
std::string description () const
 Returns a short description about the track. More...
 
void parseHeader (Diagnostics &diag)
 Parses technical information about the track from the header. More...
 
bool isHeaderValid () const
 Returns an indication whether the track header is valid. More...
 

Protected Member Functions

void internalParseHeader (Diagnostics &diag) override
 This method is internally called to parse header information. It needs to be implemented when subclassing this class. More...
 
- Protected Member Functions inherited from TagParser::AbstractTrack
 AbstractTrack (std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
 Constructs a new track. More...
 
 AbstractTrack (std::iostream &stream, std::uint64_t startOffset)
 Constructs a new track. More...
 

Friends

class OggContainer
 

Additional Inherited Members

- Protected Attributes inherited from TagParser::AbstractTrack
std::istream * m_istream
 
std::ostream * m_ostream
 
CppUtilities::BinaryReader m_reader
 
CppUtilities::BinaryWriter m_writer
 
std::uint64_t m_startOffset
 
bool m_headerValid
 
MediaFormat m_format
 
std::string m_formatId
 
std::string m_formatName
 
MediaType m_mediaType
 
double m_version
 
std::uint64_t m_size
 
std::uint32_t m_trackNumber
 
std::uint64_t m_id
 
std::string m_name
 
CppUtilities::TimeSpan m_duration
 
double m_bitrate
 
double m_maxBitrate
 
CppUtilities::DateTime m_creationTime
 
CppUtilities::DateTime m_modificationTime
 
std::string m_language
 
std::uint32_t m_samplingFrequency
 
std::uint32_t m_extensionSamplingFrequency
 
std::uint16_t m_bitsPerSample
 
std::uint32_t m_bytesPerSecond
 
std::uint16_t m_channelCount
 
std::uint8_t m_channelConfig
 
std::uint8_t m_extensionChannelConfig
 
std::uint16_t m_chunkSize
 
std::uint64_t m_sampleCount
 
int m_quality
 
Size m_pixelSize
 
Size m_displaySize
 
Size m_resolution
 
std::string m_compressorName
 
std::uint16_t m_depth
 
std::uint32_t m_fps
 
const char * m_chromaFormat
 
AspectRatio m_pixelAspectRatio
 
bool m_interlaced
 
std::uint32_t m_timeScale
 
bool m_enabled
 
bool m_default
 
bool m_forced
 
bool m_lacing
 
bool m_encrypted
 
bool m_usedInPresentation
 
bool m_usedWhenPreviewing
 
std::uint32_t m_colorSpace
 
Margin m_cropping
 

Detailed Description

Implementation of TagParser::AbstractTrack for OGG streams.

Definition at line 13 of file oggstream.h.

Constructor & Destructor Documentation

◆ OggStream()

TagParser::OggStream::OggStream ( OggContainer container,
std::vector< OggPage >::size_type  startPage 
)

Constructs a new track for the stream at the specified startOffset.

Definition at line 34 of file oggstream.cpp.

◆ ~OggStream()

TagParser::OggStream::~OggStream ( )
override

Destroys the track.

Definition at line 45 of file oggstream.cpp.

Member Function Documentation

◆ internalParseHeader()

void TagParser::OggStream::internalParseHeader ( Diagnostics diag)
overrideprotectedvirtual

This method is internally called to parse header information. It needs to be implemented when subclassing this class.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsTagParser::Failure or a derived exception when a parsing error occurs.

Implements TagParser::AbstractTrack.

Definition at line 49 of file oggstream.cpp.

◆ startPage()

std::size_t TagParser::OggStream::startPage ( ) const
inline

Definition at line 34 of file oggstream.h.

◆ type()

TrackType TagParser::OggStream::type ( ) const
inlineoverridevirtual

Returns the type of the track if known; otherwise returns TrackType::Unspecified.

Reimplemented from TagParser::AbstractTrack.

Definition at line 39 of file oggstream.h.

Friends And Related Function Documentation

◆ OggContainer

friend class OggContainer
friend

Definition at line 14 of file oggstream.h.


The documentation for this class was generated from the following files: