1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "audio/audio_receive_stream.h"
12
13 #include <map>
14 #include <string>
15 #include <utility>
16 #include <vector>
17
18 #include "api/test/mock_audio_mixer.h"
19 #include "api/test/mock_frame_decryptor.h"
20 #include "audio/conversion.h"
21 #include "audio/mock_voe_channel_proxy.h"
22 #include "call/rtp_stream_receiver_controller.h"
23 #include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
24 #include "modules/audio_device/include/mock_audio_device.h"
25 #include "modules/audio_processing/include/mock_audio_processing.h"
26 #include "modules/pacing/packet_router.h"
27 #include "modules/rtp_rtcp/source/byte_io.h"
28 #include "rtc_base/time_utils.h"
29 #include "test/gtest.h"
30 #include "test/mock_audio_decoder_factory.h"
31 #include "test/mock_transport.h"
32
33 namespace webrtc {
34 namespace test {
35 namespace {
36
37 using ::testing::_;
38 using ::testing::FloatEq;
39 using ::testing::NiceMock;
40 using ::testing::Return;
41
MakeAudioDecodeStatsForTest()42 AudioDecodingCallStats MakeAudioDecodeStatsForTest() {
43 AudioDecodingCallStats audio_decode_stats;
44 audio_decode_stats.calls_to_silence_generator = 234;
45 audio_decode_stats.calls_to_neteq = 567;
46 audio_decode_stats.decoded_normal = 890;
47 audio_decode_stats.decoded_neteq_plc = 123;
48 audio_decode_stats.decoded_codec_plc = 124;
49 audio_decode_stats.decoded_cng = 456;
50 audio_decode_stats.decoded_plc_cng = 789;
51 audio_decode_stats.decoded_muted_output = 987;
52 return audio_decode_stats;
53 }
54
55 const uint32_t kRemoteSsrc = 1234;
56 const uint32_t kLocalSsrc = 5678;
57 const int kAudioLevelId = 3;
58 const int kTransportSequenceNumberId = 4;
59 const int kJitterBufferDelay = -7;
60 const int kPlayoutBufferDelay = 302;
61 const unsigned int kSpeechOutputLevel = 99;
62 const double kTotalOutputEnergy = 0.25;
63 const double kTotalOutputDuration = 0.5;
64 const int64_t kPlayoutNtpTimestampMs = 5678;
65
66 const CallReceiveStatistics kCallStats = {678, 234, -12, 567, 78, 890, 123};
67 const std::pair<int, SdpAudioFormat> kReceiveCodec = {
68 123,
69 {"codec_name_recv", 96000, 0}};
70 const NetworkStatistics kNetworkStats = {
71 /*currentBufferSize=*/123,
72 /*preferredBufferSize=*/456,
73 /*jitterPeaksFound=*/false,
74 /*totalSamplesReceived=*/789012,
75 /*concealedSamples=*/3456,
76 /*silentConcealedSamples=*/123,
77 /*concealmentEvents=*/456,
78 /*jitterBufferDelayMs=*/789,
79 /*jitterBufferEmittedCount=*/543,
80 /*jitterBufferTargetDelayMs=*/123,
81 /*jitterBufferMinimumDelayMs=*/222,
82 /*insertedSamplesForDeceleration=*/432,
83 /*removedSamplesForAcceleration=*/321,
84 /*fecPacketsReceived=*/123,
85 /*fecPacketsDiscarded=*/101,
86 /*packetsDiscarded=*/989,
87 /*currentExpandRate=*/789,
88 /*currentSpeechExpandRate=*/12,
89 /*currentPreemptiveRate=*/345,
90 /*currentAccelerateRate =*/678,
91 /*currentSecondaryDecodedRate=*/901,
92 /*currentSecondaryDiscardedRate=*/0,
93 /*meanWaitingTimeMs=*/-1,
94 /*maxWaitingTimeMs=*/-1,
95 /*packetBufferFlushes=*/0,
96 /*delayedPacketOutageSamples=*/0,
97 /*relativePacketArrivalDelayMs=*/135,
98 /*interruptionCount=*/-1,
99 /*totalInterruptionDurationMs=*/-1};
100 const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest();
101
102 struct ConfigHelper {
ConfigHelperwebrtc::test::__anon78d7157f0111::ConfigHelper103 explicit ConfigHelper(bool use_null_audio_processing)
104 : ConfigHelper(rtc::make_ref_counted<MockAudioMixer>(),
105 use_null_audio_processing) {}
106
ConfigHelperwebrtc::test::__anon78d7157f0111::ConfigHelper107 ConfigHelper(rtc::scoped_refptr<MockAudioMixer> audio_mixer,
108 bool use_null_audio_processing)
109 : audio_mixer_(audio_mixer) {
110 using ::testing::Invoke;
111
112 AudioState::Config config;
113 config.audio_mixer = audio_mixer_;
114 config.audio_processing =
115 use_null_audio_processing
116 ? nullptr
117 : rtc::make_ref_counted<NiceMock<MockAudioProcessing>>();
118 config.audio_device_module =
119 rtc::make_ref_counted<testing::NiceMock<MockAudioDeviceModule>>();
120 audio_state_ = AudioState::Create(config);
121
122 channel_receive_ = new ::testing::StrictMock<MockChannelReceive>();
123 EXPECT_CALL(*channel_receive_, SetNACKStatus(true, 15)).Times(1);
124 EXPECT_CALL(*channel_receive_,
125 RegisterReceiverCongestionControlObjects(&packet_router_))
126 .Times(1);
127 EXPECT_CALL(*channel_receive_, ResetReceiverCongestionControlObjects())
128 .Times(1);
129 EXPECT_CALL(*channel_receive_, SetAssociatedSendChannel(nullptr)).Times(1);
130 EXPECT_CALL(*channel_receive_, SetReceiveCodecs(_))
131 .WillRepeatedly(Invoke([](const std::map<int, SdpAudioFormat>& codecs) {
132 EXPECT_THAT(codecs, ::testing::IsEmpty());
133 }));
134 EXPECT_CALL(*channel_receive_, SetSourceTracker(_));
135 EXPECT_CALL(*channel_receive_, GetLocalSsrc())
136 .WillRepeatedly(Return(kLocalSsrc));
137
138 stream_config_.rtp.local_ssrc = kLocalSsrc;
139 stream_config_.rtp.remote_ssrc = kRemoteSsrc;
140 stream_config_.rtp.nack.rtp_history_ms = 300;
141 stream_config_.rtp.extensions.push_back(
142 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
143 stream_config_.rtp.extensions.push_back(RtpExtension(
144 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
145 stream_config_.rtcp_send_transport = &rtcp_send_transport_;
146 stream_config_.decoder_factory =
147 rtc::make_ref_counted<MockAudioDecoderFactory>();
148 }
149
CreateAudioReceiveStreamwebrtc::test::__anon78d7157f0111::ConfigHelper150 std::unique_ptr<AudioReceiveStreamImpl> CreateAudioReceiveStream() {
151 auto ret = std::make_unique<AudioReceiveStreamImpl>(
152 Clock::GetRealTimeClock(), &packet_router_, stream_config_,
153 audio_state_, &event_log_,
154 std::unique_ptr<voe::ChannelReceiveInterface>(channel_receive_));
155 ret->RegisterWithTransport(&rtp_stream_receiver_controller_);
156 return ret;
157 }
158
configwebrtc::test::__anon78d7157f0111::ConfigHelper159 AudioReceiveStreamInterface::Config& config() { return stream_config_; }
audio_mixerwebrtc::test::__anon78d7157f0111::ConfigHelper160 rtc::scoped_refptr<MockAudioMixer> audio_mixer() { return audio_mixer_; }
channel_receivewebrtc::test::__anon78d7157f0111::ConfigHelper161 MockChannelReceive* channel_receive() { return channel_receive_; }
162
SetupMockForGetStatswebrtc::test::__anon78d7157f0111::ConfigHelper163 void SetupMockForGetStats() {
164 using ::testing::DoAll;
165 using ::testing::SetArgPointee;
166
167 ASSERT_TRUE(channel_receive_);
168 EXPECT_CALL(*channel_receive_, GetRTCPStatistics())
169 .WillOnce(Return(kCallStats));
170 EXPECT_CALL(*channel_receive_, GetDelayEstimate())
171 .WillOnce(Return(kJitterBufferDelay + kPlayoutBufferDelay));
172 EXPECT_CALL(*channel_receive_, GetSpeechOutputLevelFullRange())
173 .WillOnce(Return(kSpeechOutputLevel));
174 EXPECT_CALL(*channel_receive_, GetTotalOutputEnergy())
175 .WillOnce(Return(kTotalOutputEnergy));
176 EXPECT_CALL(*channel_receive_, GetTotalOutputDuration())
177 .WillOnce(Return(kTotalOutputDuration));
178 EXPECT_CALL(*channel_receive_, GetNetworkStatistics(_))
179 .WillOnce(Return(kNetworkStats));
180 EXPECT_CALL(*channel_receive_, GetDecodingCallStatistics())
181 .WillOnce(Return(kAudioDecodeStats));
182 EXPECT_CALL(*channel_receive_, GetReceiveCodec())
183 .WillOnce(Return(kReceiveCodec));
184 EXPECT_CALL(*channel_receive_, GetCurrentEstimatedPlayoutNtpTimestampMs(_))
185 .WillOnce(Return(kPlayoutNtpTimestampMs));
186 }
187
188 private:
189 PacketRouter packet_router_;
190 MockRtcEventLog event_log_;
191 rtc::scoped_refptr<AudioState> audio_state_;
192 rtc::scoped_refptr<MockAudioMixer> audio_mixer_;
193 AudioReceiveStreamInterface::Config stream_config_;
194 ::testing::StrictMock<MockChannelReceive>* channel_receive_ = nullptr;
195 RtpStreamReceiverController rtp_stream_receiver_controller_;
196 MockTransport rtcp_send_transport_;
197 };
198
CreateRtcpSenderReport()199 const std::vector<uint8_t> CreateRtcpSenderReport() {
200 std::vector<uint8_t> packet;
201 const size_t kRtcpSrLength = 28; // In bytes.
202 packet.resize(kRtcpSrLength);
203 packet[0] = 0x80; // Version 2.
204 packet[1] = 0xc8; // PT = 200, SR.
205 // Length in number of 32-bit words - 1.
206 ByteWriter<uint16_t>::WriteBigEndian(&packet[2], 6);
207 ByteWriter<uint32_t>::WriteBigEndian(&packet[4], kLocalSsrc);
208 return packet;
209 }
210 } // namespace
211
TEST(AudioReceiveStreamTest,ConfigToString)212 TEST(AudioReceiveStreamTest, ConfigToString) {
213 AudioReceiveStreamInterface::Config config;
214 config.rtp.remote_ssrc = kRemoteSsrc;
215 config.rtp.local_ssrc = kLocalSsrc;
216 config.rtp.extensions.push_back(
217 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
218 EXPECT_EQ(
219 "{rtp: {remote_ssrc: 1234, local_ssrc: 5678, transport_cc: off, nack: "
220 "{rtp_history_ms: 0}, extensions: [{uri: "
221 "urn:ietf:params:rtp-hdrext:ssrc-audio-level, id: 3}]}, "
222 "rtcp_send_transport: null}",
223 config.ToString());
224 }
225
TEST(AudioReceiveStreamTest,ConstructDestruct)226 TEST(AudioReceiveStreamTest, ConstructDestruct) {
227 for (bool use_null_audio_processing : {false, true}) {
228 ConfigHelper helper(use_null_audio_processing);
229 auto recv_stream = helper.CreateAudioReceiveStream();
230 recv_stream->UnregisterFromTransport();
231 }
232 }
233
TEST(AudioReceiveStreamTest,ReceiveRtcpPacket)234 TEST(AudioReceiveStreamTest, ReceiveRtcpPacket) {
235 for (bool use_null_audio_processing : {false, true}) {
236 ConfigHelper helper(use_null_audio_processing);
237 helper.config().rtp.transport_cc = true;
238 auto recv_stream = helper.CreateAudioReceiveStream();
239 std::vector<uint8_t> rtcp_packet = CreateRtcpSenderReport();
240 EXPECT_CALL(*helper.channel_receive(),
241 ReceivedRTCPPacket(&rtcp_packet[0], rtcp_packet.size()))
242 .WillOnce(Return());
243 recv_stream->DeliverRtcp(&rtcp_packet[0], rtcp_packet.size());
244 recv_stream->UnregisterFromTransport();
245 }
246 }
247
TEST(AudioReceiveStreamTest,GetStats)248 TEST(AudioReceiveStreamTest, GetStats) {
249 for (bool use_null_audio_processing : {false, true}) {
250 ConfigHelper helper(use_null_audio_processing);
251 auto recv_stream = helper.CreateAudioReceiveStream();
252 helper.SetupMockForGetStats();
253 AudioReceiveStreamInterface::Stats stats =
254 recv_stream->GetStats(/*get_and_clear_legacy_stats=*/true);
255 EXPECT_EQ(kRemoteSsrc, stats.remote_ssrc);
256 EXPECT_EQ(kCallStats.payload_bytes_rcvd, stats.payload_bytes_rcvd);
257 EXPECT_EQ(kCallStats.header_and_padding_bytes_rcvd,
258 stats.header_and_padding_bytes_rcvd);
259 EXPECT_EQ(static_cast<uint32_t>(kCallStats.packetsReceived),
260 stats.packets_rcvd);
261 EXPECT_EQ(kCallStats.cumulativeLost, stats.packets_lost);
262 EXPECT_EQ(kReceiveCodec.second.name, stats.codec_name);
263 EXPECT_EQ(
264 kCallStats.jitterSamples / (kReceiveCodec.second.clockrate_hz / 1000),
265 stats.jitter_ms);
266 EXPECT_EQ(kNetworkStats.currentBufferSize, stats.jitter_buffer_ms);
267 EXPECT_EQ(kNetworkStats.preferredBufferSize,
268 stats.jitter_buffer_preferred_ms);
269 EXPECT_EQ(static_cast<uint32_t>(kJitterBufferDelay + kPlayoutBufferDelay),
270 stats.delay_estimate_ms);
271 EXPECT_EQ(static_cast<int32_t>(kSpeechOutputLevel), stats.audio_level);
272 EXPECT_EQ(kTotalOutputEnergy, stats.total_output_energy);
273 EXPECT_EQ(kNetworkStats.totalSamplesReceived, stats.total_samples_received);
274 EXPECT_EQ(kTotalOutputDuration, stats.total_output_duration);
275 EXPECT_EQ(kNetworkStats.concealedSamples, stats.concealed_samples);
276 EXPECT_EQ(kNetworkStats.concealmentEvents, stats.concealment_events);
277 EXPECT_EQ(static_cast<double>(kNetworkStats.jitterBufferDelayMs) /
278 static_cast<double>(rtc::kNumMillisecsPerSec),
279 stats.jitter_buffer_delay_seconds);
280 EXPECT_EQ(kNetworkStats.jitterBufferEmittedCount,
281 stats.jitter_buffer_emitted_count);
282 EXPECT_EQ(static_cast<double>(kNetworkStats.jitterBufferTargetDelayMs) /
283 static_cast<double>(rtc::kNumMillisecsPerSec),
284 stats.jitter_buffer_target_delay_seconds);
285 EXPECT_EQ(static_cast<double>(kNetworkStats.jitterBufferMinimumDelayMs) /
286 static_cast<double>(rtc::kNumMillisecsPerSec),
287 stats.jitter_buffer_minimum_delay_seconds);
288 EXPECT_EQ(kNetworkStats.insertedSamplesForDeceleration,
289 stats.inserted_samples_for_deceleration);
290 EXPECT_EQ(kNetworkStats.removedSamplesForAcceleration,
291 stats.removed_samples_for_acceleration);
292 EXPECT_EQ(kNetworkStats.fecPacketsReceived, stats.fec_packets_received);
293 EXPECT_EQ(kNetworkStats.fecPacketsDiscarded, stats.fec_packets_discarded);
294 EXPECT_EQ(kNetworkStats.packetsDiscarded, stats.packets_discarded);
295 EXPECT_EQ(Q14ToFloat(kNetworkStats.currentExpandRate), stats.expand_rate);
296 EXPECT_EQ(Q14ToFloat(kNetworkStats.currentSpeechExpandRate),
297 stats.speech_expand_rate);
298 EXPECT_EQ(Q14ToFloat(kNetworkStats.currentSecondaryDecodedRate),
299 stats.secondary_decoded_rate);
300 EXPECT_EQ(Q14ToFloat(kNetworkStats.currentSecondaryDiscardedRate),
301 stats.secondary_discarded_rate);
302 EXPECT_EQ(Q14ToFloat(kNetworkStats.currentAccelerateRate),
303 stats.accelerate_rate);
304 EXPECT_EQ(Q14ToFloat(kNetworkStats.currentPreemptiveRate),
305 stats.preemptive_expand_rate);
306 EXPECT_EQ(kNetworkStats.packetBufferFlushes, stats.jitter_buffer_flushes);
307 EXPECT_EQ(kNetworkStats.delayedPacketOutageSamples,
308 stats.delayed_packet_outage_samples);
309 EXPECT_EQ(static_cast<double>(kNetworkStats.relativePacketArrivalDelayMs) /
310 static_cast<double>(rtc::kNumMillisecsPerSec),
311 stats.relative_packet_arrival_delay_seconds);
312 EXPECT_EQ(kNetworkStats.interruptionCount, stats.interruption_count);
313 EXPECT_EQ(kNetworkStats.totalInterruptionDurationMs,
314 stats.total_interruption_duration_ms);
315
316 EXPECT_EQ(kAudioDecodeStats.calls_to_silence_generator,
317 stats.decoding_calls_to_silence_generator);
318 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq);
319 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal);
320 EXPECT_EQ(kAudioDecodeStats.decoded_neteq_plc, stats.decoding_plc);
321 EXPECT_EQ(kAudioDecodeStats.decoded_codec_plc, stats.decoding_codec_plc);
322 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng);
323 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng);
324 EXPECT_EQ(kAudioDecodeStats.decoded_muted_output,
325 stats.decoding_muted_output);
326 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_,
327 stats.capture_start_ntp_time_ms);
328 EXPECT_EQ(kPlayoutNtpTimestampMs, stats.estimated_playout_ntp_timestamp_ms);
329 recv_stream->UnregisterFromTransport();
330 }
331 }
332
TEST(AudioReceiveStreamTest,SetGain)333 TEST(AudioReceiveStreamTest, SetGain) {
334 for (bool use_null_audio_processing : {false, true}) {
335 ConfigHelper helper(use_null_audio_processing);
336 auto recv_stream = helper.CreateAudioReceiveStream();
337 EXPECT_CALL(*helper.channel_receive(),
338 SetChannelOutputVolumeScaling(FloatEq(0.765f)));
339 recv_stream->SetGain(0.765f);
340 recv_stream->UnregisterFromTransport();
341 }
342 }
343
TEST(AudioReceiveStreamTest,StreamsShouldBeAddedToMixerOnceOnStart)344 TEST(AudioReceiveStreamTest, StreamsShouldBeAddedToMixerOnceOnStart) {
345 for (bool use_null_audio_processing : {false, true}) {
346 ConfigHelper helper1(use_null_audio_processing);
347 ConfigHelper helper2(helper1.audio_mixer(), use_null_audio_processing);
348 auto recv_stream1 = helper1.CreateAudioReceiveStream();
349 auto recv_stream2 = helper2.CreateAudioReceiveStream();
350
351 EXPECT_CALL(*helper1.channel_receive(), StartPlayout()).Times(1);
352 EXPECT_CALL(*helper2.channel_receive(), StartPlayout()).Times(1);
353 EXPECT_CALL(*helper1.channel_receive(), StopPlayout()).Times(1);
354 EXPECT_CALL(*helper2.channel_receive(), StopPlayout()).Times(1);
355 EXPECT_CALL(*helper1.audio_mixer(), AddSource(recv_stream1.get()))
356 .WillOnce(Return(true));
357 EXPECT_CALL(*helper1.audio_mixer(), AddSource(recv_stream2.get()))
358 .WillOnce(Return(true));
359 EXPECT_CALL(*helper1.audio_mixer(), RemoveSource(recv_stream1.get()))
360 .Times(1);
361 EXPECT_CALL(*helper1.audio_mixer(), RemoveSource(recv_stream2.get()))
362 .Times(1);
363
364 recv_stream1->Start();
365 recv_stream2->Start();
366
367 // One more should not result in any more mixer sources added.
368 recv_stream1->Start();
369
370 // Stop stream before it is being destructed.
371 recv_stream2->Stop();
372
373 recv_stream1->UnregisterFromTransport();
374 recv_stream2->UnregisterFromTransport();
375 }
376 }
377
TEST(AudioReceiveStreamTest,ReconfigureWithUpdatedConfig)378 TEST(AudioReceiveStreamTest, ReconfigureWithUpdatedConfig) {
379 for (bool use_null_audio_processing : {false, true}) {
380 ConfigHelper helper(use_null_audio_processing);
381 auto recv_stream = helper.CreateAudioReceiveStream();
382
383 auto new_config = helper.config();
384
385 new_config.rtp.extensions.clear();
386 new_config.rtp.extensions.push_back(
387 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId + 1));
388 new_config.rtp.extensions.push_back(
389 RtpExtension(RtpExtension::kTransportSequenceNumberUri,
390 kTransportSequenceNumberId + 1));
391
392 MockChannelReceive& channel_receive = *helper.channel_receive();
393
394 // TODO(tommi, nisse): This applies new extensions to the internal config,
395 // but there's nothing that actually verifies that the changes take effect.
396 // In fact Call manages the extensions separately in Call::ReceiveRtpConfig
397 // and changing this config value (there seem to be a few copies), doesn't
398 // affect that logic.
399 recv_stream->ReconfigureForTesting(new_config);
400
401 new_config.decoder_map.emplace(1, SdpAudioFormat("foo", 8000, 1));
402 EXPECT_CALL(channel_receive, SetReceiveCodecs(new_config.decoder_map));
403 recv_stream->SetDecoderMap(new_config.decoder_map);
404
405 EXPECT_CALL(channel_receive, SetNACKStatus(true, 15 + 1)).Times(1);
406 recv_stream->SetTransportCc(new_config.rtp.transport_cc);
407 recv_stream->SetNackHistory(300 + 20);
408
409 recv_stream->UnregisterFromTransport();
410 }
411 }
412
TEST(AudioReceiveStreamTest,ReconfigureWithFrameDecryptor)413 TEST(AudioReceiveStreamTest, ReconfigureWithFrameDecryptor) {
414 for (bool use_null_audio_processing : {false, true}) {
415 ConfigHelper helper(use_null_audio_processing);
416 auto recv_stream = helper.CreateAudioReceiveStream();
417
418 auto new_config_0 = helper.config();
419 rtc::scoped_refptr<FrameDecryptorInterface> mock_frame_decryptor_0(
420 rtc::make_ref_counted<MockFrameDecryptor>());
421 new_config_0.frame_decryptor = mock_frame_decryptor_0;
422
423 // TODO(tommi): While this changes the internal config value, it doesn't
424 // actually change what frame_decryptor is used. WebRtcAudioReceiveStream
425 // recreates the whole instance in order to change this value.
426 // So, it's not clear if changing this post initialization needs to be
427 // supported.
428 recv_stream->ReconfigureForTesting(new_config_0);
429
430 auto new_config_1 = helper.config();
431 rtc::scoped_refptr<FrameDecryptorInterface> mock_frame_decryptor_1(
432 rtc::make_ref_counted<MockFrameDecryptor>());
433 new_config_1.frame_decryptor = mock_frame_decryptor_1;
434 new_config_1.crypto_options.sframe.require_frame_encryption = true;
435 recv_stream->ReconfigureForTesting(new_config_1);
436 recv_stream->UnregisterFromTransport();
437 }
438 }
439
440 } // namespace test
441 } // namespace webrtc
442