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

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

Issue 1871993002: Only generate one CNAME per PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | webrtc/pc/mediasession_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
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 for (StreamParamsVec::const_iterator it = params_vec.begin(); 216 for (StreamParamsVec::const_iterator it = params_vec.begin();
217 it != params_vec.end(); ++it) { 217 it != params_vec.end(); ++it) {
218 if (cname == it->cname) 218 if (cname == it->cname)
219 return &*it; 219 return &*it;
220 } 220 }
221 return NULL; 221 return NULL;
222 } 222 }
223 223
224 // Generates a new CNAME or the CNAME of an already existing StreamParams 224 // Generates a new CNAME or the CNAME of an already existing StreamParams
225 // if a StreamParams exist for another Stream in streams with sync_label 225 // if a StreamParams exist for another Stream in streams with sync_label
226 // sync_label. 226 // sync_label.
pthatcher1 2016/04/12 22:43:14 This comment is no longer accurate.
227 static bool GenerateCname(const StreamParamsVec& params_vec, 227 static bool GenerateCname(const StreamParamsVec& params_vec,
228 const MediaSessionOptions::Streams& streams, 228 const MediaSessionOptions::Streams& streams,
229 const std::string& synch_label, 229 const std::string& synch_label,
pthatcher1 2016/04/12 22:43:14 This parameter is no longer used.
230 std::string* cname) { 230 std::string* cname) {
231 ASSERT(cname != NULL); 231 ASSERT(cname != NULL);
232 if (!cname) 232 if (!cname)
233 return false; 233 return false;
234 234
235 // Check if a CNAME exist for any of the other synched streams. 235 // Check if a CNAME exist for any of the other streams.
pthatcher1 2016/04/12 22:43:14 exist => exists
236 for (MediaSessionOptions::Streams::const_iterator stream_it = streams.begin(); 236 for (MediaSessionOptions::Streams::const_iterator stream_it = streams.begin();
237 stream_it != streams.end() ; ++stream_it) { 237 stream_it != streams.end() ; ++stream_it) {
pthatcher1 2016/04/12 22:43:14 While you're in here, can you update this to a c++
238 if (synch_label != stream_it->sync_label)
239 continue;
240 238
241 // groupid is empty for StreamParams generated using 239 // groupid is empty for StreamParams generated using
242 // MediaSessionDescriptionFactory. 240 // MediaSessionDescriptionFactory.
243 const StreamParams* param = GetStreamByIds(params_vec, "", stream_it->id); 241 const StreamParams* param = GetStreamByIds(params_vec, "", stream_it->id);
244 if (param) { 242 if (param) {
245 *cname = param->cname; 243 *cname = param->cname;
246 return true; 244 return true;
247 } 245 }
248 } 246 }
249 // No other stream seems to exist that we should sync with. 247 // No other stream seems to exist that we should sync with.
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); 1992 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO));
1995 } 1993 }
1996 1994
1997 const DataContentDescription* GetFirstDataContentDescription( 1995 const DataContentDescription* GetFirstDataContentDescription(
1998 const SessionDescription* sdesc) { 1996 const SessionDescription* sdesc) {
1999 return static_cast<const DataContentDescription*>( 1997 return static_cast<const DataContentDescription*>(
2000 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); 1998 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA));
2001 } 1999 }
2002 2000
2003 } // namespace cricket 2001 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/pc/mediasession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698