| 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 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // TODO(solenberg): Remove when VoiceEngine channels are created outside | 82 // TODO(solenberg): Remove when VoiceEngine channels are created outside |
| 83 // of Call. | 83 // of Call. |
| 84 int voe_channel_id = -1; | 84 int voe_channel_id = -1; |
| 85 | 85 |
| 86 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to | 86 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to |
| 87 // disable audio bitrate adaptation. | 87 // disable audio bitrate adaptation. |
| 88 // Note: This is still an experimental feature and not ready for real usage. | 88 // Note: This is still an experimental feature and not ready for real usage. |
| 89 int min_bitrate_kbps = -1; | 89 int min_bitrate_kbps = -1; |
| 90 int max_bitrate_kbps = -1; | 90 int max_bitrate_kbps = -1; |
| 91 | 91 |
| 92 // Defines whether to turn on audio network adaptor, and defines its config |
| 93 // string. |
| 94 rtc::Optional<std::string> audio_network_adaptor_config; |
| 95 |
| 92 struct SendCodecSpec { | 96 struct SendCodecSpec { |
| 93 SendCodecSpec() { | 97 SendCodecSpec() { |
| 94 webrtc::CodecInst empty_inst = {0}; | 98 webrtc::CodecInst empty_inst = {0}; |
| 95 codec_inst = empty_inst; | 99 codec_inst = empty_inst; |
| 96 codec_inst.pltype = -1; | 100 codec_inst.pltype = -1; |
| 97 } | 101 } |
| 98 bool operator==(const SendCodecSpec& rhs) const { | 102 bool operator==(const SendCodecSpec& rhs) const { |
| 99 { | 103 { |
| 100 if (nack_enabled != rhs.nack_enabled) { | 104 if (nack_enabled != rhs.nack_enabled) { |
| 101 return false; | 105 return false; |
| 102 } | 106 } |
| 103 if (transport_cc_enabled != rhs.transport_cc_enabled) { | 107 if (transport_cc_enabled != rhs.transport_cc_enabled) { |
| 104 return false; | 108 return false; |
| 105 } | 109 } |
| 106 if (enable_codec_fec != rhs.enable_codec_fec) { | 110 if (enable_codec_fec != rhs.enable_codec_fec) { |
| 107 return false; | 111 return false; |
| 108 } | 112 } |
| 109 if (enable_opus_dtx != rhs.enable_opus_dtx) { | 113 if (enable_opus_dtx != rhs.enable_opus_dtx) { |
| 110 return false; | 114 return false; |
| 111 } | 115 } |
| 112 if (opus_max_playback_rate != rhs.opus_max_playback_rate) { | 116 if (opus_max_playback_rate != rhs.opus_max_playback_rate) { |
| 113 return false; | 117 return false; |
| 114 } | 118 } |
| 115 if (cng_payload_type != rhs.cng_payload_type) { | 119 if (cng_payload_type != rhs.cng_payload_type) { |
| 116 return false; | 120 return false; |
| 117 } | 121 } |
| 118 if (cng_plfreq != rhs.cng_plfreq) { | 122 if (cng_plfreq != rhs.cng_plfreq) { |
| 119 return false; | 123 return false; |
| 120 } | 124 } |
| 125 if (max_ptime_ms != rhs.max_ptime_ms) { |
| 126 return false; |
| 127 } |
| 128 if (min_ptime_ms != rhs.min_ptime_ms) { |
| 129 return false; |
| 130 } |
| 121 if (codec_inst != rhs.codec_inst) { | 131 if (codec_inst != rhs.codec_inst) { |
| 122 return false; | 132 return false; |
| 123 } | 133 } |
| 124 return true; | 134 return true; |
| 125 } | 135 } |
| 126 } | 136 } |
| 127 bool operator!=(const SendCodecSpec& rhs) const { | 137 bool operator!=(const SendCodecSpec& rhs) const { |
| 128 return !(*this == rhs); | 138 return !(*this == rhs); |
| 129 } | 139 } |
| 130 | 140 |
| 131 bool nack_enabled = false; | 141 bool nack_enabled = false; |
| 132 bool transport_cc_enabled = false; | 142 bool transport_cc_enabled = false; |
| 133 bool enable_codec_fec = false; | 143 bool enable_codec_fec = false; |
| 134 bool enable_opus_dtx = false; | 144 bool enable_opus_dtx = false; |
| 135 int opus_max_playback_rate = 0; | 145 int opus_max_playback_rate = 0; |
| 136 int cng_payload_type = -1; | 146 int cng_payload_type = -1; |
| 137 int cng_plfreq = -1; | 147 int cng_plfreq = -1; |
| 148 int max_ptime_ms = -1; |
| 149 int min_ptime_ms = -1; |
| 138 webrtc::CodecInst codec_inst; | 150 webrtc::CodecInst codec_inst; |
| 139 } send_codec_spec; | 151 } send_codec_spec; |
| 140 }; | 152 }; |
| 141 | 153 |
| 142 // Starts stream activity. | 154 // Starts stream activity. |
| 143 // When a stream is active, it can receive, process and deliver packets. | 155 // When a stream is active, it can receive, process and deliver packets. |
| 144 virtual void Start() = 0; | 156 virtual void Start() = 0; |
| 145 // Stops stream activity. | 157 // Stops stream activity. |
| 146 // When a stream is stopped, it can't receive, process or deliver packets. | 158 // When a stream is stopped, it can't receive, process or deliver packets. |
| 147 virtual void Stop() = 0; | 159 virtual void Stop() = 0; |
| 148 | 160 |
| 149 // TODO(solenberg): Make payload_type a config property instead. | 161 // TODO(solenberg): Make payload_type a config property instead. |
| 150 virtual bool SendTelephoneEvent(int payload_type, int event, | 162 virtual bool SendTelephoneEvent(int payload_type, int event, |
| 151 int duration_ms) = 0; | 163 int duration_ms) = 0; |
| 152 | 164 |
| 153 virtual void SetMuted(bool muted) = 0; | 165 virtual void SetMuted(bool muted) = 0; |
| 154 | 166 |
| 155 virtual Stats GetStats() const = 0; | 167 virtual Stats GetStats() const = 0; |
| 156 | 168 |
| 157 protected: | 169 protected: |
| 158 virtual ~AudioSendStream() {} | 170 virtual ~AudioSendStream() {} |
| 159 }; | 171 }; |
| 160 } // namespace webrtc | 172 } // namespace webrtc |
| 161 | 173 |
| 162 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ | 174 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ |
| OLD | NEW |