Index: webrtc/modules/pacing/include/packet_router.h |
diff --git a/webrtc/modules/pacing/include/packet_router.h b/webrtc/modules/pacing/include/packet_router.h |
index c1b332a6bfc6b1ad6e7af0bea989b0803a648c89..6102706b7e0008b8a02f68f90923a72d997c38bb 100644 |
--- a/webrtc/modules/pacing/include/packet_router.h |
+++ b/webrtc/modules/pacing/include/packet_router.h |
@@ -11,20 +11,20 @@ |
#ifndef WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ |
#define WEBRTC_MODULES_PACING_INCLUDE_PACKET_ROUTER_H_ |
-#include <list> |
+#include <map> |
#include "webrtc/base/constructormagic.h" |
+#include "webrtc/base/criticalsection.h" |
#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/base/thread_annotations.h" |
#include "webrtc/common_types.h" |
#include "webrtc/modules/pacing/include/paced_sender.h" |
+#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" |
+#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" |
namespace webrtc { |
-class CriticalSectionWrapper; |
-class RTPFragmentationHeader; |
class RtpRtcp; |
-struct RTPVideoHeader; |
// PacketRouter routes outgoing data to the correct sending RTP module, based |
// on the simulcast layer in RTPVideoHeader. |
@@ -35,6 +35,7 @@ class PacketRouter : public PacedSender::Callback { |
void AddRtpModule(RtpRtcp* rtp_module); |
void RemoveRtpModule(RtpRtcp* rtp_module); |
+ void OnSsrcChanged(); |
// Implements PacedSender::Callback. |
bool TimeToSendPacket(uint32_t ssrc, |
@@ -44,14 +45,18 @@ class PacketRouter : public PacedSender::Callback { |
size_t TimeToSendPadding(size_t bytes) override; |
+ void SetTransportWideSequenceNumber(uint16_t sequence_number); |
+ uint16_t AllocateSequenceNumber(); |
+ |
private: |
- // TODO(holmer): When the new video API has launched, remove crit_ and |
- // assume rtp_modules_ will never change during a call. We should then also |
- // switch rtp_modules_ to a map from ssrc to rtp module. |
- rtc::scoped_ptr<CriticalSectionWrapper> crit_; |
+ void UpdateModuleMap() EXCLUSIVE_LOCKS_REQUIRED(modules_lock_); |
+ rtc::CriticalSection modules_lock_; |
// Map from ssrc to sending rtp module. |
- std::list<RtpRtcp*> rtp_modules_ GUARDED_BY(crit_.get()); |
+ std::map<uint32_t, RtpRtcp*> rtp_modules_ GUARDED_BY(modules_lock_); |
+ volatile int dirty_map_; |
+ |
+ volatile int transport_seq_; |
DISALLOW_COPY_AND_ASSIGN(PacketRouter); |
}; |