Skip to content

Commit

Permalink
Merge pull request mozilla#23 from martinthomson/sdp_stub
Browse files Browse the repository at this point in the history
As below
  • Loading branch information
ekr committed Sep 18, 2014
2 parents bbfc255 + e0eb5c8 commit 7d4ffe1
Show file tree
Hide file tree
Showing 11 changed files with 233 additions and 226 deletions.
7 changes: 4 additions & 3 deletions media/webrtc/signaling/src/sdp/Sdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ class Sdp
public:
Sdp();

virtual SdpOrigin GetOrigin() const = 0;
virtual std::string GetSessionName() const = 0;
virtual const SdpOrigin& GetOrigin() const = 0;
virtual const std::string& GetSessionName() const = 0;
// Note: connection information is always retrieved from media sections
virtual Maybe<std::string> GetBandwidth(const std::string& type) const = 0;
virtual const Maybe<std::string>&
GetBandwidth(const std::string& type) const = 0;

virtual const SdpAttributeList &GetAttributeList() const = 0;
virtual SdpAttributeList &GetAttributeList() = 0;
Expand Down
83 changes: 61 additions & 22 deletions media/webrtc/signaling/src/sdp/SdpAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,49 @@ namespace mozilla {
class SdpAttribute
{
public:
SdpAttribute(sdp::AttributeType type, std::string typeName) :
enum AttributeType {
kBundleOnlyAttribute,
kCandidateAttribute,
kConnectionAttribute,
kDtlsFingerprintAttribute,
kExtmapAttribute,
kFingerprintAttribute,
kFmtpAttribute,
kGroupAttribute,
kIceLiteAttribute,
kIceMismatchAttribute,
kIceOptionsAttribute,
kIcePwdAttribute,
kIceUfragAttribute,
kIdentityAttribute,
kImageattrAttribute,
kInactiveAttribute,
kLabelAttribute,
kMaxprateAttribute,
kMaxptimeAttribute,
kMidAttribute,
kMsidAttribute,
kPtimeAttribute,
kRecvonlyAttribute,
kRemoteCandidatesAttribute,
kRtcpAttribute,
kRtcpFbAttribute,
kRtcpMuxAttribute,
kRtcpRsizeAttribute,
kRtpmapAttribute,
kSctpmapAttribute,
kSendonlyAttribute,
kSendrecvAttribute,
kSetupAttribute,
kSsrcAttribute,
kSsrcGroupAttribute,
kOtherAttribute
};

SdpAttribute(AttributeType type, std::string typeName) :
mType(type), mTypeName(typeName) {}

virtual sdp::AttributeType GetType()
virtual AttributeType GetType()
{
return mType;
}
Expand All @@ -34,7 +73,7 @@ class SdpAttribute
virtual ~SdpAttribute() {}

private:
sdp::AttributeType mType;
AttributeType mType;
std::string mTypeName;
};

Expand All @@ -54,7 +93,7 @@ class SdpCandidateAttribute : public SdpAttribute
{
public:
SdpCandidateAttribute() :
SdpAttribute(sdp::kCandidateAttribute, "candidate") {}
SdpAttribute(kCandidateAttribute, "candidate") {}
};

// RFC4145
Expand All @@ -69,7 +108,7 @@ class SdpConnectionAttribute : public SdpAttribute
};

SdpConnectionAttribute(SdpConnectionAttribute::ConnValue value) :
SdpAttribute(sdp::kConnectionAttribute, "connection"),
SdpAttribute(kConnectionAttribute, "connection"),
mValue(value) {}

enum ConnValue mValue;
Expand Down Expand Up @@ -97,7 +136,7 @@ class SdpExtmapAttribute : public SdpAttribute
{
public:
SdpExtmapAttribute() :
SdpAttribute(sdp::kExtmapAttribute, "extmap") {}
SdpAttribute(kExtmapAttribute, "extmap") {}
};


Expand All @@ -119,7 +158,7 @@ class SdpFingerprintAttribute : public SdpAttribute
{
public:
SdpFingerprintAttribute() :
SdpAttribute(sdp::kFingerprintAttribute, "fingerprint") {}
SdpAttribute(kFingerprintAttribute, "fingerprint") {}
};

// RFC4566, RFC5576
Expand All @@ -128,7 +167,7 @@ class SdpFmtpAttribute : public SdpAttribute
{
public:
SdpFmtpAttribute() :
SdpAttribute(sdp::kFmtpAttribute, "fmtp") {}
SdpAttribute(kFmtpAttribute, "fmtp") {}
};

// RFC5888
Expand All @@ -140,7 +179,7 @@ class SdpGroupAttribute : public SdpAttribute
{
public:
SdpGroupAttribute() :
SdpAttribute(sdp::kGroupAttribute, "group") {}
SdpAttribute(kGroupAttribute, "group") {}
};

// RFC5245
Expand All @@ -151,7 +190,7 @@ class SdpIceOptionsAttribute : public SdpAttribute
{
public:
SdpIceOptionsAttribute() :
SdpAttribute(sdp::kIceOptionsAttribute, "ice-options") {}
SdpAttribute(kIceOptionsAttribute, "ice-options") {}
};

// draft-ietf-rtcweb-security-arch
Expand All @@ -168,7 +207,7 @@ class SdpIdentityAttribute : public SdpAttribute
{
public:
SdpIdentityAttribute() :
SdpAttribute(sdp::kIdentityAttribute, "identity") {}
SdpAttribute(kIdentityAttribute, "identity") {}
};

// RFC6236
Expand Down Expand Up @@ -241,7 +280,7 @@ class SdpImageattrAttribute : public SdpAttribute
{
public:
SdpImageattrAttribute() :
SdpAttribute(sdp::kImageattrAttribute, "imageattr") {}
SdpAttribute(kImageattrAttribute, "imageattr") {}
};

// draft-ietf-mmusic-msid
Expand All @@ -252,7 +291,7 @@ class SdpMsidAttribute : public SdpAttribute
{
public:
SdpMsidAttribute() :
SdpAttribute(sdp::kMsidAttribute, "msid") {}
SdpAttribute(kMsidAttribute, "msid") {}
};

// RFC5245
Expand All @@ -263,7 +302,7 @@ class SdpRemoteCandidatesAttribute : public SdpAttribute
{
public:
SdpRemoteCandidatesAttribute() :
SdpAttribute(sdp::kRemoteCandidatesAttribute, "remote-candidates") {}
SdpAttribute(kRemoteCandidatesAttribute, "remote-candidates") {}
};

// RFC3605
Expand All @@ -273,7 +312,7 @@ class SdpRtcpAttribute : public SdpAttribute
{
public:
SdpRtcpAttribute() :
SdpAttribute(sdp::kRtcpAttribute, "rtcp") {}
SdpAttribute(kRtcpAttribute, "rtcp") {}
};

// RFC4585
Expand Down Expand Up @@ -308,7 +347,7 @@ class SdpRtcpFbAttribute : public SdpAttribute
{
public:
SdpRtcpFbAttribute() :
SdpAttribute(sdp::kRtcpFbAttribute, "rtcp-fb") {}
SdpAttribute(kRtcpFbAttribute, "rtcp-fb") {}
};

// RFC4566
Expand All @@ -317,7 +356,7 @@ class SdpRtpmapAttribute : public SdpAttribute
{
public:
SdpRtpmapAttribute() :
SdpAttribute(sdp::kRtpmapAttribute, "rtpmap") {}
SdpAttribute(kRtpmapAttribute, "rtpmap") {}
};

// draft-ietf-mmusic-sctp-sdp-06
Expand All @@ -333,7 +372,7 @@ class SdpSctpmapAttribute : public SdpAttribute
{
public:
SdpSctpmapAttribute() :
SdpAttribute(sdp::kSctpmapAttribute, "sctpmap") {}
SdpAttribute(kSctpmapAttribute, "sctpmap") {}
};

// RFC4145
Expand All @@ -343,7 +382,7 @@ class SdpSetupAttribute : public SdpAttribute
{
public:
SdpSetupAttribute() :
SdpAttribute(sdp::kSetupAttribute, "setup") {}
SdpAttribute(kSetupAttribute, "setup") {}
};

// RFC5576
Expand All @@ -356,7 +395,7 @@ class SdpSsrcAttribute : public SdpAttribute
{
public:
SdpSsrcAttribute() :
SdpAttribute(sdp::kSsrcAttribute, "ssrc") {}
SdpAttribute(kSsrcAttribute, "ssrc") {}
};

// RFC5576
Expand All @@ -369,15 +408,15 @@ class SdpSsrcGroupAttribute : public SdpAttribute
{
public:
SdpSsrcGroupAttribute() :
SdpAttribute(sdp::kSsrcGroupAttribute, "ssrc-group") {}
SdpAttribute(kSsrcGroupAttribute, "ssrc-group") {}
};

// Used for any other kind of attribute not otherwise specialized
class SdpOtherAttribute : public SdpAttribute
{
public:
SdpOtherAttribute(std::string typeName, std::string value = "") :
SdpAttribute(sdp::kOtherAttribute, typeName),
SdpAttribute(kOtherAttribute, typeName),
mValue(value) {}

std::string const getValue()
Expand Down
40 changes: 20 additions & 20 deletions media/webrtc/signaling/src/sdp/SdpAttributeList.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@ class SdpAttributeList
virtual UniquePtr<SdpAttribute>
GetAttribute(sdp::AttributeType type) const = 0;

virtual UniquePtr<SdpCandidateAttribute> GetCandidate() const = 0;
virtual UniquePtr<SdpConnectionAttribute> GetConnection() const = 0;
virtual UniquePtr<SdpExtmapAttribute> GetExtmap() const = 0;
virtual UniquePtr<SdpFingerprintAttribute> GetFingerprint() const = 0;
virtual UniquePtr<SdpFmtpAttribute> GetFmtp() const = 0;
virtual UniquePtr<SdpGroupAttribute> GetGroup() const = 0;
virtual UniquePtr<SdpIceOptionsAttribute> GetIceOptions() const = 0;
virtual std::string GetIcePwd() const = 0;
virtual std::string GetIceUfrag() const = 0;
virtual UniquePtr<SdpIdentityAttribute> GetIdentity() const = 0;
virtual UniquePtr<SdpImageattrAttribute> GetImageattr() 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 std::string GetLabel() const = 0;
virtual unsigned int GetMaxprate() const = 0;
virtual unsigned int GetMaxptime() const = 0;
virtual std::string GetMid() const = 0;
virtual UniquePtr<SdpMsidAttribute> GetMsid() const = 0;
virtual const SdpMsidAttribute& GetMsid() const = 0;
virtual unsigned int GetPtime() const = 0;
virtual UniquePtr<SdpRtcpAttribute> GetRtcp() const = 0;
virtual UniquePtr<SdpRtcpFbAttribute> GetRtcpFb() const = 0;
// virtual UniquePtr<SdpRtcpRemoteCandidates> GetRemoteCandidates() const = 0;
virtual UniquePtr<SdpRtpmapAttribute> GetRtpmap() const = 0;
virtual UniquePtr<SdpSctpmapAttribute> GetSctpmap() const = 0;
virtual UniquePtr<SdpSetupAttribute> GetSetup() const = 0;
virtual UniquePtr<SdpSsrcAttribute> GetSsrc() const = 0;
virtual UniquePtr<SdpSsrcGroupAttribute> GetSsrcGroup() const = 0;
virtual const SdpRtcpAttribute& GetRtcp() const = 0;
virtual const SdpRtcpFbAttribute& GetRtcpFb() const = 0;
virtual const SdpRtcpRemoteCandidates& 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;

virtual void SetAttribute(const SdpAttribute &) = 0;
};
Expand Down
86 changes: 0 additions & 86 deletions media/webrtc/signaling/src/sdp/SdpEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,92 +19,6 @@ enum AddrType {
kIPv6
};

enum MediaType {
kAudio,
kVideo,
kText,
kApplication,
kMessage,
kUnknownMediaType
};

enum Protocol {
kRtpAvp, // RTP/AVP [RFC4566]
kUdp, // udp [RFC4566]
kVat, // vat [historic]
kRtp, // rtp [historic]
kUdptl, // udptl [ITU-T]
kTcp, // TCP [RFC4145]
kRtpAvpf, // RTP/AVPF [RFC4585]
kTcpRtpAvp, // TCP/RTP/AVP [RFC4571]
kRtpSavp, // RTP/SAVP [RFC3711]
kTcpBfcp, // TCP/BFCP [RFC4583]
kTcpTlsBfcp, // TCP/TLS/BFCP [RFC4583]
kTcpTls, // TCP/TLS [RFC4572]
kFluteUdp, // FLUTE/UDP [RFC-mehta-rmt-flute-sdp-05]
kTcpMsrp, // TCP/MSRP [RFC4975]
kTcpTlsMsrp, // TCP/TLS/MSRP [RFC4975]
kDccp, // DCCP [RFC5762]
kDccpRtpAvp, // DCCP/RTP/AVP [RFC5762]
kDccpRtpSavp, // DCCP/RTP/SAVP [RFC5762]
kDccpRtpAvpf, // DCCP/RTP/AVPF [RFC5762]
kDccpRtpSavpf, // DCCP/RTP/SAVPF [RFC5762]
kRtpSavpf, // RTP/SAVPF [RFC5124]
kUdpTlsRtpSavp, // UDP/TLS/RTP/SAVP [RFC5764]
kDccpTlsRtpSavp, // DCCP/TLS/RTP/SAVP [RFC5764]
kUdpTlsRtpSavpf, // UDP/TLS/RTP/SAVPF [RFC5764]
kDccpTlsRtpSavpf, // DCCP/TLS/RTP/SAVPF [RFC5764]
kUdpMbmsFecRtpAvp, // UDP/MBMS-FEC/RTP/AVP [RFC6064]
kUdpMbmsFecRtpSavp, // UDP/MBMS-FEC/RTP/SAVP [RFC6064]
kUdpMbmsRepair, // UDP/MBMS-REPAIR [RFC6064]
kFecUdp, // FEC/UDP [RFC6364]
kUdpFec, // UDP/FEC [RFC6364]
kTcpMrcpv2, // TCP/MRCPv2 [RFC6787]
kTcpTlsMrcpv2, // TCP/TLS/MRCPv2 [RFC6787]
kPstn, // PSTN [RFC7195]
kUdpTlsUdptl, // UDP/TLS/UDPTL [RFC7345]
kUnknownProtocol
};

enum AttributeType {
kBundleOnlyAttribute,
kCandidateAttribute,
kConnectionAttribute,
kDtlsFingerprintAttribute,
kExtmapAttribute,
kFingerprintAttribute,
kFmtpAttribute,
kGroupAttribute,
kIceLiteAttribute,
kIceMismatchAttribute,
kIceOptionsAttribute,
kIcePwdAttribute,
kIceUfragAttribute,
kIdentityAttribute,
kImageattrAttribute,
kInactiveAttribute,
kLabelAttribute,
kMaxprateAttribute,
kMaxptimeAttribute,
kMidAttribute,
kMsidAttribute,
kPtimeAttribute,
kRecvonlyAttribute,
kRemoteCandidatesAttribute,
kRtcpAttribute,
kRtcpFbAttribute,
kRtcpMuxAttribute,
kRtcpRsizeAttribute,
kRtpmapAttribute,
kSctpmapAttribute,
kSendonlyAttribute,
kSendrecvAttribute,
kSetupAttribute,
kSsrcAttribute,
kSsrcGroupAttribute,
kOtherAttribute
};

}
}

Expand Down
Loading

0 comments on commit 7d4ffe1

Please sign in to comment.