Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: webrtc/call/rtc_event_log_unittest.cc

Issue 1623543002: Refactor RtpSender and SSRCDatabase a bit. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add locking back for voe_auto_test Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 * presence of extension number i from kExtensionTypes / kExtensionNames. 297 * presence of extension number i from kExtensionTypes / kExtensionNames.
298 * The least significant bit extension_bitvector has number 0. 298 * The least significant bit extension_bitvector has number 0.
299 */ 299 */
300 size_t GenerateRtpPacket(uint32_t extensions_bitvector, 300 size_t GenerateRtpPacket(uint32_t extensions_bitvector,
301 uint32_t csrcs_count, 301 uint32_t csrcs_count,
302 uint8_t* packet, 302 uint8_t* packet,
303 size_t packet_size, 303 size_t packet_size,
304 Random* prng) { 304 Random* prng) {
305 RTC_CHECK_GE(packet_size, 16 + 4 * csrcs_count + 4 * kNumExtensions); 305 RTC_CHECK_GE(packet_size, 16 + 4 * csrcs_count + 4 * kNumExtensions);
306 Clock* clock = Clock::GetRealTimeClock(); 306 Clock* clock = Clock::GetRealTimeClock();
307 307 SSRCDatabase ssrc_database;
308 RTPSender rtp_sender(false, // bool audio 308 RTPSender rtp_sender(false, // bool audio
309 clock, // Clock* clock 309 clock, // Clock* clock
310 nullptr, // Transport* 310 nullptr, // Transport*
311 nullptr, // RtpAudioFeedback* 311 nullptr, // RtpAudioFeedback*
312 nullptr, // PacedSender* 312 nullptr, // PacedSender*
313 nullptr, // PacketRouter* 313 nullptr, // PacketRouter*
314 nullptr, // SendTimeObserver* 314 nullptr, // SendTimeObserver*
315 nullptr, // BitrateStatisticsObserver* 315 nullptr, // BitrateStatisticsObserver*
316 nullptr, // FrameCountObserver* 316 nullptr, // FrameCountObserver*
317 nullptr, // SendSideDelayObserver* 317 nullptr, // SendSideDelayObserver*
318 nullptr); // RtcEventLog* 318 nullptr, // RtcEventLog*
319 &ssrc_database);
319 320
320 std::vector<uint32_t> csrcs; 321 std::vector<uint32_t> csrcs;
321 for (unsigned i = 0; i < csrcs_count; i++) { 322 for (unsigned i = 0; i < csrcs_count; i++) {
322 csrcs.push_back(prng->Rand<uint32_t>()); 323 csrcs.push_back(prng->Rand<uint32_t>());
323 } 324 }
324 rtp_sender.SetCsrcs(csrcs); 325 rtp_sender.SetCsrcs(csrcs);
325 rtp_sender.SetSSRC(prng->Rand<uint32_t>()); 326 rtp_sender.SetSSRC(prng->Rand<uint32_t>());
326 rtp_sender.SetStartTimestamp(prng->Rand<uint32_t>(), true); 327 rtp_sender.SetStartTimestamp(prng->Rand<uint32_t>(), true);
327 rtp_sender.SetSequenceNumber(prng->Rand<uint16_t>()); 328 rtp_sender.SetSequenceNumber(prng->Rand<uint16_t>());
328 329
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 // Enable all header extensions 686 // Enable all header extensions
686 uint32_t extensions = (1u << kNumExtensions) - 1; 687 uint32_t extensions = (1u << kNumExtensions) - 1;
687 uint32_t csrcs_count = 2; 688 uint32_t csrcs_count = 2;
688 DropOldEvents(extensions, csrcs_count, 141421356); 689 DropOldEvents(extensions, csrcs_count, 141421356);
689 DropOldEvents(extensions, csrcs_count, 173205080); 690 DropOldEvents(extensions, csrcs_count, 173205080);
690 } 691 }
691 692
692 } // namespace webrtc 693 } // namespace webrtc
693 694
694 #endif // ENABLE_RTC_EVENT_LOG 695 #endif // ENABLE_RTC_EVENT_LOG
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h » ('j') | webrtc/modules/rtp_rtcp/source/rtp_sender.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698