diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn index 8f87576e8f..b2839be12a 100644 --- a/webrtc/modules/audio_coding/BUILD.gn +++ b/webrtc/modules/audio_coding/BUILD.gn @@ -933,7 +933,6 @@ rtc_static_library("audio_network_adaptor") { ":ana_config_proto", ":ana_debug_dump_proto", ] - defines = [ "WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP" ] } if (!build_with_chromium && is_clang) { @@ -2178,10 +2177,7 @@ if (rtc_include_tests) { defines = audio_coding_defines if (rtc_enable_protobuf) { - defines += [ - "WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP", - "WEBRTC_NETEQ_UNITTEST_BITEXACT", - ] + defines += [ "WEBRTC_NETEQ_UNITTEST_BITEXACT" ] deps += [ ":ana_config_proto", ":neteq_unittest_proto", diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc index c445ebe3b2..8cb142f2c9 100644 --- a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc +++ b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc @@ -23,7 +23,7 @@ #include "webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller.h" #include "webrtc/modules/audio_coding/audio_network_adaptor/util/threshold_curve.h" -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF RTC_PUSH_IGNORING_WUNDEF() #ifdef WEBRTC_ANDROID_PLATFORM_BUILD #include "external/webrtc/webrtc/modules/audio_coding/audio_network_adaptor/config.pb.h" @@ -37,7 +37,7 @@ namespace webrtc { namespace { -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF std::unique_ptr CreateFecControllerPlrBased( const audio_network_adaptor::config::FecController& config, @@ -180,7 +180,7 @@ std::unique_ptr CreateBitrateController( return std::unique_ptr(new BitrateController( BitrateController::Config(initial_bitrate_bps, initial_frame_length_ms))); } -#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#endif // WEBRTC_ENABLE_PROTOBUF } // namespace @@ -201,7 +201,7 @@ std::unique_ptr ControllerManagerImpl::Create( int initial_bitrate_bps, bool initial_fec_enabled, bool initial_dtx_enabled) { -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF audio_network_adaptor::config::ControllerManager controller_manager_config; controller_manager_config.ParseFromString(config_string); @@ -270,7 +270,7 @@ std::unique_ptr ControllerManagerImpl::Create( #else RTC_NOTREACHED(); return nullptr; -#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#endif // WEBRTC_ENABLE_PROTOBUF } ControllerManagerImpl::ControllerManagerImpl(const Config& config) diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager_unittest.cc index 52f15835d8..a2deb7bfbb 100644 --- a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager_unittest.cc +++ b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager_unittest.cc @@ -17,7 +17,7 @@ #include "webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_controller.h" #include "webrtc/test/gtest.h" -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF RTC_PUSH_IGNORING_WUNDEF() #ifdef WEBRTC_ANDROID_PLATFORM_BUILD #include "external/webrtc/webrtc/modules/audio_coding/audio_network_adaptor/config.pb.h" @@ -203,7 +203,7 @@ TEST(ControllerManagerTest, DoNotReorderIfNetworkMetricsChangeTooSmall) { {kNumControllers - 2, kNumControllers - 1, 0, 1}); } -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF namespace { @@ -439,6 +439,6 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) { ControllerType::CHANNEL, ControllerType::DTX, ControllerType::BIT_RATE}); } -#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#endif // WEBRTC_ENABLE_PROTOBUF } // namespace webrtc diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc b/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc index 8b485e4a07..fdedf6cd9d 100644 --- a/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc +++ b/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump_writer.cc @@ -14,7 +14,7 @@ #include "webrtc/base/ignore_wundef.h" #include "webrtc/base/protobuf_utils.h" -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF RTC_PUSH_IGNORING_WUNDEF() #ifdef WEBRTC_ANDROID_PLATFORM_BUILD #include "external/webrtc/webrtc/modules/audio_coding/audio_network_adaptor/debug_dump.pb.h" @@ -26,7 +26,7 @@ RTC_POP_IGNORING_WUNDEF() namespace webrtc { -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF namespace { using audio_network_adaptor::debug_dump::Event; @@ -43,7 +43,7 @@ void DumpEventToFile(const Event& event, FileWrapper* dump_file) { } } // namespace -#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#endif // WEBRTC_ENABLE_PROTOBUF class DebugDumpWriterImpl final : public DebugDumpWriter { public: @@ -62,17 +62,18 @@ class DebugDumpWriterImpl final : public DebugDumpWriter { DebugDumpWriterImpl::DebugDumpWriterImpl(FILE* file_handle) : dump_file_(FileWrapper::Create()) { -#ifndef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP - RTC_NOTREACHED(); -#endif +#if WEBRTC_ENABLE_PROTOBUF dump_file_->OpenFromFileHandle(file_handle); RTC_CHECK(dump_file_->is_open()); +#else + RTC_NOTREACHED(); +#endif } void DebugDumpWriterImpl::DumpNetworkMetrics( const Controller::NetworkMetrics& metrics, int64_t timestamp) { -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF Event event; event.set_timestamp(timestamp); event.set_type(Event::NETWORK_METRICS); @@ -100,13 +101,13 @@ void DebugDumpWriterImpl::DumpNetworkMetrics( } DumpEventToFile(event, dump_file_.get()); -#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#endif // WEBRTC_ENABLE_PROTOBUF } void DebugDumpWriterImpl::DumpEncoderRuntimeConfig( const AudioEncoderRuntimeConfig& config, int64_t timestamp) { -#ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#if WEBRTC_ENABLE_PROTOBUF Event event; event.set_timestamp(timestamp); event.set_type(Event::ENCODER_RUNTIME_CONFIG); @@ -133,7 +134,7 @@ void DebugDumpWriterImpl::DumpEncoderRuntimeConfig( dump_config->set_num_channels(*config.num_channels); DumpEventToFile(event, dump_file_.get()); -#endif // WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP +#endif // WEBRTC_ENABLE_PROTOBUF } std::unique_ptr DebugDumpWriter::Create(FILE* file_handle) {