Break the ANA build-target into ANA and ANA-config
This is done to solve a dependency-cycle with the RtcEventLog - now the RtcEventLog can depend on the config part of ANA, and be able to peer inside, while the implementation part of ANA can invoke the RtcEventLog.
BUG=webrtc:8111
TBR=stefan@webrtc.org
Review-Url: https://codereview.webrtc.org/3010343002
Cr-Commit-Position: refs/heads/master@{#19793}
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 898723b..d415098 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -881,9 +881,18 @@
}
}
+rtc_static_library("audio_network_adaptor_config") {
+ sources = [
+ "audio_network_adaptor/audio_network_adaptor_config.cc",
+ "audio_network_adaptor/include/audio_network_adaptor_config.h",
+ ]
+ deps = [
+ "../../api:optional",
+ ]
+}
+
rtc_static_library("audio_network_adaptor") {
sources = [
- "audio_network_adaptor/audio_network_adaptor.cc",
"audio_network_adaptor/audio_network_adaptor_impl.cc",
"audio_network_adaptor/audio_network_adaptor_impl.h",
"audio_network_adaptor/bitrate_controller.cc",
@@ -910,6 +919,10 @@
"audio_network_adaptor/util/threshold_curve.h",
]
+ public_deps = [
+ ":audio_network_adaptor_config",
+ ]
+
deps = [
"../..:webrtc_common",
"../../api:optional",
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor.cc b/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_config.cc
similarity index 95%
rename from webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor.cc
rename to webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_config.cc
index ce1e250..c312266 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_config.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
namespace webrtc {
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h b/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h
index 0097d70..a91b33b 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h
@@ -13,27 +13,10 @@
#include "webrtc/api/audio_codecs/audio_encoder.h"
#include "webrtc/api/optional.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
namespace webrtc {
-struct AudioEncoderRuntimeConfig {
- AudioEncoderRuntimeConfig();
- AudioEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& other);
- ~AudioEncoderRuntimeConfig();
- rtc::Optional<int> bitrate_bps;
- rtc::Optional<int> frame_length_ms;
- // Note: This is what we tell the encoder. It doesn't have to reflect
- // the actual NetworkMetrics; it's subject to our decision.
- rtc::Optional<float> uplink_packet_loss_fraction;
- rtc::Optional<bool> enable_fec;
- rtc::Optional<bool> enable_dtx;
-
- // Some encoders can encode fewer channels than the actual input to make
- // better use of the bandwidth. |num_channels| sets the number of channels
- // to encode.
- rtc::Optional<size_t> num_channels;
-};
-
// An AudioNetworkAdaptor optimizes the audio experience by suggesting a
// suitable runtime configuration (bit rate, frame length, FEC, etc.) to the
// encoder based on network metrics.
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h b/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h
new file mode 100644
index 0000000..5fc68e6
--- /dev/null
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h
@@ -0,0 +1,38 @@
+/*
+ * 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 WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_CONFIG_H_
+#define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_CONFIG_H_
+
+#include "webrtc/api/optional.h"
+
+namespace webrtc {
+
+struct AudioEncoderRuntimeConfig {
+ AudioEncoderRuntimeConfig();
+ AudioEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& other);
+ ~AudioEncoderRuntimeConfig();
+ rtc::Optional<int> bitrate_bps;
+ rtc::Optional<int> frame_length_ms;
+ // Note: This is what we tell the encoder. It doesn't have to reflect
+ // the actual NetworkMetrics; it's subject to our decision.
+ rtc::Optional<float> uplink_packet_loss_fraction;
+ rtc::Optional<bool> enable_fec;
+ rtc::Optional<bool> enable_dtx;
+
+ // Some encoders can encode fewer channels than the actual input to make
+ // better use of the bandwidth. |num_channels| sets the number of channels
+ // to encode.
+ rtc::Optional<size_t> num_channels;
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_CONFIG_H_