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

Unified Diff: webrtc/media/base/streamparams.h

Issue 2810733003: Fix SDP stream ID mismatch issue when a track's stream changes. (Closed)
Patch Set: Change name of test. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/pc/mediasession.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/streamparams.h
diff --git a/webrtc/media/base/streamparams.h b/webrtc/media/base/streamparams.h
index 75d82809cf23cea3e7bced4ca45bebd43a812176..5d7feafbe3eac800545b4738892ad3b471191f78 100644
--- a/webrtc/media/base/streamparams.h
+++ b/webrtc/media/base/streamparams.h
@@ -252,6 +252,13 @@ const StreamParams* GetStream(const StreamParamsVec& streams,
return found == streams.end() ? nullptr : &(*found);
}
+template <class Condition>
+StreamParams* GetStream(StreamParamsVec& streams, Condition condition) {
+ StreamParamsVec::iterator found =
+ std::find_if(streams.begin(), streams.end(), condition);
+ return found == streams.end() ? nullptr : &(*found);
+}
+
inline const StreamParams* GetStreamBySsrc(const StreamParamsVec& streams,
uint32_t ssrc) {
return GetStream(streams,
@@ -261,6 +268,14 @@ inline const StreamParams* GetStreamBySsrc(const StreamParamsVec& streams,
inline const StreamParams* GetStreamByIds(const StreamParamsVec& streams,
const std::string& groupid,
const std::string& id) {
+ return GetStream(streams, [&groupid, &id](const StreamParams& sp) {
+ return sp.groupid == groupid && sp.id == id;
+ });
+}
+
+inline StreamParams* GetStreamByIds(StreamParamsVec& streams,
+ const std::string& groupid,
+ const std::string& id) {
return GetStream(streams,
[&groupid, &id](const StreamParams& sp) {
return sp.groupid == groupid && sp.id == id;
« no previous file with comments | « no previous file | webrtc/pc/mediasession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698