|
@@ -45,12 +45,13 @@ inline void trim_end(string &str) {
|
|
namespace rtc {
|
|
namespace rtc {
|
|
|
|
|
|
Description::Description(const string &sdp, const string &typeString)
|
|
Description::Description(const string &sdp, const string &typeString)
|
|
- : Description(sdp, stringToType(typeString), Description::Role::ActPass) {}
|
|
|
|
|
|
+ : Description(sdp, stringToType(typeString)) {}
|
|
|
|
+
|
|
|
|
+Description::Description(const string &sdp, Type type) : Description(sdp, type, Role::ActPass) {}
|
|
|
|
|
|
Description::Description(const string &sdp, Type type, Role role)
|
|
Description::Description(const string &sdp, Type type, Role role)
|
|
- : mType(type), mRole(role), mMid("0"), mIceUfrag("0"), mIcePwd("0"), mTrickle(true) {
|
|
|
|
- if (mType == Type::Answer && mRole == Role::ActPass)
|
|
|
|
- mRole = Role::Passive; // ActPass is illegal for an answer, so default to passive
|
|
|
|
|
|
+ : mType(Type::Unspec), mRole(role), mMid("0"), mIceUfrag(""), mIcePwd(""), mTrickle(true) {
|
|
|
|
+ hintType(type);
|
|
|
|
|
|
auto seed = std::chrono::system_clock::now().time_since_epoch().count();
|
|
auto seed = std::chrono::system_clock::now().time_since_epoch().count();
|
|
std::default_random_engine generator(seed);
|
|
std::default_random_engine generator(seed);
|
|
@@ -109,6 +110,14 @@ std::optional<size_t> Description::maxMessageSize() const { return mMaxMessageSi
|
|
|
|
|
|
bool Description::trickleEnabled() const { return mTrickle; }
|
|
bool Description::trickleEnabled() const { return mTrickle; }
|
|
|
|
|
|
|
|
+void Description::hintType(Type type) {
|
|
|
|
+ if (mType == Type::Unspec) {
|
|
|
|
+ mType = type;
|
|
|
|
+ if (mType == Type::Answer && mRole == Role::ActPass)
|
|
|
|
+ mRole = Role::Passive; // ActPass is illegal for an answer, so default to passive
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void Description::setFingerprint(string fingerprint) {
|
|
void Description::setFingerprint(string fingerprint) {
|
|
mFingerprint.emplace(std::move(fingerprint));
|
|
mFingerprint.emplace(std::move(fingerprint));
|
|
}
|
|
}
|