Remove audio_device_test_func.
This code does not work and hasn't been used in a long time. It also lacks a GN target. There's no reason to save it. BUG=none Review-Url: https://codereview.webrtc.org/2255173002 Cr-Commit-Position: refs/heads/master@{#13820}
This commit is contained in:
parent
644fa96886
commit
3a11933a63
@ -277,24 +277,6 @@
|
||||
'test/audio_device_test_defines.h',
|
||||
],
|
||||
},
|
||||
{
|
||||
'target_name': 'audio_device_test_func',
|
||||
'type': 'executable',
|
||||
'dependencies': [
|
||||
'audio_device',
|
||||
'webrtc_utility',
|
||||
'<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
|
||||
'<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
|
||||
'<(webrtc_root)/test/test.gyp:test_support',
|
||||
'<(DEPTH)/testing/gtest.gyp:gtest',
|
||||
],
|
||||
'sources': [
|
||||
'test/audio_device_test_func.cc',
|
||||
'test/audio_device_test_defines.h',
|
||||
'test/func_test_manager.cc',
|
||||
'test/func_test_manager.h',
|
||||
],
|
||||
},
|
||||
], # targets
|
||||
}], # include_tests==1 and OS!=ios
|
||||
],
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
INSTRUCTIONS:
|
||||
|
||||
- Start with test #3 (Device enumeration) to get an overview of the available
|
||||
audio devices.
|
||||
- Next, proceed with test #4 (Device selection) to get more details about
|
||||
the supported functions for each audio device.
|
||||
- Verify two-way audio in test #5.
|
||||
Repeat this test for different selections of playout and recording devices.
|
||||
- More detailed tests (volume, mute etc.) can also be performed using #6-#11.
|
||||
|
||||
NOTE:
|
||||
|
||||
- Some tests requires that the user opens up the audio mixer dialog and
|
||||
verifies that a certain action (e.g. Mute ON/OFF) is executed correctly.
|
||||
- Files can be recorded during some tests to enable off-line analysis.
|
||||
- Full support of 'Default Communication' devices requires Windows 7.
|
||||
- If a test consists of several sub tests, press any key to start a new sub test.
|
||||
|
||||
KNOWN ISSUES:
|
||||
|
||||
- Microphone Boost control is not supported on Windows Vista or Windows 7.
|
||||
- Speaker and microphone volume controls will not work as intended on Windows
|
||||
Vista if a 'Default Communication' device is selected in any direction.
|
||||
@ -1,162 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "webrtc/modules/audio_device/test/audio_device_test_defines.h"
|
||||
#include "webrtc/modules/audio_device/test/func_test_manager.h"
|
||||
|
||||
#ifndef __GNUC__
|
||||
// Disable warning message 4996 ('scanf': This function or variable may be unsafe)
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
using namespace webrtc;
|
||||
|
||||
int func_test(int);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !defined(WEBRTC_IOS)
|
||||
int main(int /*argc*/, char* /*argv*/[])
|
||||
{
|
||||
func_test(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// func_test()
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int func_test(int sel)
|
||||
{
|
||||
TEST_LOG("=========================================\n");
|
||||
TEST_LOG("Func Test of the WebRtcAudioDevice Module\n");
|
||||
TEST_LOG("=========================================\n\n");
|
||||
|
||||
// Initialize the counters here to get rid of "unused variables" warnings.
|
||||
warningCount = 0;
|
||||
|
||||
FuncTestManager funcMgr;
|
||||
|
||||
funcMgr.Init();
|
||||
|
||||
bool quit(false);
|
||||
|
||||
while (!quit)
|
||||
{
|
||||
TEST_LOG("---------------------------------------\n");
|
||||
TEST_LOG("Select type of test\n\n");
|
||||
TEST_LOG(" (0) Quit\n");
|
||||
TEST_LOG(" (1) All\n");
|
||||
TEST_LOG("- - - - - - - - - - - - - - - - - - - -\n");
|
||||
TEST_LOG(" (2) Audio-layer selection\n");
|
||||
TEST_LOG(" (3) Device enumeration\n");
|
||||
TEST_LOG(" (4) Device selection\n");
|
||||
TEST_LOG(" (5) Audio transport\n");
|
||||
TEST_LOG(" (6) Speaker volume\n");
|
||||
TEST_LOG(" (7) Microphone volume\n");
|
||||
TEST_LOG(" (8) Speaker mute\n");
|
||||
TEST_LOG(" (9) Microphone mute\n");
|
||||
TEST_LOG(" (10) Microphone boost\n");
|
||||
TEST_LOG(" (11) Microphone AGC\n");
|
||||
TEST_LOG(" (12) Loopback measurements\n");
|
||||
TEST_LOG(" (13) Device removal\n");
|
||||
TEST_LOG(" (14) Advanced mobile device API\n");
|
||||
TEST_LOG(" (66) XTEST\n");
|
||||
TEST_LOG("- - - - - - - - - - - - - - - - - - - -\n");
|
||||
TEST_LOG("\n: ");
|
||||
|
||||
int selection(0);
|
||||
enum TestType testType(TTInvalid);
|
||||
|
||||
SHOW_MENU:
|
||||
|
||||
if (sel > 0)
|
||||
{
|
||||
selection = sel;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (scanf("%d", &selection) < 0) {
|
||||
perror("Failed to get selection.");
|
||||
}
|
||||
}
|
||||
|
||||
switch (selection)
|
||||
{
|
||||
case 0:
|
||||
quit = true;
|
||||
break;
|
||||
case 1:
|
||||
testType = TTAll;
|
||||
break;
|
||||
case 2:
|
||||
testType = TTAudioLayerSelection;
|
||||
break;
|
||||
case 3:
|
||||
testType = TTDeviceEnumeration;
|
||||
break;
|
||||
case 4:
|
||||
testType = TTDeviceSelection;
|
||||
break;
|
||||
case 5:
|
||||
testType = TTAudioTransport;
|
||||
break;
|
||||
case 6:
|
||||
testType = TTSpeakerVolume;
|
||||
break;
|
||||
case 7:
|
||||
testType = TTMicrophoneVolume;
|
||||
break;
|
||||
case 8:
|
||||
testType = TTSpeakerMute;
|
||||
break;
|
||||
case 9:
|
||||
testType = TTMicrophoneMute;
|
||||
break;
|
||||
case 10:
|
||||
testType = TTMicrophoneBoost;
|
||||
break;
|
||||
case 11:
|
||||
testType = TTMicrophoneAGC;
|
||||
break;
|
||||
case 12:
|
||||
testType = TTLoopback;
|
||||
break;
|
||||
case 13:
|
||||
testType = TTDeviceRemoval;
|
||||
break;
|
||||
case 14:
|
||||
testType = TTMobileAPI;
|
||||
break;
|
||||
case 66:
|
||||
testType = TTTest;
|
||||
break;
|
||||
default:
|
||||
testType = TTInvalid;
|
||||
TEST_LOG(": ");
|
||||
goto SHOW_MENU;
|
||||
break;
|
||||
}
|
||||
|
||||
funcMgr.DoTest(testType);
|
||||
|
||||
if (sel > 0)
|
||||
{
|
||||
quit = true;
|
||||
}
|
||||
}
|
||||
|
||||
funcMgr.Close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,233 +0,0 @@
|
||||
/*
|
||||
* 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 WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H
|
||||
#define WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/common_audio/resampler/include/resampler.h"
|
||||
#include "webrtc/modules/audio_device/include/audio_device.h"
|
||||
#include "webrtc/modules/audio_device/test/audio_device_test_defines.h"
|
||||
#include "webrtc/system_wrappers/include/file_wrapper.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
|
||||
#define ADM_AUDIO_LAYER AudioDeviceModule::kPlatformDefaultAudio
|
||||
//#define ADM_AUDIO_LAYER AudioDeviceModule::kLinuxPulseAudio
|
||||
|
||||
enum TestType
|
||||
{
|
||||
TTInvalid = -1,
|
||||
TTAll = 0,
|
||||
TTAudioLayerSelection = 1,
|
||||
TTDeviceEnumeration = 2,
|
||||
TTDeviceSelection = 3,
|
||||
TTAudioTransport = 4,
|
||||
TTSpeakerVolume = 5,
|
||||
TTMicrophoneVolume = 6,
|
||||
TTSpeakerMute = 7,
|
||||
TTMicrophoneMute = 8,
|
||||
TTMicrophoneBoost = 9,
|
||||
TTMicrophoneAGC = 10,
|
||||
TTLoopback = 11,
|
||||
TTDeviceRemoval = 13,
|
||||
TTMobileAPI = 14,
|
||||
TTTest = 66,
|
||||
};
|
||||
|
||||
struct AudioPacket
|
||||
{
|
||||
uint8_t dataBuffer[4 * 960];
|
||||
size_t nSamples;
|
||||
size_t nBytesPerSample;
|
||||
size_t nChannels;
|
||||
uint32_t samplesPerSec;
|
||||
};
|
||||
|
||||
class ProcessThread;
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
|
||||
class AudioDeviceModule;
|
||||
class AudioEventObserver;
|
||||
class AudioTransport;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// AudioEventObserver
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class AudioEventObserver: public AudioDeviceObserver
|
||||
{
|
||||
public:
|
||||
virtual void OnErrorIsReported(const ErrorCode error);
|
||||
virtual void OnWarningIsReported(const WarningCode warning);
|
||||
AudioEventObserver(AudioDeviceModule* audioDevice);
|
||||
~AudioEventObserver();
|
||||
public:
|
||||
ErrorCode _error;
|
||||
WarningCode _warning;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// AudioTransport
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class AudioTransportImpl: public AudioTransport
|
||||
{
|
||||
public:
|
||||
int32_t RecordedDataIsAvailable(const void* audioSamples,
|
||||
const size_t nSamples,
|
||||
const size_t nBytesPerSample,
|
||||
const size_t nChannels,
|
||||
const uint32_t samplesPerSec,
|
||||
const uint32_t totalDelayMS,
|
||||
const int32_t clockDrift,
|
||||
const uint32_t currentMicLevel,
|
||||
const bool keyPressed,
|
||||
uint32_t& newMicLevel) override;
|
||||
|
||||
int32_t NeedMorePlayData(const size_t nSamples,
|
||||
const size_t nBytesPerSample,
|
||||
const size_t nChannels,
|
||||
const uint32_t samplesPerSec,
|
||||
void* audioSamples,
|
||||
size_t& nSamplesOut,
|
||||
int64_t* elapsed_time_ms,
|
||||
int64_t* ntp_time_ms) override;
|
||||
|
||||
void PushCaptureData(int voe_channel,
|
||||
const void* audio_data,
|
||||
int bits_per_sample,
|
||||
int sample_rate,
|
||||
size_t number_of_channels,
|
||||
size_t number_of_frames) override;
|
||||
|
||||
void PullRenderData(int bits_per_sample,
|
||||
int sample_rate,
|
||||
size_t number_of_channels,
|
||||
size_t number_of_frames,
|
||||
void* audio_data,
|
||||
int64_t* elapsed_time_ms,
|
||||
int64_t* ntp_time_ms) override;
|
||||
|
||||
AudioTransportImpl(AudioDeviceModule* audioDevice);
|
||||
~AudioTransportImpl();
|
||||
|
||||
public:
|
||||
int32_t SetFilePlayout(bool enable, const char* fileName = NULL);
|
||||
void SetFullDuplex(bool enable);
|
||||
void SetSpeakerVolume(bool enable)
|
||||
{
|
||||
_speakerVolume = enable;
|
||||
}
|
||||
;
|
||||
void SetSpeakerMute(bool enable)
|
||||
{
|
||||
_speakerMute = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneMute(bool enable)
|
||||
{
|
||||
_microphoneMute = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneVolume(bool enable)
|
||||
{
|
||||
_microphoneVolume = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneBoost(bool enable)
|
||||
{
|
||||
_microphoneBoost = enable;
|
||||
}
|
||||
;
|
||||
void SetLoopbackMeasurements(bool enable)
|
||||
{
|
||||
_loopBackMeasurements = enable;
|
||||
}
|
||||
;
|
||||
void SetMicrophoneAGC(bool enable)
|
||||
{
|
||||
_microphoneAGC = enable;
|
||||
}
|
||||
;
|
||||
|
||||
private:
|
||||
typedef std::list<AudioPacket*> AudioPacketList;
|
||||
AudioDeviceModule* _audioDevice;
|
||||
|
||||
bool _playFromFile;
|
||||
bool _fullDuplex;
|
||||
bool _speakerVolume;
|
||||
bool _speakerMute;
|
||||
bool _microphoneVolume;
|
||||
bool _microphoneMute;
|
||||
bool _microphoneBoost;
|
||||
bool _microphoneAGC;
|
||||
bool _loopBackMeasurements;
|
||||
|
||||
FileWrapper& _playFile;
|
||||
|
||||
uint32_t _recCount;
|
||||
uint32_t _playCount;
|
||||
AudioPacketList _audioList;
|
||||
|
||||
Resampler _resampler;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// FuncTestManager
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class FuncTestManager
|
||||
{
|
||||
public:
|
||||
FuncTestManager();
|
||||
~FuncTestManager();
|
||||
int32_t Init();
|
||||
int32_t Close();
|
||||
int32_t DoTest(const TestType testType);
|
||||
private:
|
||||
int32_t TestAudioLayerSelection();
|
||||
int32_t TestDeviceEnumeration();
|
||||
int32_t TestDeviceSelection();
|
||||
int32_t TestAudioTransport();
|
||||
int32_t TestSpeakerVolume();
|
||||
int32_t TestMicrophoneVolume();
|
||||
int32_t TestSpeakerMute();
|
||||
int32_t TestMicrophoneMute();
|
||||
int32_t TestMicrophoneBoost();
|
||||
int32_t TestLoopback();
|
||||
int32_t TestDeviceRemoval();
|
||||
int32_t TestExtra();
|
||||
int32_t TestMicrophoneAGC();
|
||||
int32_t SelectPlayoutDevice();
|
||||
int32_t SelectRecordingDevice();
|
||||
int32_t TestAdvancedMBAPI();
|
||||
private:
|
||||
// Paths to where the resource files to be used for this test are located.
|
||||
std::string _playoutFile48;
|
||||
std::string _playoutFile44;
|
||||
std::string _playoutFile16;
|
||||
std::string _playoutFile8;
|
||||
|
||||
std::unique_ptr<ProcessThread> _processThread;
|
||||
AudioDeviceModule* _audioDevice;
|
||||
AudioEventObserver* _audioEventObserver;
|
||||
AudioTransportImpl* _audioTransport;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // #ifndef WEBRTC_AUDIO_DEVICE_FUNC_TEST_MANAGER_H
|
||||
Loading…
x
Reference in New Issue
Block a user