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 12 matching lines...) Expand all Loading... |
23 namespace webrtc { | 23 namespace webrtc { |
24 | 24 |
25 // WORK IN PROGRESS | 25 // WORK IN PROGRESS |
26 // This class is under development and is not yet intended for for use outside | 26 // This class is under development and is not yet intended for for use outside |
27 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. | 27 // of WebRtc/Libjingle. Please use the VoiceEngine API instead. |
28 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 | 28 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690 |
29 | 29 |
30 class AudioSendStream { | 30 class AudioSendStream { |
31 public: | 31 public: |
32 struct Stats { | 32 struct Stats { |
| 33 Stats(); |
| 34 |
33 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. | 35 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. |
34 uint32_t local_ssrc = 0; | 36 uint32_t local_ssrc = 0; |
35 int64_t bytes_sent = 0; | 37 int64_t bytes_sent = 0; |
36 int32_t packets_sent = 0; | 38 int32_t packets_sent = 0; |
37 int32_t packets_lost = -1; | 39 int32_t packets_lost = -1; |
38 float fraction_lost = -1.0f; | 40 float fraction_lost = -1.0f; |
39 std::string codec_name; | 41 std::string codec_name; |
40 int32_t ext_seqnum = -1; | 42 int32_t ext_seqnum = -1; |
41 int32_t jitter_ms = -1; | 43 int32_t jitter_ms = -1; |
42 int64_t rtt_ms = -1; | 44 int64_t rtt_ms = -1; |
43 int32_t audio_level = -1; | 45 int32_t audio_level = -1; |
44 float aec_quality_min = -1.0f; | 46 float aec_quality_min = -1.0f; |
45 int32_t echo_delay_median_ms = -1; | 47 int32_t echo_delay_median_ms = -1; |
46 int32_t echo_delay_std_ms = -1; | 48 int32_t echo_delay_std_ms = -1; |
47 int32_t echo_return_loss = -100; | 49 int32_t echo_return_loss = -100; |
48 int32_t echo_return_loss_enhancement = -100; | 50 int32_t echo_return_loss_enhancement = -100; |
49 float residual_echo_likelihood = -1.0f; | 51 float residual_echo_likelihood = -1.0f; |
50 bool typing_noise_detected = false; | 52 bool typing_noise_detected = false; |
51 }; | 53 }; |
52 | 54 |
53 struct Config { | 55 struct Config { |
54 Config() = delete; | 56 Config() = delete; |
55 explicit Config(Transport* send_transport) | 57 explicit Config(Transport* send_transport); |
56 : send_transport(send_transport) {} | |
57 | |
58 std::string ToString() const; | 58 std::string ToString() const; |
59 | 59 |
60 // Send-stream specific RTP settings. | 60 // Send-stream specific RTP settings. |
61 struct Rtp { | 61 struct Rtp { |
| 62 Rtp(); |
| 63 ~Rtp(); |
62 std::string ToString() const; | 64 std::string ToString() const; |
63 | 65 |
64 // Sender SSRC. | 66 // Sender SSRC. |
65 uint32_t ssrc = 0; | 67 uint32_t ssrc = 0; |
66 | 68 |
67 // RTP header extensions used for the sent stream. | 69 // RTP header extensions used for the sent stream. |
68 std::vector<RtpExtension> extensions; | 70 std::vector<RtpExtension> extensions; |
69 | 71 |
70 // See NackConfig for description. | 72 // See NackConfig for description. |
71 NackConfig nack; | 73 NackConfig nack; |
(...skipping 12 matching lines...) Expand all Loading... |
84 // of Call. | 86 // of Call. |
85 int voe_channel_id = -1; | 87 int voe_channel_id = -1; |
86 | 88 |
87 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to | 89 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to |
88 // disable audio bitrate adaptation. | 90 // disable audio bitrate adaptation. |
89 // Note: This is still an experimental feature and not ready for real usage. | 91 // Note: This is still an experimental feature and not ready for real usage. |
90 int min_bitrate_kbps = -1; | 92 int min_bitrate_kbps = -1; |
91 int max_bitrate_kbps = -1; | 93 int max_bitrate_kbps = -1; |
92 | 94 |
93 struct SendCodecSpec { | 95 struct SendCodecSpec { |
94 SendCodecSpec() { | 96 SendCodecSpec(); |
95 webrtc::CodecInst empty_inst = {0}; | 97 std::string ToString() const; |
96 codec_inst = empty_inst; | 98 |
97 codec_inst.pltype = -1; | 99 bool operator==(const SendCodecSpec& rhs) const; |
98 } | |
99 bool operator==(const SendCodecSpec& rhs) const { | |
100 { | |
101 if (nack_enabled != rhs.nack_enabled) { | |
102 return false; | |
103 } | |
104 if (transport_cc_enabled != rhs.transport_cc_enabled) { | |
105 return false; | |
106 } | |
107 if (enable_codec_fec != rhs.enable_codec_fec) { | |
108 return false; | |
109 } | |
110 if (enable_opus_dtx != rhs.enable_opus_dtx) { | |
111 return false; | |
112 } | |
113 if (opus_max_playback_rate != rhs.opus_max_playback_rate) { | |
114 return false; | |
115 } | |
116 if (cng_payload_type != rhs.cng_payload_type) { | |
117 return false; | |
118 } | |
119 if (cng_plfreq != rhs.cng_plfreq) { | |
120 return false; | |
121 } | |
122 if (codec_inst != rhs.codec_inst) { | |
123 return false; | |
124 } | |
125 return true; | |
126 } | |
127 } | |
128 bool operator!=(const SendCodecSpec& rhs) const { | 100 bool operator!=(const SendCodecSpec& rhs) const { |
129 return !(*this == rhs); | 101 return !(*this == rhs); |
130 } | 102 } |
131 | 103 |
132 bool nack_enabled = false; | 104 bool nack_enabled = false; |
133 bool transport_cc_enabled = false; | 105 bool transport_cc_enabled = false; |
134 bool enable_codec_fec = false; | 106 bool enable_codec_fec = false; |
135 bool enable_opus_dtx = false; | 107 bool enable_opus_dtx = false; |
136 int opus_max_playback_rate = 0; | 108 int opus_max_playback_rate = 0; |
137 int cng_payload_type = -1; | 109 int cng_payload_type = -1; |
(...skipping 16 matching lines...) Expand all Loading... |
154 virtual void SetMuted(bool muted) = 0; | 126 virtual void SetMuted(bool muted) = 0; |
155 | 127 |
156 virtual Stats GetStats() const = 0; | 128 virtual Stats GetStats() const = 0; |
157 | 129 |
158 protected: | 130 protected: |
159 virtual ~AudioSendStream() {} | 131 virtual ~AudioSendStream() {} |
160 }; | 132 }; |
161 } // namespace webrtc | 133 } // namespace webrtc |
162 | 134 |
163 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ | 135 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ |
OLD | NEW |