Chromium Code Reviews

Side by Side Diff: webrtc/media/base/mediachannel.h

Issue 1697163002: Remove conference_mode flag from AudioOptions and VideoOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix logic when SetSendParameters changes conference_mode but no options. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | webrtc/media/base/videoengine_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 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 111 matching lines...)
122 SetFrom(&auto_gain_control, change.auto_gain_control); 122 SetFrom(&auto_gain_control, change.auto_gain_control);
123 SetFrom(&noise_suppression, change.noise_suppression); 123 SetFrom(&noise_suppression, change.noise_suppression);
124 SetFrom(&highpass_filter, change.highpass_filter); 124 SetFrom(&highpass_filter, change.highpass_filter);
125 SetFrom(&stereo_swapping, change.stereo_swapping); 125 SetFrom(&stereo_swapping, change.stereo_swapping);
126 SetFrom(&audio_jitter_buffer_max_packets, 126 SetFrom(&audio_jitter_buffer_max_packets,
127 change.audio_jitter_buffer_max_packets); 127 change.audio_jitter_buffer_max_packets);
128 SetFrom(&audio_jitter_buffer_fast_accelerate, 128 SetFrom(&audio_jitter_buffer_fast_accelerate,
129 change.audio_jitter_buffer_fast_accelerate); 129 change.audio_jitter_buffer_fast_accelerate);
130 SetFrom(&typing_detection, change.typing_detection); 130 SetFrom(&typing_detection, change.typing_detection);
131 SetFrom(&aecm_generate_comfort_noise, change.aecm_generate_comfort_noise); 131 SetFrom(&aecm_generate_comfort_noise, change.aecm_generate_comfort_noise);
132 SetFrom(&conference_mode, change.conference_mode);
133 SetFrom(&adjust_agc_delta, change.adjust_agc_delta); 132 SetFrom(&adjust_agc_delta, change.adjust_agc_delta);
134 SetFrom(&experimental_agc, change.experimental_agc); 133 SetFrom(&experimental_agc, change.experimental_agc);
135 SetFrom(&extended_filter_aec, change.extended_filter_aec); 134 SetFrom(&extended_filter_aec, change.extended_filter_aec);
136 SetFrom(&delay_agnostic_aec, change.delay_agnostic_aec); 135 SetFrom(&delay_agnostic_aec, change.delay_agnostic_aec);
137 SetFrom(&experimental_ns, change.experimental_ns); 136 SetFrom(&experimental_ns, change.experimental_ns);
138 SetFrom(&aec_dump, change.aec_dump); 137 SetFrom(&aec_dump, change.aec_dump);
139 SetFrom(&tx_agc_target_dbov, change.tx_agc_target_dbov); 138 SetFrom(&tx_agc_target_dbov, change.tx_agc_target_dbov);
140 SetFrom(&tx_agc_digital_compression_gain, 139 SetFrom(&tx_agc_digital_compression_gain,
141 change.tx_agc_digital_compression_gain); 140 change.tx_agc_digital_compression_gain);
142 SetFrom(&tx_agc_limiter, change.tx_agc_limiter); 141 SetFrom(&tx_agc_limiter, change.tx_agc_limiter);
143 SetFrom(&recording_sample_rate, change.recording_sample_rate); 142 SetFrom(&recording_sample_rate, change.recording_sample_rate);
144 SetFrom(&playout_sample_rate, change.playout_sample_rate); 143 SetFrom(&playout_sample_rate, change.playout_sample_rate);
145 SetFrom(&combined_audio_video_bwe, change.combined_audio_video_bwe); 144 SetFrom(&combined_audio_video_bwe, change.combined_audio_video_bwe);
146 } 145 }
147 146
148 bool operator==(const AudioOptions& o) const { 147 bool operator==(const AudioOptions& o) const {
149 return echo_cancellation == o.echo_cancellation && 148 return echo_cancellation == o.echo_cancellation &&
150 auto_gain_control == o.auto_gain_control && 149 auto_gain_control == o.auto_gain_control &&
151 noise_suppression == o.noise_suppression && 150 noise_suppression == o.noise_suppression &&
152 highpass_filter == o.highpass_filter && 151 highpass_filter == o.highpass_filter &&
153 stereo_swapping == o.stereo_swapping && 152 stereo_swapping == o.stereo_swapping &&
154 audio_jitter_buffer_max_packets == o.audio_jitter_buffer_max_packets && 153 audio_jitter_buffer_max_packets == o.audio_jitter_buffer_max_packets &&
155 audio_jitter_buffer_fast_accelerate == 154 audio_jitter_buffer_fast_accelerate ==
156 o.audio_jitter_buffer_fast_accelerate && 155 o.audio_jitter_buffer_fast_accelerate &&
157 typing_detection == o.typing_detection && 156 typing_detection == o.typing_detection &&
158 aecm_generate_comfort_noise == o.aecm_generate_comfort_noise && 157 aecm_generate_comfort_noise == o.aecm_generate_comfort_noise &&
159 conference_mode == o.conference_mode &&
160 experimental_agc == o.experimental_agc && 158 experimental_agc == o.experimental_agc &&
161 extended_filter_aec == o.extended_filter_aec && 159 extended_filter_aec == o.extended_filter_aec &&
162 delay_agnostic_aec == o.delay_agnostic_aec && 160 delay_agnostic_aec == o.delay_agnostic_aec &&
163 experimental_ns == o.experimental_ns && 161 experimental_ns == o.experimental_ns &&
164 adjust_agc_delta == o.adjust_agc_delta && 162 adjust_agc_delta == o.adjust_agc_delta &&
165 aec_dump == o.aec_dump && 163 aec_dump == o.aec_dump &&
166 tx_agc_target_dbov == o.tx_agc_target_dbov && 164 tx_agc_target_dbov == o.tx_agc_target_dbov &&
167 tx_agc_digital_compression_gain == o.tx_agc_digital_compression_gain && 165 tx_agc_digital_compression_gain == o.tx_agc_digital_compression_gain &&
168 tx_agc_limiter == o.tx_agc_limiter && 166 tx_agc_limiter == o.tx_agc_limiter &&
169 recording_sample_rate == o.recording_sample_rate && 167 recording_sample_rate == o.recording_sample_rate &&
170 playout_sample_rate == o.playout_sample_rate && 168 playout_sample_rate == o.playout_sample_rate &&
171 combined_audio_video_bwe == o.combined_audio_video_bwe; 169 combined_audio_video_bwe == o.combined_audio_video_bwe;
172 } 170 }
173 171
174 std::string ToString() const { 172 std::string ToString() const {
175 std::ostringstream ost; 173 std::ostringstream ost;
176 ost << "AudioOptions {"; 174 ost << "AudioOptions {";
177 ost << ToStringIfSet("aec", echo_cancellation); 175 ost << ToStringIfSet("aec", echo_cancellation);
178 ost << ToStringIfSet("agc", auto_gain_control); 176 ost << ToStringIfSet("agc", auto_gain_control);
179 ost << ToStringIfSet("ns", noise_suppression); 177 ost << ToStringIfSet("ns", noise_suppression);
180 ost << ToStringIfSet("hf", highpass_filter); 178 ost << ToStringIfSet("hf", highpass_filter);
181 ost << ToStringIfSet("swap", stereo_swapping); 179 ost << ToStringIfSet("swap", stereo_swapping);
182 ost << ToStringIfSet("audio_jitter_buffer_max_packets", 180 ost << ToStringIfSet("audio_jitter_buffer_max_packets",
183 audio_jitter_buffer_max_packets); 181 audio_jitter_buffer_max_packets);
184 ost << ToStringIfSet("audio_jitter_buffer_fast_accelerate", 182 ost << ToStringIfSet("audio_jitter_buffer_fast_accelerate",
185 audio_jitter_buffer_fast_accelerate); 183 audio_jitter_buffer_fast_accelerate);
186 ost << ToStringIfSet("typing", typing_detection); 184 ost << ToStringIfSet("typing", typing_detection);
187 ost << ToStringIfSet("comfort_noise", aecm_generate_comfort_noise); 185 ost << ToStringIfSet("comfort_noise", aecm_generate_comfort_noise);
188 ost << ToStringIfSet("conference", conference_mode);
189 ost << ToStringIfSet("agc_delta", adjust_agc_delta); 186 ost << ToStringIfSet("agc_delta", adjust_agc_delta);
190 ost << ToStringIfSet("experimental_agc", experimental_agc); 187 ost << ToStringIfSet("experimental_agc", experimental_agc);
191 ost << ToStringIfSet("extended_filter_aec", extended_filter_aec); 188 ost << ToStringIfSet("extended_filter_aec", extended_filter_aec);
192 ost << ToStringIfSet("delay_agnostic_aec", delay_agnostic_aec); 189 ost << ToStringIfSet("delay_agnostic_aec", delay_agnostic_aec);
193 ost << ToStringIfSet("experimental_ns", experimental_ns); 190 ost << ToStringIfSet("experimental_ns", experimental_ns);
194 ost << ToStringIfSet("aec_dump", aec_dump); 191 ost << ToStringIfSet("aec_dump", aec_dump);
195 ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov); 192 ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov);
196 ost << ToStringIfSet("tx_agc_digital_compression_gain", 193 ost << ToStringIfSet("tx_agc_digital_compression_gain",
197 tx_agc_digital_compression_gain); 194 tx_agc_digital_compression_gain);
198 ost << ToStringIfSet("tx_agc_limiter", tx_agc_limiter); 195 ost << ToStringIfSet("tx_agc_limiter", tx_agc_limiter);
(...skipping 15 matching lines...)
214 rtc::Optional<bool> highpass_filter; 211 rtc::Optional<bool> highpass_filter;
215 // Audio processing to swap the left and right channels. 212 // Audio processing to swap the left and right channels.
216 rtc::Optional<bool> stereo_swapping; 213 rtc::Optional<bool> stereo_swapping;
217 // Audio receiver jitter buffer (NetEq) max capacity in number of packets. 214 // Audio receiver jitter buffer (NetEq) max capacity in number of packets.
218 rtc::Optional<int> audio_jitter_buffer_max_packets; 215 rtc::Optional<int> audio_jitter_buffer_max_packets;
219 // Audio receiver jitter buffer (NetEq) fast accelerate mode. 216 // Audio receiver jitter buffer (NetEq) fast accelerate mode.
220 rtc::Optional<bool> audio_jitter_buffer_fast_accelerate; 217 rtc::Optional<bool> audio_jitter_buffer_fast_accelerate;
221 // Audio processing to detect typing. 218 // Audio processing to detect typing.
222 rtc::Optional<bool> typing_detection; 219 rtc::Optional<bool> typing_detection;
223 rtc::Optional<bool> aecm_generate_comfort_noise; 220 rtc::Optional<bool> aecm_generate_comfort_noise;
224 rtc::Optional<bool> conference_mode;
225 rtc::Optional<int> adjust_agc_delta; 221 rtc::Optional<int> adjust_agc_delta;
226 rtc::Optional<bool> experimental_agc; 222 rtc::Optional<bool> experimental_agc;
227 rtc::Optional<bool> extended_filter_aec; 223 rtc::Optional<bool> extended_filter_aec;
228 rtc::Optional<bool> delay_agnostic_aec; 224 rtc::Optional<bool> delay_agnostic_aec;
229 rtc::Optional<bool> experimental_ns; 225 rtc::Optional<bool> experimental_ns;
230 rtc::Optional<bool> aec_dump; 226 rtc::Optional<bool> aec_dump;
231 // Note that tx_agc_* only applies to non-experimental AGC. 227 // Note that tx_agc_* only applies to non-experimental AGC.
232 rtc::Optional<uint16_t> tx_agc_target_dbov; 228 rtc::Optional<uint16_t> tx_agc_target_dbov;
233 rtc::Optional<uint16_t> tx_agc_digital_compression_gain; 229 rtc::Optional<uint16_t> tx_agc_digital_compression_gain;
234 rtc::Optional<bool> tx_agc_limiter; 230 rtc::Optional<bool> tx_agc_limiter;
(...skipping 14 matching lines...)
249 } 245 }
250 }; 246 };
251 247
252 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. 248 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine.
253 // Used to be flags, but that makes it hard to selectively apply options. 249 // Used to be flags, but that makes it hard to selectively apply options.
254 // We are moving all of the setting of options to structs like this, 250 // We are moving all of the setting of options to structs like this,
255 // but some things currently still use flags. 251 // but some things currently still use flags.
256 struct VideoOptions { 252 struct VideoOptions {
257 void SetAll(const VideoOptions& change) { 253 void SetAll(const VideoOptions& change) {
258 SetFrom(&video_noise_reduction, change.video_noise_reduction); 254 SetFrom(&video_noise_reduction, change.video_noise_reduction);
259 SetFrom(&conference_mode, change.conference_mode);
260 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate); 255 SetFrom(&suspend_below_min_bitrate, change.suspend_below_min_bitrate);
261 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps); 256 SetFrom(&screencast_min_bitrate_kbps, change.screencast_min_bitrate_kbps);
262 } 257 }
263 258
264 bool operator==(const VideoOptions& o) const { 259 bool operator==(const VideoOptions& o) const {
265 return video_noise_reduction == o.video_noise_reduction && 260 return video_noise_reduction == o.video_noise_reduction &&
266 conference_mode == o.conference_mode &&
267 suspend_below_min_bitrate == o.suspend_below_min_bitrate && 261 suspend_below_min_bitrate == o.suspend_below_min_bitrate &&
268 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps; 262 screencast_min_bitrate_kbps == o.screencast_min_bitrate_kbps;
269 } 263 }
270 264
271 std::string ToString() const { 265 std::string ToString() const {
272 std::ostringstream ost; 266 std::ostringstream ost;
273 ost << "VideoOptions {"; 267 ost << "VideoOptions {";
274 ost << ToStringIfSet("noise reduction", video_noise_reduction); 268 ost << ToStringIfSet("noise reduction", video_noise_reduction);
275 ost << ToStringIfSet("conference mode", conference_mode);
276 ost << ToStringIfSet("suspend below min bitrate", 269 ost << ToStringIfSet("suspend below min bitrate",
277 suspend_below_min_bitrate); 270 suspend_below_min_bitrate);
278 ost << ToStringIfSet("screencast min bitrate kbps", 271 ost << ToStringIfSet("screencast min bitrate kbps",
279 screencast_min_bitrate_kbps); 272 screencast_min_bitrate_kbps);
280 ost << "}"; 273 ost << "}";
281 return ost.str(); 274 return ost.str();
282 } 275 }
283 276
284 // Enable denoising? This flag comes from the getUserMedia 277 // Enable denoising? This flag comes from the getUserMedia
285 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it 278 // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it
286 // on to the codec options. Disabled by default. 279 // on to the codec options. Disabled by default.
287 rtc::Optional<bool> video_noise_reduction; 280 rtc::Optional<bool> video_noise_reduction;
288 // Use conference mode? This flag comes from the remote
289 // description's SDP line 'a=x-google-flag:conference', copied over
290 // by VideoChannel::SetRemoteContent_w, and ultimately used by
291 // conference mode screencast logic in
292 // WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig.
293 // The special screencast behaviour is disabled by default.
294 rtc::Optional<bool> conference_mode;
295 // Enable WebRTC suspension of video. No video frames will be sent 281 // Enable WebRTC suspension of video. No video frames will be sent
296 // when the bitrate is below the configured minimum bitrate. This 282 // when the bitrate is below the configured minimum bitrate. This
297 // flag comes from the PeerConnection constraint 283 // flag comes from the PeerConnection constraint
298 // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it 284 // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it
299 // to VideoSendStream::Config::suspend_below_min_bitrate. 285 // to VideoSendStream::Config::suspend_below_min_bitrate.
300 rtc::Optional<bool> suspend_below_min_bitrate; 286 rtc::Optional<bool> suspend_below_min_bitrate;
301 // Force screencast to use a minimum bitrate. This flag comes from 287 // Force screencast to use a minimum bitrate. This flag comes from
302 // the PeerConnection constraint 'googScreencastMinBitrate'. It is 288 // the PeerConnection constraint 'googScreencastMinBitrate'. It is
303 // copied to the encoder config by WebRtcVideoChannel2. 289 // copied to the encoder config by WebRtcVideoChannel2.
304 rtc::Optional<int> screencast_min_bitrate_kbps; 290 rtc::Optional<int> screencast_min_bitrate_kbps;
(...skipping 634 matching lines...)
939 virtual bool InsertDtmf(uint32_t ssrc, int event, int duration) = 0; 925 virtual bool InsertDtmf(uint32_t ssrc, int event, int duration) = 0;
940 // Gets quality stats for the channel. 926 // Gets quality stats for the channel.
941 virtual bool GetStats(VoiceMediaInfo* info) = 0; 927 virtual bool GetStats(VoiceMediaInfo* info) = 0;
942 928
943 virtual void SetRawAudioSink( 929 virtual void SetRawAudioSink(
944 uint32_t ssrc, 930 uint32_t ssrc,
945 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0; 931 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0;
946 }; 932 };
947 933
948 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> { 934 struct VideoSendParameters : RtpSendParameters<VideoCodec, VideoOptions> {
935 // Use conference mode? This flag comes from the remote
936 // description's SDP line 'a=x-google-flag:conference', copied over
937 // by VideoChannel::SetRemoteContent_w, and ultimately used by
938 // conference mode screencast logic in
939 // WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig.
940 // The special screencast behaviour is disabled by default.
941 bool conference_mode = false;
949 }; 942 };
950 943
951 struct VideoRecvParameters : RtpParameters<VideoCodec> { 944 struct VideoRecvParameters : RtpParameters<VideoCodec> {
952 }; 945 };
953 946
954 class VideoMediaChannel : public MediaChannel { 947 class VideoMediaChannel : public MediaChannel {
955 public: 948 public:
956 enum Error { 949 enum Error {
957 ERROR_NONE = 0, // No error. 950 ERROR_NONE = 0, // No error.
958 ERROR_OTHER, // Other errors. 951 ERROR_OTHER, // Other errors.
(...skipping 155 matching lines...)
1114 // Signal when the media channel is ready to send the stream. Arguments are: 1107 // Signal when the media channel is ready to send the stream. Arguments are:
1115 // writable(bool) 1108 // writable(bool)
1116 sigslot::signal1<bool> SignalReadyToSend; 1109 sigslot::signal1<bool> SignalReadyToSend;
1117 // Signal for notifying that the remote side has closed the DataChannel. 1110 // Signal for notifying that the remote side has closed the DataChannel.
1118 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; 1111 sigslot::signal1<uint32_t> SignalStreamClosedRemotely;
1119 }; 1112 };
1120 1113
1121 } // namespace cricket 1114 } // namespace cricket
1122 1115
1123 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_ 1116 #endif // WEBRTC_MEDIA_BASE_MEDIACHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/videoengine_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine