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

Side by Side Diff: webrtc/pc/rtcpmuxfilter.cc

Issue 2260963002: Some cleanup in BaseChannel RTCP mux code. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Clarifying comment. Created 4 years, 3 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/pc/rtcpmuxfilter.h ('k') | webrtc/pc/rtcpmuxfilter_unittest.cc » ('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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 #include "webrtc/pc/rtcpmuxfilter.h" 11 #include "webrtc/pc/rtcpmuxfilter.h"
12 12
13 #include "webrtc/base/logging.h" 13 #include "webrtc/base/logging.h"
14 14
15 namespace cricket { 15 namespace cricket {
16 16
17 RtcpMuxFilter::RtcpMuxFilter() : state_(ST_INIT), offer_enable_(false) { 17 RtcpMuxFilter::RtcpMuxFilter() : state_(ST_INIT), offer_enable_(false) {
18 } 18 }
19 19
20 bool RtcpMuxFilter::IsFullyActive() const {
21 return state_ == ST_ACTIVE;
22 }
23
24 bool RtcpMuxFilter::IsProvisionallyActive() const {
25 return state_ == ST_SENTPRANSWER || state_ == ST_RECEIVEDPRANSWER;
26 }
27
20 bool RtcpMuxFilter::IsActive() const { 28 bool RtcpMuxFilter::IsActive() const {
21 return state_ == ST_SENTPRANSWER || 29 return IsFullyActive() || IsProvisionallyActive();
22 state_ == ST_RECEIVEDPRANSWER ||
23 state_ == ST_ACTIVE;
24 } 30 }
25 31
26 void RtcpMuxFilter::SetActive() { 32 void RtcpMuxFilter::SetActive() {
27 state_ = ST_ACTIVE; 33 state_ = ST_ACTIVE;
28 } 34 }
29 35
30 bool RtcpMuxFilter::SetOffer(bool offer_enable, ContentSource src) { 36 bool RtcpMuxFilter::SetOffer(bool offer_enable, ContentSource src) {
31 if (state_ == ST_ACTIVE) { 37 if (state_ == ST_ACTIVE) {
32 // Fail if we try to deactivate and no-op if we try and activate. 38 // Fail if we try to deactivate and no-op if we try and activate.
33 return offer_enable; 39 return offer_enable;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 136 }
131 137
132 bool RtcpMuxFilter::ExpectAnswer(ContentSource source) { 138 bool RtcpMuxFilter::ExpectAnswer(ContentSource source) {
133 return ((state_ == ST_SENTOFFER && source == CS_REMOTE) || 139 return ((state_ == ST_SENTOFFER && source == CS_REMOTE) ||
134 (state_ == ST_RECEIVEDOFFER && source == CS_LOCAL) || 140 (state_ == ST_RECEIVEDOFFER && source == CS_LOCAL) ||
135 (state_ == ST_SENTPRANSWER && source == CS_LOCAL) || 141 (state_ == ST_SENTPRANSWER && source == CS_LOCAL) ||
136 (state_ == ST_RECEIVEDPRANSWER && source == CS_REMOTE)); 142 (state_ == ST_RECEIVEDPRANSWER && source == CS_REMOTE));
137 } 143 }
138 144
139 } // namespace cricket 145 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/rtcpmuxfilter.h ('k') | webrtc/pc/rtcpmuxfilter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698