Skip to content

Commit

Permalink
Merge pull request mozilla#31 from adamroach/multistream
Browse files Browse the repository at this point in the history
Making some attributes into lists
  • Loading branch information
martinthomson committed Sep 18, 2014
2 parents 4f2ae26 + 1fbcd10 commit 1cb3028
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 28 deletions.
28 changes: 14 additions & 14 deletions media/webrtc/signaling/src/sdp/SdpAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ class SdpAttribute
// [SP rel-port]
// *(SP extension-att-name SP
// extension-att-value)
class SdpCandidateAttribute : public SdpAttribute
class SdpCandidateAttributeList : public SdpAttribute
{
public:
SdpCandidateAttribute() :
SdpCandidateAttributeList() :
SdpAttribute(kCandidateAttribute, "candidate") {}
};

Expand Down Expand Up @@ -130,10 +130,10 @@ class SdpConnectionAttribute : public SdpAttribute
// SP = <Defined in RFC 5234>
//
// DIGIT = <Defined in RFC 5234>
class SdpExtmapAttribute : public SdpAttribute
class SdpExtmapAttributeList : public SdpAttribute
{
public:
SdpExtmapAttribute() :
SdpExtmapAttributeList() :
SdpAttribute(kExtmapAttribute, "extmap") {}
};

Expand Down Expand Up @@ -161,10 +161,10 @@ class SdpFingerprintAttribute : public SdpAttribute

// RFC4566, RFC5576
// a=fmtp:<format> <format specific parameters>
class SdpFmtpAttribute : public SdpAttribute
class SdpFmtpAttributeList : public SdpAttribute
{
public:
SdpFmtpAttribute() :
SdpFmtpAttributeList() :
SdpAttribute(kFmtpAttribute, "fmtp") {}
};

Expand Down Expand Up @@ -274,10 +274,10 @@ class SdpIdentityAttribute : public SdpAttribute
// qvalue = ( "0" "." 1*2DIGIT )
// / ( "1" "." 1*2("0") )
// ; Values between 0.00 and 1.00
class SdpImageattrAttribute : public SdpAttribute
class SdpImageattrAttributeList : public SdpAttribute
{
public:
SdpImageattrAttribute() :
SdpImageattrAttributeList() :
SdpAttribute(kImageattrAttribute, "imageattr") {}
};

Expand Down Expand Up @@ -341,19 +341,19 @@ class SdpRtcpAttribute : public SdpAttribute
// / SP "app" [SP byte-string]
// / SP token [SP byte-string]
// / ; empty
class SdpRtcpFbAttribute : public SdpAttribute
class SdpRtcpFbAttributeList : public SdpAttribute
{
public:
SdpRtcpFbAttribute() :
SdpRtcpFbAttributeList() :
SdpAttribute(kRtcpFbAttribute, "rtcp-fb") {}
};

// RFC4566
// a=rtpmap:<payload type> <encoding name>/<clock rate> [/<encoding parameters>]
class SdpRtpmapAttribute : public SdpAttribute
class SdpRtpmapAttributeList : public SdpAttribute
{
public:
SdpRtpmapAttribute() :
SdpRtpmapAttributeList() :
SdpAttribute(kRtpmapAttribute, "rtpmap") {}
};

Expand All @@ -366,10 +366,10 @@ class SdpRtpmapAttribute : public SdpAttribute
// streams = "streams" EQUALS 1*DIGIT"
// (draft-07 appears to have done something really funky here, but I
// don't beleive it).
class SdpSctpmapAttribute : public SdpAttribute
class SdpSctpmapAttributeList : public SdpAttribute
{
public:
SdpSctpmapAttribute() :
SdpSctpmapAttributeList() :
SdpAttribute(kSctpmapAttribute, "sctpmap") {}
};

Expand Down
35 changes: 21 additions & 14 deletions media/webrtc/signaling/src/sdp/SdpAttributeList.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,39 @@ class SdpAttributeList
virtual bool HasAttribute(AttributeType type) const = 0;
virtual const SdpAttribute& GetAttribute(AttributeType type, size_t index = 0) const = 0;

virtual const SdpCandidateAttribute& GetCandidate() const = 0;
virtual const SdpConnectionAttribute& GetConnection() const = 0;
virtual const SdpExtmapAttribute& GetExtmap() const = 0;
virtual const SdpFingerprintAttribute& GetFingerprint() const = 0;
virtual const SdpFmtpAttribute& GetFmtp() const = 0;
virtual const SdpGroupAttribute& GetGroup() const = 0;
virtual const SdpIceOptionsAttribute& GetIceOptions() const = 0;
virtual const std::string& GetIcePwd() const = 0;
virtual const std::string& GetIceUfrag() const = 0;
virtual const SdpIdentityAttribute& GetIdentity() const = 0;
virtual const SdpImageattrAttribute& GetImageattr() const = 0;
virtual const std::string& GetLabel() const = 0;
virtual uint32_t GetMaxprate() const = 0;
virtual uint32_t GetMaxptime() const = 0;
virtual const std::string& GetMid() const = 0;
virtual const SdpMsidAttribute& GetMsid() const = 0;
virtual uint32_t GetPtime() const = 0;
virtual const SdpRtcpAttribute& GetRtcp() const = 0;
virtual const SdpRtcpFbAttribute& GetRtcpFb() const = 0;
virtual const SdpRemoteCandidatesAttribute& GetRemoteCandidates() const = 0;
virtual const SdpRtpmapAttribute& GetRtpmap() const = 0;
virtual const SdpSctpmapAttribute& GetSctpmap() const = 0;
virtual const SdpSetupAttribute& GetSetup() const = 0;
virtual const SdpSsrcAttribute& GetSsrc() const = 0;
virtual const SdpSsrcGroupAttribute& GetSsrcGroup() const = 0;

// These attributes can appear multiple times, so the returned
// classes actually represent a collection of values.
virtual const SdpCandidateAttributeList& GetCandidate() const = 0;
virtual const SdpExtmapAttributeList& GetExtmap() const = 0;
virtual const SdpFmtpAttributeList& GetFmtp() const = 0;
virtual const SdpImageattrAttributeList& GetImageattr() const = 0;
virtual const SdpRtcpFbAttributeList& GetRtcpFb() const = 0;
virtual const SdpRtpmapAttributeList& GetRtpmap() const = 0;
virtual const SdpSctpmapAttributeList& GetSctpmap() const = 0;

// These attributes are effectively simple types, so we'll make life
// easy by just returning their value.
virtual const std::string& GetIcePwd() const = 0;
virtual const std::string& GetIceUfrag() const = 0;
virtual const std::string& GetLabel() const = 0;
virtual unsigned int GetMaxprate() const = 0;
virtual unsigned int GetMaxptime() const = 0;
virtual const std::string& GetMid() const = 0;
virtual unsigned int GetPtime() const = 0;

// The setter takes an attribute of any type, and Does The Right Thing™
virtual void SetAttribute(const SdpAttribute &) = 0;
};

Expand Down

0 comments on commit 1cb3028

Please sign in to comment.