#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/base/audio_bus.h"
#include <stddef.h>
#include <stdint.h>
#include <limits>
#include <utility>
#include "base/check_op.h"
#include "base/memory/aligned_memory.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "media/base/audio_parameters.h"
#include "media/base/limits.h"
#include "media/base/vector_math.h"
namespace media {
static int CalculateMemorySizeInternal(int channels,
int frames,
int* out_aligned_frames) { … }
static void ValidateConfig(int channels, int frames) { … }
void AudioBus::CheckOverflow(int start_frame, int frames, int total_frames) { … }
AudioBus::AudioBus(int channels, int frames)
: … { … }
AudioBus::AudioBus(int channels, int frames, float* data)
: … { … }
AudioBus::AudioBus(int frames, const std::vector<float*>& channel_data)
: … { … }
AudioBus::AudioBus(int channels)
: … { … }
AudioBus::~AudioBus() { … }
std::unique_ptr<AudioBus> AudioBus::Create(int channels, int frames) { … }
std::unique_ptr<AudioBus> AudioBus::Create(const AudioParameters& params) { … }
std::unique_ptr<AudioBus> AudioBus::CreateWrapper(int channels) { … }
std::unique_ptr<AudioBus> AudioBus::WrapVector(
int frames,
const std::vector<float*>& channel_data) { … }
std::unique_ptr<AudioBus> AudioBus::WrapMemory(int channels,
int frames,
void* data) { … }
std::unique_ptr<AudioBus> AudioBus::WrapMemory(const AudioParameters& params,
void* data) { … }
std::unique_ptr<const AudioBus> AudioBus::WrapReadOnlyMemory(int channels,
int frames,
const void* data) { … }
std::unique_ptr<const AudioBus> AudioBus::WrapReadOnlyMemory(
const AudioParameters& params,
const void* data) { … }
void AudioBus::SetChannelData(int channel, float* data) { … }
void AudioBus::set_frames(int frames) { … }
void AudioBus::SetWrappedDataDeleter(base::OnceClosure deleter) { … }
size_t AudioBus::GetBitstreamDataSize() const { … }
void AudioBus::SetBitstreamDataSize(size_t data_size) { … }
int AudioBus::GetBitstreamFrames() const { … }
void AudioBus::SetBitstreamFrames(int frames) { … }
void AudioBus::ZeroFramesPartial(int start_frame, int frames) { … }
void AudioBus::ZeroFrames(int frames) { … }
void AudioBus::Zero() { … }
bool AudioBus::AreFramesZero() const { … }
int AudioBus::CalculateMemorySize(const AudioParameters& params) { … }
int AudioBus::CalculateMemorySize(int channels, int frames) { … }
bool AudioBus::IsAligned(void* ptr) { … }
void AudioBus::BuildChannelData(int channels, int aligned_frames, float* data) { … }
void AudioBus::CopyTo(AudioBus* dest) const { … }
void AudioBus::CopyAndClipTo(AudioBus* dest) const { … }
void AudioBus::CopyPartialFramesTo(int source_start_frame,
int frame_count,
int dest_start_frame,
AudioBus* dest) const { … }
void AudioBus::Scale(float volume) { … }
void AudioBus::SwapChannels(int a, int b) { … }
}