Tag Parser 12.1.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TagParser::AdtsFrame Class Reference

The AdtsFrame class is used to parse "Audio Data Transport Stream" frames. More...

#include <adtsframe.h>

Public Member Functions

constexpr AdtsFrame ()
 Constructs a new frame.
 
void parseHeader (CppUtilities::BinaryReader &reader)
 Parses the header read using the specified reader.
 
constexpr bool isValid () const
 Returns an indication whether the frame is valid.
 
constexpr bool isMpeg4 () const
 Returns whether the MPEG version is MPEG-4; otherwise the MPEG version is MPEG-2.
 
constexpr bool hasCrc () const
 Returns whether a CRC-16 checksum is present ("protection absent" bit is NOT set).
 
constexpr std::uint8_t mpeg4AudioObjectId () const
 Returns the MPEG-4 audio object type ID.
 
constexpr std::uint8_t mpeg4SamplingFrequencyIndex () const
 Returns the MPEG-4 sample rate index.
 
constexpr std::uint8_t mpeg4ChannelConfig () const
 Returns the MPEG-4 channel configuration.
 
constexpr std::uint16_t totalSize () const
 Returns the size of the frame (including the header) in bytes.
 
constexpr std::uint8_t headerSize () const
 Returns the header size in bytes (9 if CRC is present; otherwise 7).
 
constexpr std::uint16_t dataSize () const
 Returns the data size (total size minus header size) in bytes.
 
constexpr std::uint16_t bufferFullness () const
 Returns the buffer fullness.
 
constexpr std::uint8_t frameCount () const
 Returns the number of AAC frames (RDBs) in the ADTS frame.
 
constexpr std::uint16_t crc () const
 Returns the CRC-16 checksum of the frame.
 

Detailed Description

The AdtsFrame class is used to parse "Audio Data Transport Stream" frames.

Definition at line 14 of file adtsframe.h.

Constructor & Destructor Documentation

◆ AdtsFrame()

constexpr TagParser::AdtsFrame::AdtsFrame ( )
constexpr

Constructs a new frame.

Definition at line 41 of file adtsframe.h.

Member Function Documentation

◆ bufferFullness()

constexpr std::uint16_t TagParser::AdtsFrame::bufferFullness ( ) const
constexpr

Returns the buffer fullness.

Definition at line 127 of file adtsframe.h.

◆ crc()

constexpr std::uint16_t TagParser::AdtsFrame::crc ( ) const
constexpr

Returns the CRC-16 checksum of the frame.

See also
hasCrc()

Definition at line 144 of file adtsframe.h.

◆ dataSize()

constexpr std::uint16_t TagParser::AdtsFrame::dataSize ( ) const
constexpr

Returns the data size (total size minus header size) in bytes.

Definition at line 119 of file adtsframe.h.

◆ frameCount()

constexpr std::uint8_t TagParser::AdtsFrame::frameCount ( ) const
constexpr

Returns the number of AAC frames (RDBs) in the ADTS frame.

Definition at line 135 of file adtsframe.h.

◆ hasCrc()

constexpr bool TagParser::AdtsFrame::hasCrc ( ) const
constexpr

Returns whether a CRC-16 checksum is present ("protection absent" bit is NOT set).

Definition at line 66 of file adtsframe.h.

◆ headerSize()

constexpr std::uint8_t TagParser::AdtsFrame::headerSize ( ) const
constexpr

Returns the header size in bytes (9 if CRC is present; otherwise 7).

Definition at line 111 of file adtsframe.h.

◆ isMpeg4()

constexpr bool TagParser::AdtsFrame::isMpeg4 ( ) const
constexpr

Returns whether the MPEG version is MPEG-4; otherwise the MPEG version is MPEG-2.

Definition at line 58 of file adtsframe.h.

◆ isValid()

constexpr bool TagParser::AdtsFrame::isValid ( ) const
constexpr

Returns an indication whether the frame is valid.

Definition at line 50 of file adtsframe.h.

◆ mpeg4AudioObjectId()

constexpr std::uint8_t TagParser::AdtsFrame::mpeg4AudioObjectId ( ) const
constexpr

Returns the MPEG-4 audio object type ID.

See also
TagParser::Mpeg4AudioObjectIds
Mpeg4AudioObjectIds::idToMediaFormat()

Definition at line 76 of file adtsframe.h.

◆ mpeg4ChannelConfig()

constexpr std::uint8_t TagParser::AdtsFrame::mpeg4ChannelConfig ( ) const
constexpr

Returns the MPEG-4 channel configuration.

See also
TagParser::Mpeg4ChannelConfigs
TagParser::mpeg4SampleRateTable::channelConfigString()

Definition at line 95 of file adtsframe.h.

◆ mpeg4SamplingFrequencyIndex()

constexpr std::uint8_t TagParser::AdtsFrame::mpeg4SamplingFrequencyIndex ( ) const
constexpr

Returns the MPEG-4 sample rate index.

See also
TagParser::mpeg4SampleRateTable

Definition at line 85 of file adtsframe.h.

◆ parseHeader()

void TagParser::AdtsFrame::parseHeader ( CppUtilities::BinaryReader &  reader)

Parses the header read using the specified reader.

Exceptions
ThrowsInvalidDataException if the data read from the stream is no valid frame header.

Definition at line 21 of file adtsframe.cpp.

◆ totalSize()

constexpr std::uint16_t TagParser::AdtsFrame::totalSize ( ) const
constexpr

Returns the size of the frame (including the header) in bytes.

Definition at line 103 of file adtsframe.h.


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