1#ifndef TAG_PARSER_ADTSFRAME_H
2#define TAG_PARSER_ADTSFRAME_H
16 constexpr AdtsFrame();
18 void parseHeader(CppUtilities::BinaryReader &reader);
20 constexpr bool isValid()
const;
21 constexpr bool isMpeg4()
const;
22 constexpr bool hasCrc()
const;
23 constexpr std::uint8_t mpeg4AudioObjectId()
const;
24 constexpr std::uint8_t mpeg4SamplingFrequencyIndex()
const;
25 constexpr std::uint8_t mpeg4ChannelConfig()
const;
26 constexpr std::uint16_t totalSize()
const;
27 constexpr std::uint8_t headerSize()
const;
28 constexpr std::uint16_t dataSize()
const;
29 constexpr std::uint16_t bufferFullness()
const;
30 constexpr std::uint8_t frameCount()
const;
31 constexpr std::uint16_t crc()
const;
34 std::uint16_t m_header1;
35 std::uint64_t m_header2;
60 return m_header1 & 0x8u;
68 return (m_header1 & 0x1u) == 0;
78 return static_cast<std::uint8_t
>((m_header2 >> 0x36) + 0x1u);
87 return static_cast<std::uint8_t
>((m_header2 >> 0x32) & 0xFu);
97 return static_cast<std::uint8_t
>((m_header2 >> 0x2E) & 0x7u);
105 return static_cast<std::uint8_t
>((m_header2 >> 0x1D) & 0x1FFFu);
113 return static_cast<std::uint8_t
>(
hasCrc() ? 9 : 7);
129 return (m_header2 >> 0x12) & 0x7FFu;
137 return ((m_header2 >> 0x10) & 0x3u) + 0x1u;
146 return m_header2 & 0xFFFFu;
constexpr std::uint16_t dataSize() const
Returns the data size (total size minus header size) in bytes.
constexpr std::uint16_t totalSize() const
Returns the size of the frame (including the header) in bytes.
constexpr bool hasCrc() const
Returns whether a CRC-16 checksum is present ("protection absent" bit is NOT set).
constexpr bool isValid() const
Returns an indication whether the frame is valid.
constexpr std::uint16_t bufferFullness() const
Returns the buffer fullness.
constexpr std::uint8_t mpeg4ChannelConfig() const
Returns the MPEG-4 channel configuration.
constexpr AdtsFrame()
Constructs a new frame.
constexpr std::uint16_t crc() const
Returns the CRC-16 checksum of the frame.
constexpr bool isMpeg4() const
Returns whether the MPEG version is MPEG-4; otherwise the MPEG version is MPEG-2.
constexpr std::uint8_t headerSize() const
Returns the header size in bytes (9 if CRC is present; otherwise 7).
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 frameCount() const
Returns the number of AAC frames (RDBs) in the ADTS frame.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.