#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stdint.h>
#include <limits>
#include <memory>
#include "base/test/gtest_util.h"
#include "base/time/time.h"
#include "media/base/audio_buffer.h"
#include "media/base/audio_bus.h"
#include "media/base/test_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
constexpr int kSampleRate = …;
enum class ValueType { … };
static void VerifyBusWithOffset(AudioBus* bus,
int offset,
int frames,
float start,
float start_offset,
float increment,
ValueType type = ValueType::kNormal) { … }
class TestExternalMemory : public media::AudioBuffer::ExternalMemory { … };
static std::vector<float*> WrapChannelsAsVector(AudioBus* bus) { … }
static void VerifyBus(AudioBus* bus,
int frames,
float start,
float increment,
ValueType type = ValueType::kNormal) { … }
static void TrimRangeTest(SampleFormat sample_format) { … }
TEST(AudioBufferTest, CopyFrom) { … }
TEST(AudioBufferTest, CopyFromAudioBus) { … }
TEST(AudioBufferTest, CopyBitstreamFrom) { … }
TEST(AudioBufferTest, CreateBitstreamBuffer) { … }
TEST(AudioBufferTest, CopyBitstreamFromIECDts) { … }
TEST(AudioBufferTest, WrapExternalMemory) { … }
TEST(AudioBufferTest, CreateBitstreamBufferIECDts) { … }
TEST(AudioBufferTest, CreateEOSBuffer) { … }
TEST(AudioBufferTest, FrameSize) { … }
TEST(AudioBufferTest, ReadBitstream) { … }
TEST(AudioBufferTest, ReadBitstreamIECDts) { … }
TEST(AudioBufferTest, ReadU8) { … }
TEST(AudioBufferTest, ReadS16) { … }
TEST(AudioBufferTest, ReadS32) { … }
TEST(AudioBufferTest, ReadF32) { … }
TEST(AudioBufferTest, ReadU8Planar) { … }
TEST(AudioBufferTest, ReadS16Planar) { … }
TEST(AudioBufferTest, ReadS32Planar) { … }
TEST(AudioBufferTest, ReadF32Planar) { … }
TEST(AudioBufferTest, WrapOrCopyToAudioBus) { … }
TEST(AudioBufferTest, EmptyBuffer) { … }
TEST(AudioBufferTest, TrimEmptyBuffer) { … }
TEST(AudioBufferTest, Trim) { … }
TEST(AudioBufferTest, TrimRangePlanar) { … }
TEST(AudioBufferTest, TrimRangeInterleaved) { … }
TEST(AudioBufferTest, AudioBufferMemoryPool) { … }
TEST(AudioBufferTest, AudioBufferMemoryPoolAlignment) { … }
TEST(AudioBufferTest, AudioBufferAlignmentUnpooled) { … }
TEST(AudioBufferTest, AudioBufferMemoryPoolPlanar) { … }
}