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 | |
35 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. | 33 // TODO(solenberg): Harmonize naming and defaults with receive stream stats. |
36 uint32_t local_ssrc = 0; | 34 uint32_t local_ssrc = 0; |
37 int64_t bytes_sent = 0; | 35 int64_t bytes_sent = 0; |
38 int32_t packets_sent = 0; | 36 int32_t packets_sent = 0; |
39 int32_t packets_lost = -1; | 37 int32_t packets_lost = -1; |
40 float fraction_lost = -1.0f; | 38 float fraction_lost = -1.0f; |
41 std::string codec_name; | 39 std::string codec_name; |
42 int32_t ext_seqnum = -1; | 40 int32_t ext_seqnum = -1; |
43 int32_t jitter_ms = -1; | 41 int32_t jitter_ms = -1; |
44 int64_t rtt_ms = -1; | 42 int64_t rtt_ms = -1; |
45 int32_t audio_level = -1; | 43 int32_t audio_level = -1; |
46 float aec_quality_min = -1.0f; | 44 float aec_quality_min = -1.0f; |
47 int32_t echo_delay_median_ms = -1; | 45 int32_t echo_delay_median_ms = -1; |
48 int32_t echo_delay_std_ms = -1; | 46 int32_t echo_delay_std_ms = -1; |
49 int32_t echo_return_loss = -100; | 47 int32_t echo_return_loss = -100; |
50 int32_t echo_return_loss_enhancement = -100; | 48 int32_t echo_return_loss_enhancement = -100; |
51 float residual_echo_likelihood = -1.0f; | 49 float residual_echo_likelihood = -1.0f; |
52 bool typing_noise_detected = false; | 50 bool typing_noise_detected = false; |
53 }; | 51 }; |
54 | 52 |
55 struct Config { | 53 struct Config { |
56 Config() = delete; | 54 Config() = delete; |
57 explicit Config(Transport* send_transport); | 55 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(); | |
64 std::string ToString() const; | 62 std::string ToString() const; |
65 | 63 |
66 // Sender SSRC. | 64 // Sender SSRC. |
67 uint32_t ssrc = 0; | 65 uint32_t ssrc = 0; |
68 | 66 |
69 // RTP header extensions used for the sent stream. | 67 // RTP header extensions used for the sent stream. |
70 std::vector<RtpExtension> extensions; | 68 std::vector<RtpExtension> extensions; |
71 | 69 |
72 // See NackConfig for description. | 70 // See NackConfig for description. |
73 NackConfig nack; | 71 NackConfig nack; |
(...skipping 12 matching lines...) Expand all Loading... |
86 // of Call. | 84 // of Call. |
87 int voe_channel_id = -1; | 85 int voe_channel_id = -1; |
88 | 86 |
89 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to | 87 // Bitrate limits used for variable audio bitrate streams. Set both to -1 to |
90 // disable audio bitrate adaptation. | 88 // disable audio bitrate adaptation. |
91 // Note: This is still an experimental feature and not ready for real usage. | 89 // Note: This is still an experimental feature and not ready for real usage. |
92 int min_bitrate_kbps = -1; | 90 int min_bitrate_kbps = -1; |
93 int max_bitrate_kbps = -1; | 91 int max_bitrate_kbps = -1; |
94 | 92 |
95 struct SendCodecSpec { | 93 struct SendCodecSpec { |
96 SendCodecSpec(); | 94 SendCodecSpec() { |
97 std::string ToString() const; | 95 webrtc::CodecInst empty_inst = {0}; |
98 | 96 codec_inst = empty_inst; |
99 bool operator==(const SendCodecSpec& rhs) const; | 97 codec_inst.pltype = -1; |
| 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 } |
100 bool operator!=(const SendCodecSpec& rhs) const { | 128 bool operator!=(const SendCodecSpec& rhs) const { |
101 return !(*this == rhs); | 129 return !(*this == rhs); |
102 } | 130 } |
103 | 131 |
104 bool nack_enabled = false; | 132 bool nack_enabled = false; |
105 bool transport_cc_enabled = false; | 133 bool transport_cc_enabled = false; |
106 bool enable_codec_fec = false; | 134 bool enable_codec_fec = false; |
107 bool enable_opus_dtx = false; | 135 bool enable_opus_dtx = false; |
108 int opus_max_playback_rate = 0; | 136 int opus_max_playback_rate = 0; |
109 int cng_payload_type = -1; | 137 int cng_payload_type = -1; |
(...skipping 16 matching lines...) Expand all Loading... |
126 virtual void SetMuted(bool muted) = 0; | 154 virtual void SetMuted(bool muted) = 0; |
127 | 155 |
128 virtual Stats GetStats() const = 0; | 156 virtual Stats GetStats() const = 0; |
129 | 157 |
130 protected: | 158 protected: |
131 virtual ~AudioSendStream() {} | 159 virtual ~AudioSendStream() {} |
132 }; | 160 }; |
133 } // namespace webrtc | 161 } // namespace webrtc |
134 | 162 |
135 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ | 163 #endif // WEBRTC_API_CALL_AUDIO_SEND_STREAM_H_ |
OLD | NEW |