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

Side by Side Diff: webrtc/modules/pacing/packet_router.h

Issue 1628683002: Use separate rtp module lists for send and receive in PacketRouter. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add more dchecks. Created 4 years, 10 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 18 matching lines...) Expand all
29 } // namespace rtcp 29 } // namespace rtcp
30 30
31 // PacketRouter routes outgoing data to the correct sending RTP module, based 31 // PacketRouter routes outgoing data to the correct sending RTP module, based
32 // on the simulcast layer in RTPVideoHeader. 32 // on the simulcast layer in RTPVideoHeader.
33 class PacketRouter : public PacedSender::Callback, 33 class PacketRouter : public PacedSender::Callback,
34 public TransportSequenceNumberAllocator { 34 public TransportSequenceNumberAllocator {
35 public: 35 public:
36 PacketRouter(); 36 PacketRouter();
37 virtual ~PacketRouter(); 37 virtual ~PacketRouter();
38 38
39 void AddRtpModule(RtpRtcp* rtp_module); 39 void AddRtpModule(RtpRtcp* rtp_module, bool sender);
40 void RemoveRtpModule(RtpRtcp* rtp_module); 40 void RemoveRtpModule(RtpRtcp* rtp_module, bool sender);
41 41
42 // Implements PacedSender::Callback. 42 // Implements PacedSender::Callback.
43 bool TimeToSendPacket(uint32_t ssrc, 43 bool TimeToSendPacket(uint32_t ssrc,
44 uint16_t sequence_number, 44 uint16_t sequence_number,
45 int64_t capture_timestamp, 45 int64_t capture_timestamp,
46 bool retransmission) override; 46 bool retransmission) override;
47 47
48 size_t TimeToSendPadding(size_t bytes) override; 48 size_t TimeToSendPadding(size_t bytes) override;
49 49
50 void SetTransportWideSequenceNumber(uint16_t sequence_number); 50 void SetTransportWideSequenceNumber(uint16_t sequence_number);
51 uint16_t AllocateSequenceNumber() override; 51 uint16_t AllocateSequenceNumber() override;
52 52
53 // Send transport feedback packet to send-side. 53 // Send transport feedback packet to send-side.
54 virtual bool SendFeedback(rtcp::TransportFeedback* packet); 54 virtual bool SendFeedback(rtcp::TransportFeedback* packet);
55 55
56 private: 56 private:
57 rtc::CriticalSection modules_lock_; 57 rtc::CriticalSection send_modules_crit_;
58 // Map from ssrc to sending rtp module. 58 rtc::CriticalSection recv_modules_crit_;
59 std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(modules_lock_); 59 std::list<RtpRtcp*> send_rtp_modules_ GUARDED_BY(send_modules_crit_);
60 std::list<RtpRtcp*> recv_rtp_modules_ GUARDED_BY(recv_modules_crit_);
60 61
61 volatile int transport_seq_; 62 volatile int transport_seq_;
62 63
63 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter); 64 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter);
64 }; 65 };
65 } // namespace webrtc 66 } // namespace webrtc
66 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_ 67 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698