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

Side by Side Diff: webrtc/media/base/streamparams.h

Issue 2810733003: Fix SDP stream ID mismatch issue when a track's stream changes. (Closed)
Patch Set: Created 3 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.cc » ('j') | webrtc/pc/mediasession.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 }; 245 };
246 246
247 template <class Condition> 247 template <class Condition>
248 const StreamParams* GetStream(const StreamParamsVec& streams, 248 const StreamParams* GetStream(const StreamParamsVec& streams,
249 Condition condition) { 249 Condition condition) {
250 StreamParamsVec::const_iterator found = 250 StreamParamsVec::const_iterator found =
251 std::find_if(streams.begin(), streams.end(), condition); 251 std::find_if(streams.begin(), streams.end(), condition);
252 return found == streams.end() ? nullptr : &(*found); 252 return found == streams.end() ? nullptr : &(*found);
253 } 253 }
254 254
255 template <class Condition>
256 StreamParams* GetStream(StreamParamsVec& streams, Condition condition) {
257 StreamParamsVec::iterator found =
258 std::find_if(streams.begin(), streams.end(), condition);
259 return found == streams.end() ? nullptr : &(*found);
260 }
261
255 inline const StreamParams* GetStreamBySsrc(const StreamParamsVec& streams, 262 inline const StreamParams* GetStreamBySsrc(const StreamParamsVec& streams,
256 uint32_t ssrc) { 263 uint32_t ssrc) {
257 return GetStream(streams, 264 return GetStream(streams,
258 [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); }); 265 [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); });
259 } 266 }
260 267
261 inline const StreamParams* GetStreamByIds(const StreamParamsVec& streams, 268 inline const StreamParams* GetStreamByIds(const StreamParamsVec& streams,
262 const std::string& groupid, 269 const std::string& groupid,
263 const std::string& id) { 270 const std::string& id) {
271 return GetStream(streams, [&groupid, &id](const StreamParams& sp) {
272 return sp.groupid == groupid && sp.id == id;
273 });
274 }
275
276 inline StreamParams* GetStreamByIds(StreamParamsVec& streams,
277 const std::string& groupid,
278 const std::string& id) {
264 return GetStream(streams, 279 return GetStream(streams,
265 [&groupid, &id](const StreamParams& sp) { 280 [&groupid, &id](const StreamParams& sp) {
266 return sp.groupid == groupid && sp.id == id; 281 return sp.groupid == groupid && sp.id == id;
267 }); 282 });
268 } 283 }
269 284
270 inline const StreamParams* GetStream(const StreamParamsVec& streams, 285 inline const StreamParams* GetStream(const StreamParamsVec& streams,
271 const StreamSelector& selector) { 286 const StreamSelector& selector) {
272 return GetStream(streams, 287 return GetStream(streams,
273 [&selector](const StreamParams& sp) { return selector.Matches(sp); }); 288 [&selector](const StreamParams& sp) { return selector.Matches(sp); });
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 bool IsOneSsrcStream(const StreamParams& sp); 323 bool IsOneSsrcStream(const StreamParams& sp);
309 324
310 // Checks if |sp| defines parameters for one Simulcast stream. There may be RTX 325 // Checks if |sp| defines parameters for one Simulcast stream. There may be RTX
311 // streams associated with the simulcast streams. Leaving as non-static so we 326 // streams associated with the simulcast streams. Leaving as non-static so we
312 // can test this function. 327 // can test this function.
313 bool IsSimulcastStream(const StreamParams& sp); 328 bool IsSimulcastStream(const StreamParams& sp);
314 329
315 } // namespace cricket 330 } // namespace cricket
316 331
317 #endif // WEBRTC_MEDIA_BASE_STREAMPARAMS_H_ 332 #endif // WEBRTC_MEDIA_BASE_STREAMPARAMS_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/pc/mediasession.cc » ('j') | webrtc/pc/mediasession.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698