Tag Parser 12.5.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
adtsstream.cpp
Go to the documentation of this file.
1#include "./adtsstream.h"
2
3#include "../mp4/mp4ids.h"
4
5#include "../exceptions.h"
6
7#include <string>
8
9using namespace std;
10
11namespace TagParser {
12
17
19{
20 CPP_UTILITIES_UNUSED(diag)
21 CPP_UTILITIES_UNUSED(progress)
22
23 //static const string context("parsing ADTS frame header");
24 if (!m_istream) {
26 }
27 // parse frame header
28 m_istream->seekg(static_cast<std::streamoff>(m_startOffset), ios_base::beg);
29 m_firstFrame.parseHeader(m_reader);
30 m_format = Mpeg4AudioObjectIds::idToMediaFormat(m_firstFrame.mpeg4AudioObjectId());
31 m_channelCount = Mpeg4ChannelConfigs::channelCount(m_channelConfig = m_firstFrame.mpeg4ChannelConfig());
32 std::uint8_t sampleRateIndex = m_firstFrame.mpeg4SamplingFrequencyIndex();
33 m_samplingFrequency = sampleRateIndex < sizeof(mpeg4SamplingFrequencyTable) ? mpeg4SamplingFrequencyTable[sampleRateIndex] : 0;
34}
35
36} // namespace TagParser
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
CppUtilities::BinaryReader m_reader
std::uint32_t m_samplingFrequency
void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override
This method is internally called to parse header information.
The Diagnostics class is a container for DiagMessage.
The exception that is thrown when the data to be parsed holds no parsable information (e....
Definition exceptions.h:18
TAG_PARSER_EXPORT MediaFormat idToMediaFormat(std::uint8_t mpeg4AudioObjectId, bool sbrPresent=false, bool psPresent=false)
Definition mp4ids.cpp:373
TAG_PARSER_EXPORT std::uint8_t channelCount(std::uint8_t config)
Returns the channel count for the specified MPEG-4 channel config.
Definition mp4ids.cpp:466
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
std::uint32_t mpeg4SamplingFrequencyTable[13]
Definition mp4ids.cpp:429