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

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

Issue 1247293002: Add support for transport wide sequence numbers (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase, again Created 5 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
« no previous file with comments | « webrtc/modules/pacing/BUILD.gn ('k') | webrtc/modules/pacing/pacing.gypi » ('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_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/scoped_ptr.h" 18 #include "webrtc/base/scoped_ptr.h"
18 #include "webrtc/base/thread_annotations.h" 19 #include "webrtc/base/thread_annotations.h"
19 #include "webrtc/common_types.h" 20 #include "webrtc/common_types.h"
20 #include "webrtc/modules/pacing/include/paced_sender.h" 21 #include "webrtc/modules/pacing/include/paced_sender.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
24 class CriticalSectionWrapper;
25 class RTPFragmentationHeader;
26 class RtpRtcp; 25 class RtpRtcp;
27 struct RTPVideoHeader;
28 26
29 // PacketRouter routes outgoing data to the correct sending RTP module, based 27 // PacketRouter routes outgoing data to the correct sending RTP module, based
30 // on the simulcast layer in RTPVideoHeader. 28 // on the simulcast layer in RTPVideoHeader.
31 class PacketRouter : public PacedSender::Callback { 29 class PacketRouter : public PacedSender::Callback {
32 public: 30 public:
33 PacketRouter(); 31 PacketRouter();
34 virtual ~PacketRouter(); 32 virtual ~PacketRouter();
35 33
36 void AddRtpModule(RtpRtcp* rtp_module); 34 void AddRtpModule(RtpRtcp* rtp_module);
37 void RemoveRtpModule(RtpRtcp* rtp_module); 35 void RemoveRtpModule(RtpRtcp* rtp_module);
38 36
39 // Implements PacedSender::Callback. 37 // Implements PacedSender::Callback.
40 bool TimeToSendPacket(uint32_t ssrc, 38 bool TimeToSendPacket(uint32_t ssrc,
41 uint16_t sequence_number, 39 uint16_t sequence_number,
42 int64_t capture_timestamp, 40 int64_t capture_timestamp,
43 bool retransmission) override; 41 bool retransmission) override;
44 42
45 size_t TimeToSendPadding(size_t bytes) override; 43 size_t TimeToSendPadding(size_t bytes) override;
46 44
45 void SetTransportWideSequenceNumber(uint16_t sequence_number);
46 uint16_t AllocateSequenceNumber();
47
47 private: 48 private:
48 // TODO(holmer): When the new video API has launched, remove crit_ and 49 rtc::CriticalSection modules_lock_;
49 // assume rtp_modules_ will never change during a call. We should then also 50 // Map from ssrc to sending rtp module.
50 // switch rtp_modules_ to a map from ssrc to rtp module. 51 std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(modules_lock_);
51 rtc::scoped_ptr<CriticalSectionWrapper> crit_;
52 52
53 // Map from ssrc to sending rtp module. 53 volatile int transport_seq_;
54 std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(crit_.get());
55 54
56 DISALLOW_COPY_AND_ASSIGN(PacketRouter); 55 DISALLOW_COPY_AND_ASSIGN(PacketRouter);
57 }; 56 };
58 } // namespace webrtc 57 } // namespace webrtc
59 #endif // WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ 58 #endif // WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/BUILD.gn ('k') | webrtc/modules/pacing/pacing.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698