chromium/media/base/audio_buffer_unittest.cc

// Copyright 2013 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 <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 that the channels are aligned according to the pool parameter.
TEST(AudioBufferTest, AudioBufferMemoryPoolAlignment) {}

// Test that the channels are aligned when buffers are not pooled.
TEST(AudioBufferTest, AudioBufferAlignmentUnpooled) {}

// Planar allocations use a different path, so make sure pool is used.
TEST(AudioBufferTest, AudioBufferMemoryPoolPlanar) {}

}  // namespace media