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

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

Issue 2503403004: Add support for FEC-FR semantics in StreamParams. (Closed)
Patch Set: No inline inside class declaration. Created 4 years 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/media/base/streamparams.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 (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 19 matching lines...) Expand all
30 #include <set> 30 #include <set>
31 #include <string> 31 #include <string>
32 #include <vector> 32 #include <vector>
33 33
34 #include "webrtc/base/basictypes.h" 34 #include "webrtc/base/basictypes.h"
35 #include "webrtc/base/constructormagic.h" 35 #include "webrtc/base/constructormagic.h"
36 36
37 namespace cricket { 37 namespace cricket {
38 38
39 extern const char kFecSsrcGroupSemantics[]; 39 extern const char kFecSsrcGroupSemantics[];
40 extern const char kFecFrSsrcGroupSemantics[];
40 extern const char kFidSsrcGroupSemantics[]; 41 extern const char kFidSsrcGroupSemantics[];
41 extern const char kSimSsrcGroupSemantics[]; 42 extern const char kSimSsrcGroupSemantics[];
42 43
43 struct SsrcGroup { 44 struct SsrcGroup {
44 SsrcGroup(const std::string& usage, const std::vector<uint32_t>& ssrcs) 45 SsrcGroup(const std::string& usage, const std::vector<uint32_t>& ssrcs)
45 : semantics(usage), ssrcs(ssrcs) {} 46 : semantics(usage), ssrcs(ssrcs) {}
46 47
47 bool operator==(const SsrcGroup& other) const { 48 bool operator==(const SsrcGroup& other) const {
48 return (semantics == other.semantics && ssrcs == other.ssrcs); 49 return (semantics == other.semantics && ssrcs == other.ssrcs);
49 } 50 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 it != ssrc_groups.end(); ++it) { 106 it != ssrc_groups.end(); ++it) {
106 if (it->has_semantics(semantics)) { 107 if (it->has_semantics(semantics)) {
107 return &(*it); 108 return &(*it);
108 } 109 }
109 } 110 }
110 return NULL; 111 return NULL;
111 } 112 }
112 113
113 // Convenience function to add an FID ssrc for a primary_ssrc 114 // Convenience function to add an FID ssrc for a primary_ssrc
114 // that's already been added. 115 // that's already been added.
115 inline bool AddFidSsrc(uint32_t primary_ssrc, uint32_t fid_ssrc) { 116 bool AddFidSsrc(uint32_t primary_ssrc, uint32_t fid_ssrc) {
116 return AddSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc); 117 return AddSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc);
117 } 118 }
118 119
119 // Convenience function to lookup the FID ssrc for a primary_ssrc. 120 // Convenience function to lookup the FID ssrc for a primary_ssrc.
120 // Returns false if primary_ssrc not found or FID not defined for it. 121 // Returns false if primary_ssrc not found or FID not defined for it.
121 inline bool GetFidSsrc(uint32_t primary_ssrc, uint32_t* fid_ssrc) const { 122 bool GetFidSsrc(uint32_t primary_ssrc, uint32_t* fid_ssrc) const {
122 return GetSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc); 123 return GetSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc);
123 } 124 }
124 125
126 // Convenience function to add an FEC-FR ssrc for a primary_ssrc
127 // that's already been added.
128 bool AddFecFrSsrc(uint32_t primary_ssrc, uint32_t fecfr_ssrc) {
129 return AddSecondarySsrc(kFecFrSsrcGroupSemantics, primary_ssrc, fecfr_ssrc);
130 }
131
132 // Convenience function to lookup the FEC-FR ssrc for a primary_ssrc.
133 // Returns false if primary_ssrc not found or FEC-FR not defined for it.
134 bool GetFecFrSsrc(uint32_t primary_ssrc, uint32_t* fecfr_ssrc) const {
135 return GetSecondarySsrc(kFecFrSsrcGroupSemantics, primary_ssrc, fecfr_ssrc);
136 }
137
125 // Convenience to get all the SIM SSRCs if there are SIM ssrcs, or 138 // Convenience to get all the SIM SSRCs if there are SIM ssrcs, or
126 // the first SSRC otherwise. 139 // the first SSRC otherwise.
127 void GetPrimarySsrcs(std::vector<uint32_t>* ssrcs) const; 140 void GetPrimarySsrcs(std::vector<uint32_t>* ssrcs) const;
128 141
129 // Convenience to get all the FID SSRCs for the given primary ssrcs. 142 // Convenience to get all the FID SSRCs for the given primary ssrcs.
130 // If a given primary SSRC does not have a FID SSRC, the list of FID 143 // If a given primary SSRC does not have a FID SSRC, the list of FID
131 // SSRCS will be smaller than the list of primary SSRCs. 144 // SSRCS will be smaller than the list of primary SSRCs.
132 void GetFidSsrcs(const std::vector<uint32_t>& primary_ssrcs, 145 void GetFidSsrcs(const std::vector<uint32_t>& primary_ssrcs,
133 std::vector<uint32_t>* fid_ssrcs) const; 146 std::vector<uint32_t>* fid_ssrcs) const;
134 147
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 inline bool RemoveStreamByIds(StreamParamsVec* streams, 295 inline bool RemoveStreamByIds(StreamParamsVec* streams,
283 const std::string& groupid, 296 const std::string& groupid,
284 const std::string& id) { 297 const std::string& id) {
285 return RemoveStream(streams, 298 return RemoveStream(streams,
286 [&groupid, &id](const StreamParams& sp) { 299 [&groupid, &id](const StreamParams& sp) {
287 return sp.groupid == groupid && sp.id == id; 300 return sp.groupid == groupid && sp.id == id;
288 }); 301 });
289 } 302 }
290 303
291 // Checks if |sp| defines parameters for a single primary stream. There may 304 // Checks if |sp| defines parameters for a single primary stream. There may
292 // be an RTX stream associated with the primary stream. Leaving as non-static so 305 // be an RTX stream or a FlexFEC stream (or both) associated with the primary
293 // we can test this function. 306 // stream. Leaving as non-static so we can test this function.
294 bool IsOneSsrcStream(const StreamParams& sp); 307 bool IsOneSsrcStream(const StreamParams& sp);
295 308
296 // Checks if |sp| defines parameters for one Simulcast stream. There may be RTX 309 // Checks if |sp| defines parameters for one Simulcast stream. There may be RTX
297 // streams associated with the simulcast streams. Leaving as non-static so we 310 // streams associated with the simulcast streams. Leaving as non-static so we
298 // can test this function. 311 // can test this function.
299 bool IsSimulcastStream(const StreamParams& sp); 312 bool IsSimulcastStream(const StreamParams& sp);
300 313
301 } // namespace cricket 314 } // namespace cricket
302 315
303 #endif // WEBRTC_MEDIA_BASE_STREAMPARAMS_H_ 316 #endif // WEBRTC_MEDIA_BASE_STREAMPARAMS_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/base/streamparams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698