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

Unified Diff: webrtc/video/payload_router.h

Issue 1725363003: Move RTP module activation into PayloadRouter. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nuke comment Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/payload_router.h
diff --git a/webrtc/video/payload_router.h b/webrtc/video/payload_router.h
index ad570fabed4913341309adbac45dba3ee607fa47..661856d2a5cbd4c78912de855e11e2cc6d4db8dc 100644
--- a/webrtc/video/payload_router.h
+++ b/webrtc/video/payload_router.h
@@ -36,7 +36,9 @@ class PayloadRouter {
static size_t DefaultMaxPayloadLength();
// Rtp modules are assumed to be sorted in simulcast index order.
- void SetSendingRtpModules(const std::vector<RtpRtcp*>& rtp_modules);
+ void Init(const std::vector<RtpRtcp*>& rtp_modules);
+
+ void SetSendingRtpModules(size_t num_sending_modules);
// PayloadRouter will only route packets if being active, all packets will be
// dropped otherwise.
@@ -62,19 +64,15 @@ class PayloadRouter {
// and RTP headers.
size_t MaxPayloadLength() const;
- void AddRef() { ++ref_count_; }
- void Release() { if (--ref_count_ == 0) { delete this; } }
-
private:
- // TODO(mflodman): When the new video API has launched, remove crit_ and
- // assume rtp_modules_ will never change during a call.
- rtc::CriticalSection crit_;
+ void UpdateModuleSendingState() EXCLUSIVE_LOCKS_REQUIRED(crit_);
- // Active sending RTP modules, in layer order.
- std::vector<RtpRtcp*> rtp_modules_ GUARDED_BY(crit_);
- bool active_ GUARDED_BY(crit_);
+ // TODO(pbos): Set once and for all on construction and make const.
+ std::vector<RtpRtcp*> rtp_modules_;
- Atomic32 ref_count_;
+ rtc::CriticalSection crit_;
+ bool active_ GUARDED_BY(crit_);
+ size_t num_sending_modules_ GUARDED_BY(crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(PayloadRouter);
};
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698