OLD | NEW |
---|---|
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_INCLUDE_PACKET_ROUTER_H_ | 11 #ifndef WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ |
12 #define WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ | 12 #define WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 | 15 |
16 #include "webrtc/base/constructormagic.h" | 16 #include "webrtc/base/constructormagic.h" |
17 #include "webrtc/base/criticalsection.h" | 17 #include "webrtc/base/criticalsection.h" |
18 #include "webrtc/base/scoped_ptr.h" | 18 #include "webrtc/base/scoped_ptr.h" |
19 #include "webrtc/base/thread_annotations.h" | 19 #include "webrtc/base/thread_annotations.h" |
20 #include "webrtc/common_types.h" | 20 #include "webrtc/common_types.h" |
21 #include "webrtc/modules/pacing/include/paced_sender.h" | 21 #include "webrtc/modules/pacing/include/paced_sender.h" |
22 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" | |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 | 25 |
25 class RtpRtcp; | 26 class RtpRtcp; |
26 | 27 |
27 // PacketRouter routes outgoing data to the correct sending RTP module, based | 28 // PacketRouter routes outgoing data to the correct sending RTP module, based |
28 // on the simulcast layer in RTPVideoHeader. | 29 // on the simulcast layer in RTPVideoHeader. |
29 class PacketRouter : public PacedSender::Callback { | 30 class PacketRouter : public PacedSender::Callback { |
30 public: | 31 public: |
31 PacketRouter(); | 32 PacketRouter(); |
32 virtual ~PacketRouter(); | 33 virtual ~PacketRouter(); |
33 | 34 |
34 void AddRtpModule(RtpRtcp* rtp_module); | 35 void AddRtpModule(RtpRtcp* rtp_module); |
35 void RemoveRtpModule(RtpRtcp* rtp_module); | 36 void RemoveRtpModule(RtpRtcp* rtp_module); |
36 | 37 |
37 // Implements PacedSender::Callback. | 38 // Implements PacedSender::Callback. |
38 bool TimeToSendPacket(uint32_t ssrc, | 39 bool TimeToSendPacket(uint32_t ssrc, |
39 uint16_t sequence_number, | 40 uint16_t sequence_number, |
40 int64_t capture_timestamp, | 41 int64_t capture_timestamp, |
41 bool retransmission) override; | 42 bool retransmission) override; |
42 | 43 |
43 size_t TimeToSendPadding(size_t bytes) override; | 44 size_t TimeToSendPadding(size_t bytes) override; |
44 | 45 |
45 void SetTransportWideSequenceNumber(uint16_t sequence_number); | 46 void SetTransportWideSequenceNumber(uint16_t sequence_number); |
46 uint16_t AllocateSequenceNumber(); | 47 uint16_t AllocateSequenceNumber(); |
47 | 48 |
49 // Send transport feedback packet to send-side. | |
50 virtual bool SendFeedback(rtcp::TransportFeedback* packet); | |
stefan-webrtc
2015/09/04 07:31:36
Isn't PacketRouter actually living on the send sid
sprang_webrtc
2015/09/04 13:29:44
Receive times are collected on a call-level, no in
stefan-webrtc
2015/09/07 10:12:21
Ok, maybe that is reasonable. How is it set up wit
sprang_webrtc
2015/09/07 11:14:35
Modules that can send rtcp are added to this route
| |
51 | |
48 private: | 52 private: |
49 rtc::CriticalSection modules_lock_; | 53 rtc::CriticalSection modules_lock_; |
50 // Map from ssrc to sending rtp module. | 54 // Map from ssrc to sending rtp module. |
51 std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(modules_lock_); | 55 std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(modules_lock_); |
52 | 56 |
53 volatile int transport_seq_; | 57 volatile int transport_seq_; |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(PacketRouter); | 59 DISALLOW_COPY_AND_ASSIGN(PacketRouter); |
56 }; | 60 }; |
57 } // namespace webrtc | 61 } // namespace webrtc |
58 #endif // WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ | 62 #endif // WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ |
OLD | NEW |