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

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

Issue 2789843002: Delete VieRemb class, move functionality to PacketRouter. (Closed)
Patch Set: Delete obsolete suppression for PacketRouterTest.SendTransportFeedback. 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
« no previous file with comments | « webrtc/modules/pacing/BUILD.gn ('k') | webrtc/modules/pacing/packet_router.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #ifndef WEBRTC_MODULES_PACING_PACKET_ROUTER_H_ 11 #ifndef WEBRTC_MODULES_PACING_PACKET_ROUTER_H_
12 #define WEBRTC_MODULES_PACING_PACKET_ROUTER_H_ 12 #define WEBRTC_MODULES_PACING_PACKET_ROUTER_H_
13 13
14 #include <list> 14 #include <list>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/base/constructormagic.h" 17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/criticalsection.h" 18 #include "webrtc/base/criticalsection.h"
19 #include "webrtc/base/thread_annotations.h" 19 #include "webrtc/base/thread_annotations.h"
20 #include "webrtc/base/thread_checker.h" 20 #include "webrtc/base/thread_checker.h"
21 #include "webrtc/common_types.h" 21 #include "webrtc/common_types.h"
22 #include "webrtc/modules/pacing/paced_sender.h" 22 #include "webrtc/modules/pacing/paced_sender.h"
23 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat or.h"
23 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
24 25
25 namespace webrtc { 26 namespace webrtc {
26 27
27 class RtpRtcp; 28 class RtpRtcp;
28 namespace rtcp { 29 namespace rtcp {
29 class TransportFeedback; 30 class TransportFeedback;
30 } // namespace rtcp 31 } // namespace rtcp
31 32
32 // PacketRouter keeps track of rtp send modules to support the pacer. 33 // PacketRouter keeps track of rtp send modules to support the pacer.
33 // In addition, it handles feedback messages, which are sent on a send 34 // In addition, it handles feedback messages, which are sent on a send
34 // module if possible (sender report), otherwise on receive module 35 // module if possible (sender report), otherwise on receive module
35 // (receiver report). For the latter case, we also keep track of the 36 // (receiver report). For the latter case, we also keep track of the
36 // receive modules. 37 // receive modules.
37 class PacketRouter : public PacedSender::PacketSender, 38 class PacketRouter : public PacedSender::PacketSender,
38 public TransportSequenceNumberAllocator { 39 public TransportSequenceNumberAllocator,
40 public RemoteBitrateObserver {
39 public: 41 public:
40 PacketRouter(); 42 PacketRouter();
41 virtual ~PacketRouter(); 43 virtual ~PacketRouter();
42 44
43 // TODO(nisse): Delete, as soon as downstream app is updated. 45 // TODO(nisse): Delete, as soon as downstream app is updated.
44 RTC_DEPRECATED void AddRtpModule(RtpRtcp* rtp_module) { 46 RTC_DEPRECATED void AddRtpModule(RtpRtcp* rtp_module) {
45 AddReceiveRtpModule(rtp_module); 47 AddReceiveRtpModule(rtp_module);
46 } 48 }
47 RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) { 49 RTC_DEPRECATED void RemoveRtpModule(RtpRtcp* rtp_module) {
48 RemoveReceiveRtpModule(rtp_module); 50 RemoveReceiveRtpModule(rtp_module);
(...skipping 10 matching lines...) Expand all
59 int64_t capture_timestamp, 61 int64_t capture_timestamp,
60 bool retransmission, 62 bool retransmission,
61 const PacedPacketInfo& packet_info) override; 63 const PacedPacketInfo& packet_info) override;
62 64
63 size_t TimeToSendPadding(size_t bytes, 65 size_t TimeToSendPadding(size_t bytes,
64 const PacedPacketInfo& packet_info) override; 66 const PacedPacketInfo& packet_info) override;
65 67
66 void SetTransportWideSequenceNumber(uint16_t sequence_number); 68 void SetTransportWideSequenceNumber(uint16_t sequence_number);
67 uint16_t AllocateSequenceNumber() override; 69 uint16_t AllocateSequenceNumber() override;
68 70
71 // Called every time there is a new bitrate estimate for a receive channel
72 // group. This call will trigger a new RTCP REMB packet if the bitrate
73 // estimate has decreased or if no RTCP REMB packet has been sent for
74 // a certain time interval.
75 // Implements RtpReceiveBitrateUpdate.
76 void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
77 uint32_t bitrate_bps) override;
78
79 // Send REMB feedback.
80 virtual bool SendRemb(uint32_t bitrate_bps,
81 const std::vector<uint32_t>& ssrcs);
82
69 // Send transport feedback packet to send-side. 83 // Send transport feedback packet to send-side.
70 virtual bool SendFeedback(rtcp::TransportFeedback* packet); 84 virtual bool SendTransportFeedback(rtcp::TransportFeedback* packet);
71 85
72 private: 86 private:
73 rtc::ThreadChecker pacer_thread_checker_; 87 rtc::ThreadChecker pacer_thread_checker_;
74 rtc::CriticalSection modules_crit_; 88 rtc::CriticalSection modules_crit_;
75 std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_); 89 std::list<RtpRtcp*> rtp_send_modules_ GUARDED_BY(modules_crit_);
76 std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_); 90 std::vector<RtpRtcp*> rtp_receive_modules_ GUARDED_BY(modules_crit_);
77 91
92 rtc::CriticalSection remb_crit_;
93 // The last time a REMB was sent.
94 int64_t last_remb_time_ms_ GUARDED_BY(remb_crit_);
95 uint32_t last_send_bitrate_bps_ GUARDED_BY(remb_crit_);
96 // The last bitrate update.
97 uint32_t bitrate_bps_ GUARDED_BY(remb_crit_);
98
78 volatile int transport_seq_; 99 volatile int transport_seq_;
79 100
80 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter); 101 RTC_DISALLOW_COPY_AND_ASSIGN(PacketRouter);
81 }; 102 };
82 } // namespace webrtc 103 } // namespace webrtc
83 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_ 104 #endif // WEBRTC_MODULES_PACING_PACKET_ROUTER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/BUILD.gn ('k') | webrtc/modules/pacing/packet_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698