Clean up logging in AudioSendStream::SetupSendCodec().
As a side effect:
- Moved the AudioSendStream::Config::SendCodecSpec methods into the .cc.
- Which exposed an issue with event_visualizer_utils not having a dependency on api:call_api set up.
- Which further exposed clang warnings about large inlined default methods in webrtc/config.h.
BUG=webrtc:4690
Committed: https://crrev.com/1836fd6257a692959b3b49ba99ef587ad9995871
Review-Url: https://codereview.webrtc.org/2446963003
Cr-Original-Commit-Position: refs/heads/master@{#14771}
Cr-Commit-Position: refs/heads/master@{#14780}
diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn
index 9a28602..69fd7f4 100644
--- a/webrtc/api/BUILD.gn
+++ b/webrtc/api/BUILD.gn
@@ -21,6 +21,7 @@
rtc_source_set("call_api") {
sources = [
"call/audio_receive_stream.h",
+ "call/audio_send_stream.cc",
"call/audio_send_stream.h",
"call/audio_sink.h",
"call/audio_state.h",
diff --git a/webrtc/api/api.gyp b/webrtc/api/api.gyp
index 8a7fe5a..b50dfd5 100644
--- a/webrtc/api/api.gyp
+++ b/webrtc/api/api.gyp
@@ -105,6 +105,7 @@
],
'sources': [
'call/audio_receive_stream.h',
+ 'call/audio_send_stream.cc',
'call/audio_send_stream.h',
'call/audio_sink.h',
'call/audio_state.h',
diff --git a/webrtc/api/call/audio_send_stream.cc b/webrtc/api/call/audio_send_stream.cc
new file mode 100644
index 0000000..06cbc54
--- /dev/null
+++ b/webrtc/api/call/audio_send_stream.cc
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2015 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 "webrtc/api/call/audio_send_stream.h"
+
+#include <string>
+
+namespace {
+
+std::string ToString(const webrtc::CodecInst& codec_inst) {
+ std::stringstream ss;
+ ss << "{pltype: " << codec_inst.pltype;
+ ss << ", plname: \"" << codec_inst.plname << "\"";
+ ss << ", plfreq: " << codec_inst.plfreq;
+ ss << ", pacsize: " << codec_inst.pacsize;
+ ss << ", channels: " << codec_inst.channels;
+ ss << ", rate: " << codec_inst.rate;
+ ss << '}';
+ return ss.str();
+}
+} // namespace
+
+namespace webrtc {
+
+AudioSendStream::Stats::Stats() = default;
+
+AudioSendStream::Config::Config(Transport* send_transport)
+ : send_transport(send_transport) {}
+
+std::string AudioSendStream::Config::ToString() const {
+ std::stringstream ss;
+ ss << "{rtp: " << rtp.ToString();
+ ss << ", send_transport: " << (send_transport ? "(Transport)" : "nullptr");
+ ss << ", voe_channel_id: " << voe_channel_id;
+ ss << ", min_bitrate_kbps: " << min_bitrate_kbps;
+ ss << ", max_bitrate_kbps: " << max_bitrate_kbps;
+ ss << ", send_codec_spec: " << send_codec_spec.ToString();
+ ss << '}';
+ return ss.str();
+}
+
+AudioSendStream::Config::Rtp::Rtp() = default;
+
+AudioSendStream::Config::Rtp::~Rtp() = default;
+
+std::string AudioSendStream::Config::Rtp::ToString() const {
+ std::stringstream ss;
+ ss << "{ssrc: " << ssrc;
+ ss << ", extensions: [";
+ for (size_t i = 0; i < extensions.size(); ++i) {
+ ss << extensions[i].ToString();
+ if (i != extensions.size() - 1) {
+ ss << ", ";
+ }
+ }
+ ss << ']';
+ ss << ", nack: " << nack.ToString();
+ ss << ", c_name: " << c_name;
+ ss << '}';
+ return ss.str();
+}
+
+AudioSendStream::Config::SendCodecSpec::SendCodecSpec() {
+ webrtc::CodecInst empty_inst = {0};
+ codec_inst = empty_inst;
+ codec_inst.pltype = -1;
+}
+
+std::string AudioSendStream::Config::SendCodecSpec::ToString() const {
+ std::stringstream ss;
+ ss << "{nack_enabled: " << (nack_enabled ? "true" : "false");
+ ss << ", transport_cc_enabled: " << (transport_cc_enabled ? "true" : "false");
+ ss << ", enable_codec_fec: " << (enable_codec_fec ? "true" : "false");
+ ss << ", enable_opus_dtx: " << (enable_opus_dtx ? "true" : "false");
+ ss << ", opus_max_playback_rate: " << opus_max_playback_rate;
+ ss << ", cng_payload_type: " << cng_payload_type;
+ ss << ", cng_plfreq: " << cng_plfreq;
+ ss << ", codec_inst: " << ::ToString(codec_inst);
+ ss << '}';
+ return ss.str();
+}
+
+bool AudioSendStream::Config::SendCodecSpec::operator==(
+ const AudioSendStream::Config::SendCodecSpec& rhs) const {
+ if (nack_enabled != rhs.nack_enabled) {
+ return false;
+ }
+ if (transport_cc_enabled != rhs.transport_cc_enabled) {
+ return false;
+ }
+ if (enable_codec_fec != rhs.enable_codec_fec) {
+ return false;
+ }
+ if (enable_opus_dtx != rhs.enable_opus_dtx) {
+ return false;
+ }
+ if (opus_max_playback_rate != rhs.opus_max_playback_rate) {
+ return false;
+ }
+ if (cng_payload_type != rhs.cng_payload_type) {
+ return false;
+ }
+ if (cng_plfreq != rhs.cng_plfreq) {
+ return false;
+ }
+ if (codec_inst != rhs.codec_inst) {
+ return false;
+ }
+ return true;
+}
+} // namespace webrtc
diff --git a/webrtc/api/call/audio_send_stream.h b/webrtc/api/call/audio_send_stream.h
index 1956b97..7ff791e 100644
--- a/webrtc/api/call/audio_send_stream.h
+++ b/webrtc/api/call/audio_send_stream.h
@@ -30,6 +30,8 @@
class AudioSendStream {
public:
struct Stats {
+ Stats();
+
// TODO(solenberg): Harmonize naming and defaults with receive stream stats.
uint32_t local_ssrc = 0;
int64_t bytes_sent = 0;
@@ -52,13 +54,13 @@
struct Config {
Config() = delete;
- explicit Config(Transport* send_transport)
- : send_transport(send_transport) {}
-
+ explicit Config(Transport* send_transport);
std::string ToString() const;
// Send-stream specific RTP settings.
struct Rtp {
+ Rtp();
+ ~Rtp();
std::string ToString() const;
// Sender SSRC.
@@ -91,40 +93,10 @@
int max_bitrate_kbps = -1;
struct SendCodecSpec {
- SendCodecSpec() {
- webrtc::CodecInst empty_inst = {0};
- codec_inst = empty_inst;
- codec_inst.pltype = -1;
- }
- bool operator==(const SendCodecSpec& rhs) const {
- {
- if (nack_enabled != rhs.nack_enabled) {
- return false;
- }
- if (transport_cc_enabled != rhs.transport_cc_enabled) {
- return false;
- }
- if (enable_codec_fec != rhs.enable_codec_fec) {
- return false;
- }
- if (enable_opus_dtx != rhs.enable_opus_dtx) {
- return false;
- }
- if (opus_max_playback_rate != rhs.opus_max_playback_rate) {
- return false;
- }
- if (cng_payload_type != rhs.cng_payload_type) {
- return false;
- }
- if (cng_plfreq != rhs.cng_plfreq) {
- return false;
- }
- if (codec_inst != rhs.codec_inst) {
- return false;
- }
- return true;
- }
- }
+ SendCodecSpec();
+ std::string ToString() const;
+
+ bool operator==(const SendCodecSpec& rhs) const;
bool operator!=(const SendCodecSpec& rhs) const {
return !(*this == rhs);
}