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

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: 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
Index: webrtc/video/payload_router.h
diff --git a/webrtc/video/payload_router.h b/webrtc/video/payload_router.h
index ad570fabed4913341309adbac45dba3ee607fa47..8b4b6bdb6d8b330831f2eb80c61a6bb79448a667 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,18 @@ class PayloadRouter {
// and RTP headers.
size_t MaxPayloadLength() const;
- void AddRef() { ++ref_count_; }
- void Release() { if (--ref_count_ == 0) { delete this; } }
-
private:
+ void UpdateModuleSendingState() EXCLUSIVE_LOCKS_REQUIRED(crit_);
// TODO(mflodman): When the new video API has launched, remove crit_ and
// assume rtp_modules_ will never change during a call.
rtc::CriticalSection 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.
+ std::vector<RtpRtcp*> rtp_modules_;
- Atomic32 ref_count_;
+ bool active_ GUARDED_BY(crit_);
+ // Active sending RTP modules, in layer order.
stefan-webrtc 2016/02/26 14:49:07 Maybe move this to before the vector?
pbos-webrtc 2016/02/26 14:58:56 Want them to be lumped with the crit_ that protect
+ size_t num_sending_modules_ GUARDED_BY(crit_);
RTC_DISALLOW_COPY_AND_ASSIGN(PayloadRouter);
};

Powered by Google App Engine
This is Rietveld 408576698