#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/formats/mpeg/mpeg1_audio_stream_parser.h"
#include "media/base/media_log.h"
namespace media {
namespace {
constexpr uint32_t kMPEG1StartCodeMask = …;
constexpr int kVersionLayerMap[4][4] = …;
constexpr int kBitrateMap[16][6] = …;
constexpr int kSampleRateMap[4][4] = …;
constexpr int kXingHeaderMap[2][2] = …;
constexpr int kBitrateFree = …;
constexpr int kBitrateBad = …;
constexpr int kSampleRateReserved = …;
constexpr int kCodecDelay = …;
}
bool MPEG1AudioStreamParser::ParseHeader(MediaLog* media_log,
size_t* media_log_limit,
const uint8_t* data,
Header* header) { … }
MPEG1AudioStreamParser::MPEG1AudioStreamParser()
: … { … }
MPEG1AudioStreamParser::~MPEG1AudioStreamParser() = default;
int MPEG1AudioStreamParser::ParseFrameHeader(const uint8_t* data,
int size,
int* frame_size,
int* sample_rate,
ChannelLayout* channel_layout,
int* sample_count,
bool* metadata_frame,
std::vector<uint8_t>* extra_data) { … }
}