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

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

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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 | « talk/media/base/rtputils_unittest.cc ('k') | talk/media/base/streamparams.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/base/streamparams.h
diff --git a/talk/media/base/streamparams.h b/talk/media/base/streamparams.h
index 3c683db385e25b1b7df4b0d409f61f7aac16d9e5..d082bee95a1be2cb185953c89af7dcfa4cd80fa3 100644
--- a/talk/media/base/streamparams.h
+++ b/talk/media/base/streamparams.h
@@ -58,9 +58,8 @@ extern const char kFidSsrcGroupSemantics[];
extern const char kSimSsrcGroupSemantics[];
struct SsrcGroup {
- SsrcGroup(const std::string& usage, const std::vector<uint32>& ssrcs)
- : semantics(usage), ssrcs(ssrcs) {
- }
+ SsrcGroup(const std::string& usage, const std::vector<uint32_t>& ssrcs)
+ : semantics(usage), ssrcs(ssrcs) {}
bool operator==(const SsrcGroup& other) const {
return (semantics == other.semantics && ssrcs == other.ssrcs);
@@ -74,11 +73,11 @@ struct SsrcGroup {
std::string ToString() const;
std::string semantics; // e.g FIX, FEC, SIM.
- std::vector<uint32> ssrcs; // SSRCs of this type.
+ std::vector<uint32_t> ssrcs; // SSRCs of this type.
};
struct StreamParams {
- static StreamParams CreateLegacy(uint32 ssrc) {
+ static StreamParams CreateLegacy(uint32_t ssrc) {
StreamParams stream;
stream.ssrcs.push_back(ssrc);
return stream;
@@ -98,7 +97,7 @@ struct StreamParams {
return !(*this == other);
}
- uint32 first_ssrc() const {
+ uint32_t first_ssrc() const {
if (ssrcs.empty()) {
return 0;
}
@@ -108,12 +107,10 @@ struct StreamParams {
bool has_ssrcs() const {
return !ssrcs.empty();
}
- bool has_ssrc(uint32 ssrc) const {
+ bool has_ssrc(uint32_t ssrc) const {
return std::find(ssrcs.begin(), ssrcs.end(), ssrc) != ssrcs.end();
}
- void add_ssrc(uint32 ssrc) {
- ssrcs.push_back(ssrc);
- }
+ void add_ssrc(uint32_t ssrc) { ssrcs.push_back(ssrc); }
bool has_ssrc_groups() const {
return !ssrc_groups.empty();
}
@@ -132,25 +129,25 @@ struct StreamParams {
// Convenience function to add an FID ssrc for a primary_ssrc
// that's already been added.
- inline bool AddFidSsrc(uint32 primary_ssrc, uint32 fid_ssrc) {
+ inline bool AddFidSsrc(uint32_t primary_ssrc, uint32_t fid_ssrc) {
return AddSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc);
}
// Convenience function to lookup the FID ssrc for a primary_ssrc.
// Returns false if primary_ssrc not found or FID not defined for it.
- inline bool GetFidSsrc(uint32 primary_ssrc, uint32* fid_ssrc) const {
+ inline bool GetFidSsrc(uint32_t primary_ssrc, uint32_t* fid_ssrc) const {
return GetSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc);
}
// Convenience to get all the SIM SSRCs if there are SIM ssrcs, or
// the first SSRC otherwise.
- void GetPrimarySsrcs(std::vector<uint32>* ssrcs) const;
+ void GetPrimarySsrcs(std::vector<uint32_t>* ssrcs) const;
// Convenience to get all the FID SSRCs for the given primary ssrcs.
// If a given primary SSRC does not have a FID SSRC, the list of FID
// SSRCS will be smaller than the list of primary SSRCs.
- void GetFidSsrcs(const std::vector<uint32>& primary_ssrcs,
- std::vector<uint32>* fid_ssrcs) const;
+ void GetFidSsrcs(const std::vector<uint32_t>& primary_ssrcs,
+ std::vector<uint32_t>* fid_ssrcs) const;
std::string ToString() const;
@@ -160,7 +157,7 @@ struct StreamParams {
std::string groupid;
// Unique per-groupid, not across all groupids
std::string id;
- std::vector<uint32> ssrcs; // All SSRCs for this source
+ std::vector<uint32_t> ssrcs; // All SSRCs for this source
std::vector<SsrcGroup> ssrc_groups; // e.g. FID, FEC, SIM
// Examples: "camera", "screencast"
std::string type;
@@ -170,17 +167,17 @@ struct StreamParams {
std::string sync_label; // Friendly name of cname.
private:
- bool AddSecondarySsrc(const std::string& semantics, uint32 primary_ssrc,
- uint32 secondary_ssrc);
- bool GetSecondarySsrc(const std::string& semantics, uint32 primary_ssrc,
- uint32* secondary_ssrc) const;
+ bool AddSecondarySsrc(const std::string& semantics,
+ uint32_t primary_ssrc,
+ uint32_t secondary_ssrc);
+ bool GetSecondarySsrc(const std::string& semantics,
+ uint32_t primary_ssrc,
+ uint32_t* secondary_ssrc) const;
};
// A Stream can be selected by either groupid+id or ssrc.
struct StreamSelector {
- explicit StreamSelector(uint32 ssrc) :
- ssrc(ssrc) {
- }
+ explicit StreamSelector(uint32_t ssrc) : ssrc(ssrc) {}
StreamSelector(const std::string& groupid,
const std::string& streamid) :
@@ -197,7 +194,7 @@ struct StreamSelector {
}
}
- uint32 ssrc;
+ uint32_t ssrc;
std::string groupid;
std::string streamid;
};
@@ -284,7 +281,7 @@ const StreamParams* GetStream(const StreamParamsVec& streams,
}
inline const StreamParams* GetStreamBySsrc(const StreamParamsVec& streams,
- uint32 ssrc) {
+ uint32_t ssrc) {
return GetStream(streams,
[&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); });
}
@@ -320,7 +317,7 @@ inline bool RemoveStream(StreamParamsVec* streams,
return RemoveStream(streams,
[&selector](const StreamParams& sp) { return selector.Matches(sp); });
}
-inline bool RemoveStreamBySsrc(StreamParamsVec* streams, uint32 ssrc) {
+inline bool RemoveStreamBySsrc(StreamParamsVec* streams, uint32_t ssrc) {
return RemoveStream(streams,
[&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); });
}
« no previous file with comments | « talk/media/base/rtputils_unittest.cc ('k') | talk/media/base/streamparams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698