Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: webrtc/call/audio_send_stream.cc

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Moved encoder creation up into AudioSendStream, bypassing most of Channel. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/call/audio_send_stream.cc
diff --git a/webrtc/call/audio_send_stream.cc b/webrtc/call/audio_send_stream.cc
index 8b6dd9e416fc025f619aefb139e9732f334e2cb5..28638cac2cf98b422f0c50d069ea73d9cd7da99f 100644
--- a/webrtc/call/audio_send_stream.cc
+++ b/webrtc/call/audio_send_stream.cc
@@ -12,21 +12,6 @@
#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;
@@ -70,24 +55,18 @@ std::string AudioSendStream::Config::Rtp::ToString() const {
return ss.str();
}
-AudioSendStream::Config::SendCodecSpec::SendCodecSpec() {
- webrtc::CodecInst empty_inst = {0};
- codec_inst = empty_inst;
- codec_inst.pltype = -1;
-}
+AudioSendStream::Config::SendCodecSpec::SendCodecSpec()
+ : format("", 0, 0) {}
kwiberg-webrtc 2017/03/01 12:26:47 Why have a default constructor for this type? rtc:
ossu 2017/03/02 01:30:28 That's the big problem, currently. Eventually, the
ossu 2017/03/20 18:19:48 Seems I didn't really understand the flow previous
+
+AudioSendStream::Config::SendCodecSpec::~SendCodecSpec() = default;
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 << ", min_ptime: " << min_ptime_ms;
- ss << ", max_ptime: " << max_ptime_ms;
- ss << ", codec_inst: " << ::ToString(codec_inst);
+ ss << ", payload_type: " << payload_type;
+ ss << ", format: " << format;
ss << '}';
return ss.str();
}
@@ -96,12 +75,9 @@ bool AudioSendStream::Config::SendCodecSpec::operator==(
const AudioSendStream::Config::SendCodecSpec& rhs) const {
if (nack_enabled == rhs.nack_enabled &&
transport_cc_enabled == rhs.transport_cc_enabled &&
- enable_codec_fec == rhs.enable_codec_fec &&
- enable_opus_dtx == rhs.enable_opus_dtx &&
- opus_max_playback_rate == rhs.opus_max_playback_rate &&
cng_payload_type == rhs.cng_payload_type &&
- cng_plfreq == rhs.cng_plfreq && max_ptime_ms == rhs.max_ptime_ms &&
- min_ptime_ms == rhs.min_ptime_ms && codec_inst == rhs.codec_inst) {
+ payload_type == rhs.payload_type && format == rhs.format &&
+ target_bitrate_bps == rhs.target_bitrate_bps) {
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698