| 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;
|
|
|