henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | // This file contains structures for describing SSRCs from a media source such |
| 12 | // as a MediaStreamTrack when it is sent across an RTP session. Multiple media |
| 13 | // sources may be sent across the same RTP session, each of them will be |
| 14 | // described by one StreamParams object |
| 15 | // SsrcGroup is used to describe the relationship between the SSRCs that |
| 16 | // are used for this media source. |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 17 | // E.x: Consider a source that is sent as 3 simulcast streams |
| 18 | // Let the simulcast elements have SSRC 10, 20, 30. |
| 19 | // Let each simulcast element use FEC and let the protection packets have |
| 20 | // SSRC 11,21,31. |
| 21 | // To describe this 4 SsrcGroups are needed, |
| 22 | // StreamParams would then contain ssrc = {10,11,20,21,30,31} and |
| 23 | // ssrc_groups = {{SIM,{10,20,30}, {FEC,{10,11}, {FEC, {20,21}, {FEC {30,31}}} |
| 24 | // Please see RFC 5576. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 25 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 26 | #ifndef MEDIA_BASE_STREAMPARAMS_H_ |
| 27 | #define MEDIA_BASE_STREAMPARAMS_H_ |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 28 | |
pbos | c7c26a0 | 2017-01-02 08:42:32 -0800 | [diff] [blame] | 29 | #include <stdint.h> |
| 30 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 31 | #include <algorithm> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 32 | #include <set> |
buildbot@webrtc.org | a09a999 | 2014-08-13 17:26:08 +0000 | [diff] [blame] | 33 | #include <string> |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 34 | #include <vector> |
| 35 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 36 | #include "rtc_base/constructormagic.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 37 | |
| 38 | namespace cricket { |
| 39 | |
| 40 | extern const char kFecSsrcGroupSemantics[]; |
brandtr | 9688e38 | 2016-11-22 00:59:48 -0800 | [diff] [blame] | 41 | extern const char kFecFrSsrcGroupSemantics[]; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 42 | extern const char kFidSsrcGroupSemantics[]; |
wu@webrtc.org | cecfd18 | 2013-10-30 05:18:12 +0000 | [diff] [blame] | 43 | extern const char kSimSsrcGroupSemantics[]; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 44 | |
| 45 | struct SsrcGroup { |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 46 | SsrcGroup(const std::string& usage, const std::vector<uint32_t>& ssrcs) |
| 47 | : semantics(usage), ssrcs(ssrcs) {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 48 | |
| 49 | bool operator==(const SsrcGroup& other) const { |
| 50 | return (semantics == other.semantics && ssrcs == other.ssrcs); |
| 51 | } |
| 52 | bool operator!=(const SsrcGroup &other) const { |
| 53 | return !(*this == other); |
| 54 | } |
| 55 | |
| 56 | bool has_semantics(const std::string& semantics) const; |
| 57 | |
| 58 | std::string ToString() const; |
| 59 | |
| 60 | std::string semantics; // e.g FIX, FEC, SIM. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 61 | std::vector<uint32_t> ssrcs; // SSRCs of this type. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | struct StreamParams { |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 65 | static StreamParams CreateLegacy(uint32_t ssrc) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 66 | StreamParams stream; |
| 67 | stream.ssrcs.push_back(ssrc); |
| 68 | return stream; |
| 69 | } |
| 70 | |
| 71 | bool operator==(const StreamParams& other) const { |
Steve Anton | 5a26a3a | 2018-02-28 11:38:47 -0800 | [diff] [blame] | 72 | return (groupid == other.groupid && id == other.id && |
| 73 | ssrcs == other.ssrcs && ssrc_groups == other.ssrc_groups && |
| 74 | type == other.type && display == other.display && |
Seth Hampson | 5b4f075 | 2018-04-02 16:31:36 -0700 | [diff] [blame^] | 75 | cname == other.cname && stream_ids_ == other.stream_ids_); |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 76 | } |
| 77 | bool operator!=(const StreamParams &other) const { |
| 78 | return !(*this == other); |
| 79 | } |
| 80 | |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 81 | uint32_t first_ssrc() const { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 82 | if (ssrcs.empty()) { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | return ssrcs[0]; |
| 87 | } |
| 88 | bool has_ssrcs() const { |
| 89 | return !ssrcs.empty(); |
| 90 | } |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 91 | bool has_ssrc(uint32_t ssrc) const { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 92 | return std::find(ssrcs.begin(), ssrcs.end(), ssrc) != ssrcs.end(); |
| 93 | } |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 94 | void add_ssrc(uint32_t ssrc) { ssrcs.push_back(ssrc); } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 95 | bool has_ssrc_groups() const { |
| 96 | return !ssrc_groups.empty(); |
| 97 | } |
| 98 | bool has_ssrc_group(const std::string& semantics) const { |
| 99 | return (get_ssrc_group(semantics) != NULL); |
| 100 | } |
| 101 | const SsrcGroup* get_ssrc_group(const std::string& semantics) const { |
| 102 | for (std::vector<SsrcGroup>::const_iterator it = ssrc_groups.begin(); |
| 103 | it != ssrc_groups.end(); ++it) { |
| 104 | if (it->has_semantics(semantics)) { |
| 105 | return &(*it); |
| 106 | } |
| 107 | } |
| 108 | return NULL; |
| 109 | } |
| 110 | |
| 111 | // Convenience function to add an FID ssrc for a primary_ssrc |
| 112 | // that's already been added. |
brandtr | 9688e38 | 2016-11-22 00:59:48 -0800 | [diff] [blame] | 113 | bool AddFidSsrc(uint32_t primary_ssrc, uint32_t fid_ssrc) { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 114 | return AddSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc); |
| 115 | } |
| 116 | |
| 117 | // Convenience function to lookup the FID ssrc for a primary_ssrc. |
| 118 | // Returns false if primary_ssrc not found or FID not defined for it. |
brandtr | 9688e38 | 2016-11-22 00:59:48 -0800 | [diff] [blame] | 119 | bool GetFidSsrc(uint32_t primary_ssrc, uint32_t* fid_ssrc) const { |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 120 | return GetSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc); |
| 121 | } |
| 122 | |
brandtr | 9688e38 | 2016-11-22 00:59:48 -0800 | [diff] [blame] | 123 | // Convenience function to add an FEC-FR ssrc for a primary_ssrc |
| 124 | // that's already been added. |
| 125 | bool AddFecFrSsrc(uint32_t primary_ssrc, uint32_t fecfr_ssrc) { |
| 126 | return AddSecondarySsrc(kFecFrSsrcGroupSemantics, primary_ssrc, fecfr_ssrc); |
| 127 | } |
| 128 | |
| 129 | // Convenience function to lookup the FEC-FR ssrc for a primary_ssrc. |
| 130 | // Returns false if primary_ssrc not found or FEC-FR not defined for it. |
| 131 | bool GetFecFrSsrc(uint32_t primary_ssrc, uint32_t* fecfr_ssrc) const { |
| 132 | return GetSecondarySsrc(kFecFrSsrcGroupSemantics, primary_ssrc, fecfr_ssrc); |
| 133 | } |
| 134 | |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 135 | // Convenience to get all the SIM SSRCs if there are SIM ssrcs, or |
| 136 | // the first SSRC otherwise. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 137 | void GetPrimarySsrcs(std::vector<uint32_t>* ssrcs) const; |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 138 | |
| 139 | // Convenience to get all the FID SSRCs for the given primary ssrcs. |
| 140 | // If a given primary SSRC does not have a FID SSRC, the list of FID |
| 141 | // SSRCS will be smaller than the list of primary SSRCs. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 142 | void GetFidSsrcs(const std::vector<uint32_t>& primary_ssrcs, |
| 143 | std::vector<uint32_t>* fid_ssrcs) const; |
pbos@webrtc.org | 5301b0f | 2014-07-17 08:51:46 +0000 | [diff] [blame] | 144 | |
Seth Hampson | 845e878 | 2018-03-02 11:34:10 -0800 | [diff] [blame] | 145 | // Stream ids serialized to SDP. |
| 146 | std::vector<std::string> stream_ids() const; |
| 147 | void set_stream_ids(const std::vector<std::string>& stream_ids); |
Steve Anton | ac7539e | 2018-02-26 17:20:29 -0800 | [diff] [blame] | 148 | |
Seth Hampson | 845e878 | 2018-03-02 11:34:10 -0800 | [diff] [blame] | 149 | // Returns the first stream id or "" if none exist. This method exists only |
Steve Anton | 5a26a3a | 2018-02-28 11:38:47 -0800 | [diff] [blame] | 150 | // as temporary backwards compatibility with the old sync_label. |
Seth Hampson | 845e878 | 2018-03-02 11:34:10 -0800 | [diff] [blame] | 151 | std::string first_stream_id() const; |
Steve Anton | 5a26a3a | 2018-02-28 11:38:47 -0800 | [diff] [blame] | 152 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 153 | std::string ToString() const; |
| 154 | |
| 155 | // Resource of the MUC jid of the participant of with this stream. |
| 156 | // For 1:1 calls, should be left empty (which means remote streams |
| 157 | // and local streams should not be mixed together). |
| 158 | std::string groupid; |
| 159 | // Unique per-groupid, not across all groupids |
| 160 | std::string id; |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 161 | std::vector<uint32_t> ssrcs; // All SSRCs for this source |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 162 | std::vector<SsrcGroup> ssrc_groups; // e.g. FID, FEC, SIM |
| 163 | // Examples: "camera", "screencast" |
| 164 | std::string type; |
| 165 | // Friendly name describing stream |
| 166 | std::string display; |
| 167 | std::string cname; // RTCP CNAME |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 168 | |
| 169 | private: |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 170 | bool AddSecondarySsrc(const std::string& semantics, |
| 171 | uint32_t primary_ssrc, |
| 172 | uint32_t secondary_ssrc); |
| 173 | bool GetSecondarySsrc(const std::string& semantics, |
| 174 | uint32_t primary_ssrc, |
| 175 | uint32_t* secondary_ssrc) const; |
Seth Hampson | 5b4f075 | 2018-04-02 16:31:36 -0700 | [diff] [blame^] | 176 | |
| 177 | std::vector<std::string> stream_ids_; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | // A Stream can be selected by either groupid+id or ssrc. |
| 181 | struct StreamSelector { |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 182 | explicit StreamSelector(uint32_t ssrc) : ssrc(ssrc) {} |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 183 | |
| 184 | StreamSelector(const std::string& groupid, |
| 185 | const std::string& streamid) : |
| 186 | ssrc(0), |
| 187 | groupid(groupid), |
| 188 | streamid(streamid) { |
| 189 | } |
| 190 | |
Seth Hampson | 23ffbe7 | 2018-03-30 16:59:31 -0700 | [diff] [blame] | 191 | explicit StreamSelector(const std::string& streamid) |
| 192 | : ssrc(0), streamid(streamid) {} |
| 193 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 194 | bool Matches(const StreamParams& stream) const { |
| 195 | if (ssrc == 0) { |
| 196 | return stream.groupid == groupid && stream.id == streamid; |
| 197 | } else { |
| 198 | return stream.has_ssrc(ssrc); |
| 199 | } |
| 200 | } |
| 201 | |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 202 | uint32_t ssrc; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 203 | std::string groupid; |
| 204 | std::string streamid; |
| 205 | }; |
| 206 | |
| 207 | typedef std::vector<StreamParams> StreamParamsVec; |
| 208 | |
pthatcher@webrtc.org | e2b7585 | 2014-12-16 21:09:08 +0000 | [diff] [blame] | 209 | // A collection of audio and video and data streams. Most of the |
| 210 | // methods are merely for convenience. Many of these methods are keyed |
| 211 | // by ssrc, which is the source identifier in the RTP spec |
| 212 | // (http://tools.ietf.org/html/rfc3550). |
| 213 | // TODO(pthatcher): Add basic unit test for these. |
| 214 | // See https://code.google.com/p/webrtc/issues/detail?id=4107 |
| 215 | struct MediaStreams { |
| 216 | public: |
| 217 | MediaStreams() {} |
| 218 | void CopyFrom(const MediaStreams& sources); |
| 219 | |
| 220 | bool empty() const { |
| 221 | return audio_.empty() && video_.empty() && data_.empty(); |
| 222 | } |
| 223 | |
| 224 | std::vector<StreamParams>* mutable_audio() { return &audio_; } |
| 225 | std::vector<StreamParams>* mutable_video() { return &video_; } |
| 226 | std::vector<StreamParams>* mutable_data() { return &data_; } |
| 227 | const std::vector<StreamParams>& audio() const { return audio_; } |
| 228 | const std::vector<StreamParams>& video() const { return video_; } |
| 229 | const std::vector<StreamParams>& data() const { return data_; } |
| 230 | |
| 231 | // Gets a stream, returning true if found. |
| 232 | bool GetAudioStream( |
| 233 | const StreamSelector& selector, StreamParams* stream); |
| 234 | bool GetVideoStream( |
| 235 | const StreamSelector& selector, StreamParams* stream); |
| 236 | bool GetDataStream( |
| 237 | const StreamSelector& selector, StreamParams* stream); |
| 238 | // Adds a stream. |
| 239 | void AddAudioStream(const StreamParams& stream); |
| 240 | void AddVideoStream(const StreamParams& stream); |
| 241 | void AddDataStream(const StreamParams& stream); |
| 242 | // Removes a stream, returning true if found and removed. |
| 243 | bool RemoveAudioStream(const StreamSelector& selector); |
| 244 | bool RemoveVideoStream(const StreamSelector& selector); |
| 245 | bool RemoveDataStream(const StreamSelector& selector); |
| 246 | |
| 247 | private: |
| 248 | std::vector<StreamParams> audio_; |
| 249 | std::vector<StreamParams> video_; |
| 250 | std::vector<StreamParams> data_; |
| 251 | |
henrikg | 3c089d7 | 2015-09-16 05:37:44 -0700 | [diff] [blame] | 252 | RTC_DISALLOW_COPY_AND_ASSIGN(MediaStreams); |
pthatcher@webrtc.org | e2b7585 | 2014-12-16 21:09:08 +0000 | [diff] [blame] | 253 | }; |
| 254 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 255 | template <class Condition> |
| 256 | const StreamParams* GetStream(const StreamParamsVec& streams, |
| 257 | Condition condition) { |
| 258 | StreamParamsVec::const_iterator found = |
| 259 | std::find_if(streams.begin(), streams.end(), condition); |
| 260 | return found == streams.end() ? nullptr : &(*found); |
| 261 | } |
| 262 | |
deadbeef | 2f425aa | 2017-04-14 10:41:32 -0700 | [diff] [blame] | 263 | template <class Condition> |
| 264 | StreamParams* GetStream(StreamParamsVec& streams, Condition condition) { |
| 265 | StreamParamsVec::iterator found = |
| 266 | std::find_if(streams.begin(), streams.end(), condition); |
| 267 | return found == streams.end() ? nullptr : &(*found); |
| 268 | } |
| 269 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 270 | inline const StreamParams* GetStreamBySsrc(const StreamParamsVec& streams, |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 271 | uint32_t ssrc) { |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 272 | return GetStream(streams, |
| 273 | [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); }); |
| 274 | } |
| 275 | |
| 276 | inline const StreamParams* GetStreamByIds(const StreamParamsVec& streams, |
| 277 | const std::string& groupid, |
| 278 | const std::string& id) { |
deadbeef | 2f425aa | 2017-04-14 10:41:32 -0700 | [diff] [blame] | 279 | return GetStream(streams, [&groupid, &id](const StreamParams& sp) { |
| 280 | return sp.groupid == groupid && sp.id == id; |
| 281 | }); |
| 282 | } |
| 283 | |
| 284 | inline StreamParams* GetStreamByIds(StreamParamsVec& streams, |
| 285 | const std::string& groupid, |
| 286 | const std::string& id) { |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 287 | return GetStream(streams, |
| 288 | [&groupid, &id](const StreamParams& sp) { |
| 289 | return sp.groupid == groupid && sp.id == id; |
| 290 | }); |
| 291 | } |
| 292 | |
| 293 | inline const StreamParams* GetStream(const StreamParamsVec& streams, |
| 294 | const StreamSelector& selector) { |
| 295 | return GetStream(streams, |
| 296 | [&selector](const StreamParams& sp) { return selector.Matches(sp); }); |
| 297 | } |
| 298 | |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 299 | template <class Condition> |
| 300 | bool RemoveStream(StreamParamsVec* streams, Condition condition) { |
| 301 | auto iter(std::remove_if(streams->begin(), streams->end(), condition)); |
| 302 | if (iter == streams->end()) |
| 303 | return false; |
| 304 | streams->erase(iter, streams->end()); |
| 305 | return true; |
| 306 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 307 | |
| 308 | // Removes the stream from streams. Returns true if a stream is |
| 309 | // found and removed. |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 310 | inline bool RemoveStream(StreamParamsVec* streams, |
| 311 | const StreamSelector& selector) { |
| 312 | return RemoveStream(streams, |
| 313 | [&selector](const StreamParams& sp) { return selector.Matches(sp); }); |
| 314 | } |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 315 | inline bool RemoveStreamBySsrc(StreamParamsVec* streams, uint32_t ssrc) { |
tommi@webrtc.org | 586f2ed | 2015-01-22 23:00:41 +0000 | [diff] [blame] | 316 | return RemoveStream(streams, |
| 317 | [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); }); |
| 318 | } |
| 319 | inline bool RemoveStreamByIds(StreamParamsVec* streams, |
| 320 | const std::string& groupid, |
| 321 | const std::string& id) { |
| 322 | return RemoveStream(streams, |
| 323 | [&groupid, &id](const StreamParams& sp) { |
| 324 | return sp.groupid == groupid && sp.id == id; |
| 325 | }); |
| 326 | } |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 327 | |
sergeyu@chromium.org | 5bc25c4 | 2013-12-05 00:24:06 +0000 | [diff] [blame] | 328 | // Checks if |sp| defines parameters for a single primary stream. There may |
brandtr | 9688e38 | 2016-11-22 00:59:48 -0800 | [diff] [blame] | 329 | // be an RTX stream or a FlexFEC stream (or both) associated with the primary |
| 330 | // stream. Leaving as non-static so we can test this function. |
sergeyu@chromium.org | 5bc25c4 | 2013-12-05 00:24:06 +0000 | [diff] [blame] | 331 | bool IsOneSsrcStream(const StreamParams& sp); |
| 332 | |
| 333 | // Checks if |sp| defines parameters for one Simulcast stream. There may be RTX |
| 334 | // streams associated with the simulcast streams. Leaving as non-static so we |
| 335 | // can test this function. |
| 336 | bool IsSimulcastStream(const StreamParams& sp); |
| 337 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 338 | } // namespace cricket |
| 339 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 340 | #endif // MEDIA_BASE_STREAMPARAMS_H_ |