chromium/media/base/multi_channel_resampler_unittest.cc

// Copyright 2012 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/base/multi_channel_resampler.h"

#include <cmath>
#include <memory>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "media/base/audio_bus.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace media {

// Just test a basic resampling case.  The SincResampler unit test will take
// care of accuracy testing; we just need to check that multichannel works as
// expected within some tolerance.
static const float kScaleFactor =;

// Simulate large and small sample requests used by the different audio paths.
static const int kHighLatencySize =;
// Low latency buffers show a larger error than high latency ones.  Which makes
// sense since each error represents a larger portion of the total request.
static const int kLowLatencySize =;

// Test fill value.
static const float kFillValue =;

// Chosen arbitrarily based on what each resampler reported during testing.
static const double kLowLatencyMaxRMSError =;
static const double kLowLatencyMaxError =;
static const double kHighLatencyMaxRMSError =;
static const double kHighLatencyMaxError =;

class MultiChannelResamplerTest
    : public testing::TestWithParam<int> {};

TEST_P(MultiChannelResamplerTest, HighLatency) {}

TEST_P(MultiChannelResamplerTest, LowLatency) {}

// Test common channel layouts: mono, stereo, 5.1, 7.1.
INSTANTIATE_TEST_SUITE_P();

}  // namespace media