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

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

Issue 2774623006: Let PacketRouter separate send and receive modules. (Closed)
Patch Set: Delete #if:ed out code. Created 3 years, 8 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::PacketSender, 33 class PacketRouter : public PacedSender::PacketSender,
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 // TODO(nisse): Delete, as soon as downstream app is updated.
40 void RemoveRtpModule(RtpRtcp* rtp_module); 40 RTC_DEPRECATED void AddRtpModule(RtpRtcp* rtp_module) {
41 AddReceiveRtpModule(rtp_module);
42 }
43 RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) {
44 RemoveReceiveRtpModule(rtp_module);
45 }
46 void AddSendRtpModule(RtpRtcp* rtp_module);
47 void RemoveSendRtpModule(RtpRtcp* rtp_module);
48
49 void AddReceiveRtpModule(RtpRtcp* rtp_module);
50 void RemoveReceiveRtpModule(RtpRtcp* rtp_module);
41 51
42 // Implements PacedSender::Callback. 52 // Implements PacedSender::Callback.
43 bool TimeToSendPacket(uint32_t ssrc, 53 bool TimeToSendPacket(uint32_t ssrc,
44 uint16_t sequence_number, 54 uint16_t sequence_number,
45 int64_t capture_timestamp, 55 int64_t capture_timestamp,
46 bool retransmission, 56 bool retransmission,
47 const PacedPacketInfo& packet_info) override; 57 const PacedPacketInfo& packet_info) override;
48 58
49 size_t TimeToSendPadding(size_t bytes, 59 size_t TimeToSendPadding(size_t bytes,
50 const PacedPacketInfo& packet_info) override; 60 const PacedPacketInfo& packet_info) override;
51 61
52 void SetTransportWideSequenceNumber(uint16_t sequence_number); 62 void SetTransportWideSequenceNumber(uint16_t sequence_number);
53 uint16_t AllocateSequenceNumber() override; 63 uint16_t AllocateSequenceNumber() override;
54 64
55 // Send transport feedback packet to send-side. 65 // Send transport feedback packet to send-side.
56 virtual bool SendFeedback(rtcp::TransportFeedback* packet); 66 virtual bool SendFeedback(rtcp::TransportFeedback* packet);
57 67
58 private: 68 private:
59 rtc::ThreadChecker pacer_thread_checker_; 69 rtc::ThreadChecker pacer_thread_checker_;
60 rtc::CriticalSection modules_crit_; 70 rtc::CriticalSection modules_crit_;
61 std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(modules_crit_); 71 std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_);
72 std::list<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_);
the sun 2017/03/28 12:21:52 Any particular reason to use std::list? More cache
nisse-webrtc 2017/03/29 13:58:37 For the list of send modules, the code uses both p
62 73
63 volatile int transport_seq_; 74 volatile int transport_seq_;
64 75
65 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter); 76 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter);
66 }; 77 };
67 } // namespace webrtc 78 } // namespace webrtc
68 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_ 79 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698