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

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

Issue 2973363002: Explicitly inform PacketRouter which RTP-RTCP modules are REMB-candidates (Closed)
Patch Set: . Created 3 years, 4 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 PacketRouter(); 42 PacketRouter();
43 ~PacketRouter() override; 43 ~PacketRouter() override;
44 44
45 // TODO(nisse): Delete, as soon as downstream app is updated. 45 // TODO(nisse): Delete, as soon as downstream app is updated.
46 RTC_DEPRECATED void AddRtpModule(RtpRtcp* rtp_module) { 46 RTC_DEPRECATED void AddRtpModule(RtpRtcp* rtp_module) {
47 AddReceiveRtpModule(rtp_module); 47 AddReceiveRtpModule(rtp_module);
48 } 48 }
49 RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) { 49 RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) {
50 RemoveReceiveRtpModule(rtp_module); 50 RemoveReceiveRtpModule(rtp_module);
51 } 51 }
52 void AddSendRtpModule(RtpRtcp* rtp_module); 52
53 void AddSendRtpModule(RtpRtcp* rtp_module, bool remb_candidate);
53 void RemoveSendRtpModule(RtpRtcp* rtp_module); 54 void RemoveSendRtpModule(RtpRtcp* rtp_module);
55 RTC_DEPRECATED void AddSendRtpModule(RtpRtcp* rtp_module) {
56 constexpr bool remb_candidate = true; // Default to old behavior.
danilchap 2017/07/28 11:35:04 May be remove this line: with called function just
eladalon 2017/07/28 15:47:11 Done.
57 AddSendRtpModule(rtp_module, remb_candidate);
58 }
54 59
55 void AddReceiveRtpModule(RtpRtcp* rtp_module); 60 void AddReceiveRtpModule(RtpRtcp* rtp_module, bool remb_candidate);
56 void RemoveReceiveRtpModule(RtpRtcp* rtp_module); 61 void RemoveReceiveRtpModule(RtpRtcp* rtp_module);
62 RTC_DEPRECATED void AddReceiveRtpModule(RtpRtcp* rtp_module) {
63 constexpr bool remb_candidate = true; // Default to old behavior.
64 AddReceiveRtpModule(rtp_module, remb_candidate);
65 }
57 66
58 // Implements PacedSender::Callback. 67 // Implements PacedSender::Callback.
59 bool TimeToSendPacket(uint32_t ssrc, 68 bool TimeToSendPacket(uint32_t ssrc,
60 uint16_t sequence_number, 69 uint16_t sequence_number,
61 int64_t capture_timestamp, 70 int64_t capture_timestamp,
62 bool retransmission, 71 bool retransmission,
63 const PacedPacketInfo& packet_info) override; 72 const PacedPacketInfo& packet_info) override;
64 73
65 size_t TimeToSendPadding(size_t bytes, 74 size_t TimeToSendPadding(size_t bytes,
66 const PacedPacketInfo& packet_info) override; 75 const PacedPacketInfo& packet_info) override;
(...skipping 10 matching lines...) Expand all
77 uint32_t bitrate_bps) override; 86 uint32_t bitrate_bps) override;
78 87
79 // Send REMB feedback. 88 // Send REMB feedback.
80 virtual bool SendRemb(uint32_t bitrate_bps, 89 virtual bool SendRemb(uint32_t bitrate_bps,
81 const std::vector<uint32_t>& ssrcs); 90 const std::vector<uint32_t>& ssrcs);
82 91
83 // Send transport feedback packet to send-side. 92 // Send transport feedback packet to send-side.
84 virtual bool SendTransportFeedback(rtcp::TransportFeedback* packet); 93 virtual bool SendTransportFeedback(rtcp::TransportFeedback* packet);
85 94
86 private: 95 private:
96 void AddRembModuleCandidate(RtpRtcp* candidate_module, bool sender)
97 EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
98 void MaybeRemoveRembModuleCandidate(RtpRtcp* candidate_module, bool sender)
99 EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
100 void DetermineActiveRembModule() EXCLUSIVE_LOCKS_REQUIRED(modules_crit_);
101
87 rtc::RaceChecker pacer_race_; 102 rtc::RaceChecker pacer_race_;
88 rtc::CriticalSection modules_crit_; 103 rtc::CriticalSection modules_crit_;
89 std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_); 104 std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_);
90 std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_); 105 std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_);
91 106
107 // TODO(eladalon): remb_crit_ only ever held from one function, and it's not
danilchap 2017/07/28 11:35:04 you addressing it in another CL already, so probab
eladalon 2017/07/28 15:47:11 1. I think you're referring to receive_cs_? I don'
108 // clear if that function can actually be caleld from more than one thread.
92 rtc::CriticalSection remb_crit_; 109 rtc::CriticalSection remb_crit_;
93 // The last time a REMB was sent. 110 // The last time a REMB was sent.
94 int64_t last_remb_time_ms_ GUARDED_BY(remb_crit_); 111 int64_t last_remb_time_ms_ GUARDED_BY(remb_crit_);
95 uint32_t last_send_bitrate_bps_ GUARDED_BY(remb_crit_); 112 uint32_t last_send_bitrate_bps_ GUARDED_BY(remb_crit_);
96 // The last bitrate update. 113 // The last bitrate update.
97 uint32_t bitrate_bps_ GUARDED_BY(remb_crit_); 114 uint32_t bitrate_bps_ GUARDED_BY(remb_crit_);
98 115
116 // Candidates for the REMB module can be RTP sender/receiver modules, with
117 // the sender modules taking precedence.
118 std::vector<RtpRtcp*> sender_remb_candidates_ GUARDED_BY(modules_crit_);
119 std::vector<RtpRtcp*> receiver_remb_candidates_ GUARDED_BY(modules_crit_);
120 RtpRtcp* active_remb_module_ GUARDED_BY(modules_crit_);
121
99 volatile int transport_seq_; 122 volatile int transport_seq_;
100 123
101 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter); 124 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter);
102 }; 125 };
103 } // namespace webrtc 126 } // namespace webrtc
104 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_ 127 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/pacing/packet_router.cc » ('j') | webrtc/modules/pacing/packet_router.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698