chromium/media/formats/mpeg/mpeg_audio_stream_parser_base.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "media/formats/mpeg/mpeg_audio_stream_parser_base.h"

#include <memory>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/numerics/checked_math.h"
#include "base/time/time.h"
#include "media/base/byte_queue.h"
#include "media/base/media_log.h"
#include "media/base/media_tracks.h"
#include "media/base/media_util.h"
#include "media/base/stream_parser.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_decoder_config.h"

namespace media {

static const int kMpegAudioTrackId =;

static const uint32_t kICYStartCode =;  // 'ICY '

// Arbitrary upper bound on the size of an IceCast header before it
// triggers an error.
static const int kMaxIcecastHeaderSize =;

static const uint32_t kID3StartCodeMask =;
static const uint32_t kID3v1StartCode =;  // 'TAG\0'
static const int kID3v1Size =;
static const int kID3v1ExtendedSize =;
static const uint32_t kID3v2StartCode =;  // 'ID3\0'

static int LocateEndOfHeaders(const uint8_t* buf, int buf_len, int i) {}

MPEGAudioStreamParserBase::MPEGAudioStreamParserBase(uint32_t start_code_mask,
                                                     AudioCodec audio_codec,
                                                     int codec_delay)
    :{}

MPEGAudioStreamParserBase::~MPEGAudioStreamParserBase() = default;

void MPEGAudioStreamParserBase::Init(
    InitCB init_cb,
    NewConfigCB config_cb,
    NewBuffersCB new_buffers_cb,
    EncryptedMediaInitDataCB encrypted_media_init_data_cb,
    NewMediaSegmentCB new_segment_cb,
    EndMediaSegmentCB end_of_segment_cb,
    MediaLog* media_log) {}

void MPEGAudioStreamParserBase::Flush() {}

bool MPEGAudioStreamParserBase::GetGenerateTimestampsFlag() const {}

bool MPEGAudioStreamParserBase::AppendToParseBuffer(
    base::span<const uint8_t> buf) {}

StreamParser::ParseStatus MPEGAudioStreamParserBase::Parse(
    int max_pending_bytes_to_inspect) {}

void MPEGAudioStreamParserBase::ChangeState(State state) {}

int MPEGAudioStreamParserBase::ParseFrame(const uint8_t* data,
                                          int size,
                                          BufferQueue* buffers) {}

int MPEGAudioStreamParserBase::ParseIcecastHeader(const uint8_t* data,
                                                  int size) {}

int MPEGAudioStreamParserBase::ParseID3v1(const uint8_t* data, int size) {}

int MPEGAudioStreamParserBase::ParseID3v2(const uint8_t* data, int size) {}

bool MPEGAudioStreamParserBase::ParseSyncSafeInt(BitReader* reader,
                                                 int32_t* value) {}

int MPEGAudioStreamParserBase::FindNextValidStartCode(const uint8_t* data,
                                                      int size) {}

bool MPEGAudioStreamParserBase::SendBuffers(BufferQueue* buffers,
                                            bool end_of_segment) {}

}  // namespace media