Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/call/audio_send_stream.h" | 11 #include "webrtc/call/audio_send_stream.h" |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 namespace { | |
| 16 | |
| 17 std::string ToString(const webrtc::CodecInst& codec_inst) { | |
| 18 std::stringstream ss; | |
| 19 ss << "{pltype: " << codec_inst.pltype; | |
| 20 ss << ", plname: \"" << codec_inst.plname << "\""; | |
| 21 ss << ", plfreq: " << codec_inst.plfreq; | |
| 22 ss << ", pacsize: " << codec_inst.pacsize; | |
| 23 ss << ", channels: " << codec_inst.channels; | |
| 24 ss << ", rate: " << codec_inst.rate; | |
| 25 ss << '}'; | |
| 26 return ss.str(); | |
| 27 } | |
| 28 } // namespace | |
| 29 | |
| 30 namespace webrtc { | 15 namespace webrtc { |
| 31 | 16 |
| 32 AudioSendStream::Stats::Stats() = default; | 17 AudioSendStream::Stats::Stats() = default; |
| 33 AudioSendStream::Stats::~Stats() = default; | 18 AudioSendStream::Stats::~Stats() = default; |
| 34 | 19 |
| 35 AudioSendStream::Config::Config(Transport* send_transport) | 20 AudioSendStream::Config::Config(Transport* send_transport) |
| 36 : send_transport(send_transport) {} | 21 : send_transport(send_transport) {} |
| 37 | 22 |
| 38 AudioSendStream::Config::~Config() = default; | 23 AudioSendStream::Config::~Config() = default; |
| 39 | 24 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 63 ss << ", "; | 48 ss << ", "; |
| 64 } | 49 } |
| 65 } | 50 } |
| 66 ss << ']'; | 51 ss << ']'; |
| 67 ss << ", nack: " << nack.ToString(); | 52 ss << ", nack: " << nack.ToString(); |
| 68 ss << ", c_name: " << c_name; | 53 ss << ", c_name: " << c_name; |
| 69 ss << '}'; | 54 ss << '}'; |
| 70 return ss.str(); | 55 return ss.str(); |
| 71 } | 56 } |
| 72 | 57 |
| 73 AudioSendStream::Config::SendCodecSpec::SendCodecSpec() { | 58 AudioSendStream::Config::SendCodecSpec::SendCodecSpec() |
| 74 webrtc::CodecInst empty_inst = {0}; | 59 : 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
| |
| 75 codec_inst = empty_inst; | 60 |
| 76 codec_inst.pltype = -1; | 61 AudioSendStream::Config::SendCodecSpec::~SendCodecSpec() = default; |
| 77 } | |
| 78 | 62 |
| 79 std::string AudioSendStream::Config::SendCodecSpec::ToString() const { | 63 std::string AudioSendStream::Config::SendCodecSpec::ToString() const { |
| 80 std::stringstream ss; | 64 std::stringstream ss; |
| 81 ss << "{nack_enabled: " << (nack_enabled ? "true" : "false"); | 65 ss << "{nack_enabled: " << (nack_enabled ? "true" : "false"); |
| 82 ss << ", transport_cc_enabled: " << (transport_cc_enabled ? "true" : "false"); | 66 ss << ", transport_cc_enabled: " << (transport_cc_enabled ? "true" : "false"); |
| 83 ss << ", enable_codec_fec: " << (enable_codec_fec ? "true" : "false"); | |
| 84 ss << ", enable_opus_dtx: " << (enable_opus_dtx ? "true" : "false"); | |
| 85 ss << ", opus_max_playback_rate: " << opus_max_playback_rate; | |
| 86 ss << ", cng_payload_type: " << cng_payload_type; | 67 ss << ", cng_payload_type: " << cng_payload_type; |
| 87 ss << ", cng_plfreq: " << cng_plfreq; | 68 ss << ", payload_type: " << payload_type; |
| 88 ss << ", min_ptime: " << min_ptime_ms; | 69 ss << ", format: " << format; |
| 89 ss << ", max_ptime: " << max_ptime_ms; | |
| 90 ss << ", codec_inst: " << ::ToString(codec_inst); | |
| 91 ss << '}'; | 70 ss << '}'; |
| 92 return ss.str(); | 71 return ss.str(); |
| 93 } | 72 } |
| 94 | 73 |
| 95 bool AudioSendStream::Config::SendCodecSpec::operator==( | 74 bool AudioSendStream::Config::SendCodecSpec::operator==( |
| 96 const AudioSendStream::Config::SendCodecSpec& rhs) const { | 75 const AudioSendStream::Config::SendCodecSpec& rhs) const { |
| 97 if (nack_enabled == rhs.nack_enabled && | 76 if (nack_enabled == rhs.nack_enabled && |
| 98 transport_cc_enabled == rhs.transport_cc_enabled && | 77 transport_cc_enabled == rhs.transport_cc_enabled && |
| 99 enable_codec_fec == rhs.enable_codec_fec && | |
| 100 enable_opus_dtx == rhs.enable_opus_dtx && | |
| 101 opus_max_playback_rate == rhs.opus_max_playback_rate && | |
| 102 cng_payload_type == rhs.cng_payload_type && | 78 cng_payload_type == rhs.cng_payload_type && |
| 103 cng_plfreq == rhs.cng_plfreq && max_ptime_ms == rhs.max_ptime_ms && | 79 payload_type == rhs.payload_type && format == rhs.format && |
| 104 min_ptime_ms == rhs.min_ptime_ms && codec_inst == rhs.codec_inst) { | 80 target_bitrate_bps == rhs.target_bitrate_bps) { |
| 105 return true; | 81 return true; |
| 106 } | 82 } |
| 107 return false; | 83 return false; |
| 108 } | 84 } |
| 109 } // namespace webrtc | 85 } // namespace webrtc |
| OLD | NEW |