Repo created

This commit is contained in:
Fr4nz D13trich 2025-11-22 14:04:28 +01:00
parent 81b91f4139
commit f8c34fa5ee
22732 changed files with 4815320 additions and 2 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_BUFFER_LEVEL_FILTER_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_BUFFER_LEVEL_FILTER_H_
#include "modules/audio_coding/neteq/buffer_level_filter.h"
#include "test/gmock.h"
namespace webrtc {
class MockBufferLevelFilter : public BufferLevelFilter {
public:
MOCK_METHOD(void,
Update,
(size_t buffer_size_samples, int time_stretched_samples));
MOCK_METHOD(int, filtered_current_level, (), (const));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_BUFFER_LEVEL_FILTER_H_

View file

@ -0,0 +1,50 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_
#include <string>
#include "modules/audio_coding/neteq/decoder_database.h"
#include "test/gmock.h"
namespace webrtc {
class MockDecoderDatabase : public DecoderDatabase {
public:
explicit MockDecoderDatabase(
rtc::scoped_refptr<AudioDecoderFactory> factory = nullptr)
: DecoderDatabase(factory, absl::nullopt) {}
~MockDecoderDatabase() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(bool, Empty, (), (const, override));
MOCK_METHOD(int, Size, (), (const, override));
MOCK_METHOD(int,
RegisterPayload,
(int rtp_payload_type, const SdpAudioFormat& audio_format),
(override));
MOCK_METHOD(int, Remove, (uint8_t rtp_payload_type), (override));
MOCK_METHOD(void, RemoveAll, (), (override));
MOCK_METHOD(const DecoderInfo*,
GetDecoderInfo,
(uint8_t rtp_payload_type),
(const, override));
MOCK_METHOD(int,
SetActiveDecoder,
(uint8_t rtp_payload_type, bool* new_decoder),
(override));
MOCK_METHOD(AudioDecoder*, GetActiveDecoder, (), (const, override));
MOCK_METHOD(int, SetActiveCngDecoder, (uint8_t rtp_payload_type), (override));
MOCK_METHOD(ComfortNoiseDecoder*, GetActiveCngDecoder, (), (const, override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DELAY_MANAGER_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DELAY_MANAGER_H_
#include "api/neteq/tick_timer.h"
#include "modules/audio_coding/neteq/delay_manager.h"
#include "test/gmock.h"
namespace webrtc {
class MockDelayManager : public DelayManager {
public:
MockDelayManager(const MockDelayManager::Config& config,
const TickTimer* tick_timer)
: DelayManager(config, tick_timer) {}
MOCK_METHOD(int, TargetDelayMs, (), (const));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DELAY_MANAGER_H_

View file

@ -0,0 +1,35 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DTMF_BUFFER_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DTMF_BUFFER_H_
#include "modules/audio_coding/neteq/dtmf_buffer.h"
#include "test/gmock.h"
namespace webrtc {
class MockDtmfBuffer : public DtmfBuffer {
public:
MockDtmfBuffer(int fs) : DtmfBuffer(fs) {}
~MockDtmfBuffer() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(void, Flush, (), (override));
MOCK_METHOD(int, InsertEvent, (const DtmfEvent& event), (override));
MOCK_METHOD(bool,
GetEvent,
(uint32_t current_timestamp, DtmfEvent* event),
(override));
MOCK_METHOD(size_t, Length, (), (const, override));
MOCK_METHOD(bool, Empty, (), (const, override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DTMF_BUFFER_H_

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DTMF_TONE_GENERATOR_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DTMF_TONE_GENERATOR_H_
#include "modules/audio_coding/neteq/dtmf_tone_generator.h"
#include "test/gmock.h"
namespace webrtc {
class MockDtmfToneGenerator : public DtmfToneGenerator {
public:
~MockDtmfToneGenerator() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(int, Init, (int fs, int event, int attenuation), (override));
MOCK_METHOD(void, Reset, (), (override));
MOCK_METHOD(int,
Generate,
(size_t num_samples, AudioMultiVector* output),
(override));
MOCK_METHOD(bool, initialized, (), (const, override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DTMF_TONE_GENERATOR_H_

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXPAND_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXPAND_H_
#include "modules/audio_coding/neteq/expand.h"
#include "test/gmock.h"
namespace webrtc {
class MockExpand : public Expand {
public:
MockExpand(BackgroundNoise* background_noise,
SyncBuffer* sync_buffer,
RandomVector* random_vector,
StatisticsCalculator* statistics,
int fs,
size_t num_channels)
: Expand(background_noise,
sync_buffer,
random_vector,
statistics,
fs,
num_channels) {}
~MockExpand() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(void, Reset, (), (override));
MOCK_METHOD(int, Process, (AudioMultiVector * output), (override));
MOCK_METHOD(void, SetParametersForNormalAfterExpand, (), (override));
MOCK_METHOD(void, SetParametersForMergeAfterExpand, (), (override));
MOCK_METHOD(size_t, overlap_length, (), (const, override));
};
} // namespace webrtc
namespace webrtc {
class MockExpandFactory : public ExpandFactory {
public:
MOCK_METHOD(Expand*,
Create,
(BackgroundNoise * background_noise,
SyncBuffer* sync_buffer,
RandomVector* random_vector,
StatisticsCalculator* statistics,
int fs,
size_t num_channels),
(const, override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXPAND_H_

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_HISTOGRAM_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_HISTOGRAM_H_
#include "modules/audio_coding/neteq/histogram.h"
#include "test/gmock.h"
namespace webrtc {
class MockHistogram : public Histogram {
public:
MockHistogram(size_t num_buckets, int forget_factor)
: Histogram(num_buckets, forget_factor) {}
virtual ~MockHistogram() {}
MOCK_METHOD(void, Add, (int), (override));
MOCK_METHOD(int, Quantile, (int), (override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_HISTOGRAM_H_

View file

@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_NETEQ_CONTROLLER_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_NETEQ_CONTROLLER_H_
#include "api/neteq/neteq_controller.h"
#include "test/gmock.h"
namespace webrtc {
class MockNetEqController : public NetEqController {
public:
MockNetEqController() = default;
~MockNetEqController() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(void, Reset, (), (override));
MOCK_METHOD(void, SoftReset, (), (override));
MOCK_METHOD(NetEq::Operation,
GetDecision,
(const NetEqStatus& neteq_status, bool* reset_decoder),
(override));
MOCK_METHOD(void, RegisterEmptyPacket, (), (override));
MOCK_METHOD(void,
SetSampleRate,
(int fs_hz, size_t output_size_samples),
(override));
MOCK_METHOD(bool, SetMaximumDelay, (int delay_ms), (override));
MOCK_METHOD(bool, SetMinimumDelay, (int delay_ms), (override));
MOCK_METHOD(bool, SetBaseMinimumDelay, (int delay_ms), (override));
MOCK_METHOD(int, GetBaseMinimumDelay, (), (const, override));
MOCK_METHOD(void, ExpandDecision, (NetEq::Operation operation), (override));
MOCK_METHOD(void, AddSampleMemory, (int32_t value), (override));
MOCK_METHOD(int, TargetLevelMs, (), (const, override));
MOCK_METHOD(absl::optional<int>,
PacketArrived,
(int fs_hz,
bool should_update_stats,
const PacketArrivedInfo& info),
(override));
MOCK_METHOD(void, NotifyMutedState, (), (override));
MOCK_METHOD(bool, PeakFound, (), (const, override));
MOCK_METHOD(int, GetFilteredBufferLevel, (), (const, override));
MOCK_METHOD(void, set_sample_memory, (int32_t value), (override));
MOCK_METHOD(size_t, noise_fast_forward, (), (const, override));
MOCK_METHOD(size_t, packet_length_samples, (), (const, override));
MOCK_METHOD(void, set_packet_length_samples, (size_t value), (override));
MOCK_METHOD(void, set_prev_time_scale, (bool value), (override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_NETEQ_CONTROLLER_H_

View file

@ -0,0 +1,31 @@
/*
* Copyright 2023 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_PACKET_ARRIVAL_HISTORY_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_PACKET_ARRIVAL_HISTORY_H_
#include "api/neteq/tick_timer.h"
#include "modules/audio_coding/neteq/packet_arrival_history.h"
#include "test/gmock.h"
namespace webrtc {
class MockPacketArrivalHistory : public PacketArrivalHistory {
public:
MockPacketArrivalHistory(const TickTimer* tick_timer)
: PacketArrivalHistory(tick_timer, 0) {}
MOCK_METHOD(int, GetDelayMs, (uint32_t rtp_timestamp), (const override));
MOCK_METHOD(int, GetMaxDelayMs, (), (const override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_PACKET_ARRIVAL_HISTORY_H_

View file

@ -0,0 +1,53 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_PACKET_BUFFER_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_PACKET_BUFFER_H_
#include "modules/audio_coding/neteq/packet_buffer.h"
#include "test/gmock.h"
namespace webrtc {
class MockPacketBuffer : public PacketBuffer {
public:
MockPacketBuffer(size_t max_number_of_packets,
const TickTimer* tick_timer,
StatisticsCalculator* stats)
: PacketBuffer(max_number_of_packets, tick_timer, stats) {}
~MockPacketBuffer() override { Die(); }
MOCK_METHOD(void, Die, ());
MOCK_METHOD(void, Flush, (), (override));
MOCK_METHOD(bool, Empty, (), (const, override));
MOCK_METHOD(int, InsertPacket, (Packet && packet), (override));
MOCK_METHOD(int,
NextTimestamp,
(uint32_t * next_timestamp),
(const, override));
MOCK_METHOD(int,
NextHigherTimestamp,
(uint32_t timestamp, uint32_t* next_timestamp),
(const, override));
MOCK_METHOD(const Packet*, PeekNextPacket, (), (const, override));
MOCK_METHOD(absl::optional<Packet>, GetNextPacket, (), (override));
MOCK_METHOD(int, DiscardNextPacket, (), (override));
MOCK_METHOD(void,
DiscardOldPackets,
(uint32_t timestamp_limit, uint32_t horizon_samples),
(override));
MOCK_METHOD(void,
DiscardAllOldPackets,
(uint32_t timestamp_limit),
(override));
MOCK_METHOD(size_t, NumPacketsInBuffer, (), (const, override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_PACKET_BUFFER_H_

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_RED_PAYLOAD_SPLITTER_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_RED_PAYLOAD_SPLITTER_H_
#include "modules/audio_coding/neteq/red_payload_splitter.h"
#include "test/gmock.h"
namespace webrtc {
class MockRedPayloadSplitter : public RedPayloadSplitter {
public:
MOCK_METHOD(bool, SplitRed, (PacketList * packet_list), (override));
MOCK_METHOD(void,
CheckRedPayloads,
(PacketList * packet_list,
const DecoderDatabase& decoder_database),
(override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_RED_PAYLOAD_SPLITTER_H_

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_STATISTICS_CALCULATOR_H_
#define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_STATISTICS_CALCULATOR_H_
#include "modules/audio_coding/neteq/statistics_calculator.h"
#include "test/gmock.h"
namespace webrtc {
class MockStatisticsCalculator : public StatisticsCalculator {
public:
MOCK_METHOD(void, PacketsDiscarded, (size_t num_packets), (override));
MOCK_METHOD(void,
SecondaryPacketsDiscarded,
(size_t num_packets),
(override));
MOCK_METHOD(void, RelativePacketArrivalDelay, (size_t delay_ms), (override));
};
} // namespace webrtc
#endif // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_STATISTICS_CALCULATOR_H_