| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Add header extensions. | 184 // Add header extensions. |
| 185 for (unsigned i = 0; i < kNumExtensions; i++) { | 185 for (unsigned i = 0; i < kNumExtensions; i++) { |
| 186 if (extensions_bitvector & (1u << i)) { | 186 if (extensions_bitvector & (1u << i)) { |
| 187 config->rtp_extensions.push_back( | 187 config->rtp_extensions.push_back( |
| 188 RtpExtension(kExtensionNames[i], prng->Rand<int>())); | 188 RtpExtension(kExtensionNames[i], prng->Rand<int>())); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 void GenerateAudioReceiveConfig(uint32_t extensions_bitvector, | 193 void GenerateAudioReceiveConfig(uint32_t extensions_bitvector, |
| 194 AudioReceiveStream::Config* config, | 194 rtclog::StreamConfig* config, |
| 195 Random* prng) { | 195 Random* prng) { |
| 196 // Add SSRCs for the stream. | 196 // Add SSRCs for the stream. |
| 197 config->rtp.remote_ssrc = prng->Rand<uint32_t>(); | 197 config->remote_ssrc = prng->Rand<uint32_t>(); |
| 198 config->rtp.local_ssrc = prng->Rand<uint32_t>(); | 198 config->local_ssrc = prng->Rand<uint32_t>(); |
| 199 // Add header extensions. | 199 // Add header extensions. |
| 200 for (unsigned i = 0; i < kNumExtensions; i++) { | 200 for (unsigned i = 0; i < kNumExtensions; i++) { |
| 201 if (extensions_bitvector & (1u << i)) { | 201 if (extensions_bitvector & (1u << i)) { |
| 202 config->rtp.extensions.push_back( | 202 config->rtp_extensions.push_back( |
| 203 RtpExtension(kExtensionNames[i], prng->Rand<int>())); | 203 RtpExtension(kExtensionNames[i], prng->Rand<int>())); |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 void GenerateAudioSendConfig(uint32_t extensions_bitvector, | 208 void GenerateAudioSendConfig(uint32_t extensions_bitvector, |
| 209 AudioSendStream::Config* config, | 209 AudioSendStream::Config* config, |
| 210 Random* prng) { | 210 Random* prng) { |
| 211 // Add SSRC to the stream. | 211 // Add SSRC to the stream. |
| 212 config->rtp.ssrc = prng->Rand<uint32_t>(); | 212 config->rtp.ssrc = prng->Rand<uint32_t>(); |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 GenerateAudioReceiveConfig(extensions_bitvector, &config, &prng); | 776 GenerateAudioReceiveConfig(extensions_bitvector, &config, &prng); |
| 777 } | 777 } |
| 778 void LogConfig(RtcEventLog* event_log) override { | 778 void LogConfig(RtcEventLog* event_log) override { |
| 779 event_log->LogAudioReceiveStreamConfig(config); | 779 event_log->LogAudioReceiveStreamConfig(config); |
| 780 } | 780 } |
| 781 void VerifyConfig(const ParsedRtcEventLog& parsed_log, | 781 void VerifyConfig(const ParsedRtcEventLog& parsed_log, |
| 782 size_t index) override { | 782 size_t index) override { |
| 783 RtcEventLogTestHelper::VerifyAudioReceiveStreamConfig(parsed_log, index, | 783 RtcEventLogTestHelper::VerifyAudioReceiveStreamConfig(parsed_log, index, |
| 784 config); | 784 config); |
| 785 } | 785 } |
| 786 AudioReceiveStream::Config config; | 786 rtclog::StreamConfig config; |
| 787 }; | 787 }; |
| 788 | 788 |
| 789 class AudioSendConfigReadWriteTest : public ConfigReadWriteTest { | 789 class AudioSendConfigReadWriteTest : public ConfigReadWriteTest { |
| 790 public: | 790 public: |
| 791 AudioSendConfigReadWriteTest() : config(nullptr) {} | 791 AudioSendConfigReadWriteTest() : config(nullptr) {} |
| 792 void GenerateConfig(uint32_t extensions_bitvector) override { | 792 void GenerateConfig(uint32_t extensions_bitvector) override { |
| 793 GenerateAudioSendConfig(extensions_bitvector, &config, &prng); | 793 GenerateAudioSendConfig(extensions_bitvector, &config, &prng); |
| 794 } | 794 } |
| 795 void LogConfig(RtcEventLog* event_log) override { | 795 void LogConfig(RtcEventLog* event_log) override { |
| 796 event_log->LogAudioSendStreamConfig(config); | 796 event_log->LogAudioSendStreamConfig(config); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 VideoSendConfigReadWriteTest test; | 872 VideoSendConfigReadWriteTest test; |
| 873 test.DoTest(); | 873 test.DoTest(); |
| 874 } | 874 } |
| 875 | 875 |
| 876 TEST(RtcEventLogTest, LogAudioNetworkAdaptation) { | 876 TEST(RtcEventLogTest, LogAudioNetworkAdaptation) { |
| 877 AudioNetworkAdaptationReadWriteTest test; | 877 AudioNetworkAdaptationReadWriteTest test; |
| 878 test.DoTest(); | 878 test.DoTest(); |
| 879 } | 879 } |
| 880 | 880 |
| 881 } // namespace webrtc | 881 } // namespace webrtc |
| OLD | NEW |