From cae8802dc12a36b856656ba52ca234bb1943c8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20H=C3=B6glund?= Date: Wed, 10 Oct 2018 15:23:32 +0200 Subject: [PATCH] Delete force_mic_volume_max. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This tool is no longer needed since we're deleting the AQ tests. Bug: chromium:880074 Change-Id: I035d7b33c7c4feb5962cf9dafc8e7086a8dee440 Reviewed-on: https://webrtc-review.googlesource.com/c/105140 Reviewed-by: Mirko Bonadei Commit-Queue: Patrik Höglund Cr-Commit-Position: refs/heads/master@{#25162} --- rtc_tools/BUILD.gn | 17 ------ .../force_mic_volume_max.cc | 58 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 rtc_tools/force_mic_volume_max/force_mic_volume_max.cc diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn index 252aec4547..b895d11ec5 100644 --- a/rtc_tools/BUILD.gn +++ b/rtc_tools/BUILD.gn @@ -25,9 +25,6 @@ group("rtc_tools") { ":psnr_ssim_analyzer", ":rgba_to_i420_converter", ] - if (rtc_include_internal_audio_device) { - deps += [ ":force_mic_volume_max" ] - } if (rtc_enable_protobuf) { deps += [ ":chart_proto" ] } @@ -211,20 +208,6 @@ if (!build_with_chromium) { ] } - # It doesn't make sense to build this tool without the ADM enabled. - if (rtc_include_internal_audio_device) { - rtc_executable("force_mic_volume_max") { - sources = [ - "force_mic_volume_max/force_mic_volume_max.cc", - ] - - deps = [ - "../modules/audio_device", - "../modules/audio_device:audio_device_impl", - ] - } - } - if (rtc_enable_protobuf) { proto_library("chart_proto") { sources = [ diff --git a/rtc_tools/force_mic_volume_max/force_mic_volume_max.cc b/rtc_tools/force_mic_volume_max/force_mic_volume_max.cc deleted file mode 100644 index 2cd1b36d90..0000000000 --- a/rtc_tools/force_mic_volume_max/force_mic_volume_max.cc +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2013 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. - */ - -// This utility will portably force the volume of the default microphone to max. - -#include - -#include "modules/audio_device/include/audio_device.h" - -using webrtc::AudioDeviceModule; - -#if defined(_WIN32) -#define DEFAULT_INPUT_DEVICE (AudioDeviceModule::kDefaultCommunicationDevice) -#else -#define DEFAULT_INPUT_DEVICE (0) -#endif - -int main(int /*argc*/, char* /*argv*/ []) { - // Create and initialize the ADM. - rtc::scoped_refptr adm( - AudioDeviceModule::Create(AudioDeviceModule::kPlatformDefaultAudio)); - if (!adm.get()) { - fprintf(stderr, "Failed to create Audio Device Module.\n"); - return 1; - } - if (adm->Init() != 0) { - fprintf(stderr, "Failed to initialize Audio Device Module.\n"); - return 1; - } - if (adm->SetRecordingDevice(DEFAULT_INPUT_DEVICE) != 0) { - fprintf(stderr, "Failed to set the default input device.\n"); - return 1; - } - if (adm->InitMicrophone() != 0) { - fprintf(stderr, "Failed to to initialize the microphone.\n"); - return 1; - } - - // Set mic volume to max. - uint32_t max_vol = 0; - if (adm->MaxMicrophoneVolume(&max_vol) != 0) { - fprintf(stderr, "Failed to get max volume.\n"); - return 1; - } - if (adm->SetMicrophoneVolume(max_vol) != 0) { - fprintf(stderr, "Failed to set mic volume.\n"); - return 1; - } - - return 0; -}