mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Move sessiondescription.h/cc from p2p/base to pc/
SDP is a detail of PeerConnection and is not used by anything in p2p, so it belongs in the pc/ directory. This also allows MediaContentDescription to be inlined in the future. Bug: webrtc:8620 Change-Id: I38b65ede9942e29eb15035ab29f2be988da1e5ce Reviewed-on: https://webrtc-review.googlesource.com/33781 Reviewed-by: Niklas Enbom <niklas.enbom@webrtc.org> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org> Commit-Queue: Steve Anton <steveanton@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21376}
This commit is contained in:
parent
36193c3756
commit
4ab68eec96
15 changed files with 230 additions and 207 deletions
|
@ -32,7 +32,6 @@ CPPLINT_BLACKLIST = [
|
|||
'modules/media_file',
|
||||
'modules/utility',
|
||||
'modules/video_capture',
|
||||
'p2p/base/sessiondescription.cc',
|
||||
'p2p/base/session.cc',
|
||||
'p2p/base/session.h',
|
||||
'p2p/base/pseudotcp.cc',
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "media/base/streamparams.h"
|
||||
#include "media/engine/webrtcvideoengine.h"
|
||||
#include "modules/audio_processing/include/audio_processing.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/copyonwritebuffer.h"
|
||||
#include "rtc_base/networkroute.h"
|
||||
|
|
|
@ -57,8 +57,6 @@ rtc_static_library("rtc_p2p") {
|
|||
"base/relayport.h",
|
||||
"base/session.cc",
|
||||
"base/session.h",
|
||||
"base/sessiondescription.cc",
|
||||
"base/sessiondescription.h",
|
||||
"base/stun.cc",
|
||||
"base/stun.h",
|
||||
"base/stunport.cc",
|
||||
|
|
8
p2p/DEPS
8
p2p/DEPS
|
@ -2,3 +2,11 @@ include_rules = [
|
|||
"+net",
|
||||
"+system_wrappers",
|
||||
]
|
||||
|
||||
specific_include_rules = {
|
||||
# TODO(steveanton): Remove this forwarding header once downstream projects
|
||||
# have updated to include the file in its new location.
|
||||
"sessiondescription\.h": [
|
||||
"+pc/sessiondescription.h",
|
||||
],
|
||||
}
|
||||
|
|
|
@ -11,182 +11,8 @@
|
|||
#ifndef P2P_BASE_SESSIONDESCRIPTION_H_
|
||||
#define P2P_BASE_SESSIONDESCRIPTION_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "p2p/base/transportinfo.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
// Describes a session content. Individual content types inherit from
|
||||
// this class. Analagous to a <jingle><content><description> or
|
||||
// <session><description>.
|
||||
class ContentDescription {
|
||||
public:
|
||||
virtual ~ContentDescription() {}
|
||||
virtual ContentDescription* Copy() const = 0;
|
||||
};
|
||||
|
||||
// Analagous to a <jingle><content> or <session><description>.
|
||||
// name = name of <content name="...">
|
||||
// type = xmlns of <content>
|
||||
struct ContentInfo {
|
||||
ContentInfo() {}
|
||||
ContentInfo(const std::string& name,
|
||||
const std::string& type,
|
||||
ContentDescription* description)
|
||||
: name(name), type(type), description(description) {}
|
||||
ContentInfo(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
ContentDescription* description) :
|
||||
name(name), type(type), rejected(rejected), description(description) {}
|
||||
ContentInfo(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
bool bundle_only,
|
||||
ContentDescription* description)
|
||||
: name(name),
|
||||
type(type),
|
||||
rejected(rejected),
|
||||
bundle_only(bundle_only),
|
||||
description(description) {}
|
||||
std::string name;
|
||||
std::string type;
|
||||
bool rejected = false;
|
||||
bool bundle_only = false;
|
||||
ContentDescription* description = nullptr;
|
||||
};
|
||||
|
||||
typedef std::vector<std::string> ContentNames;
|
||||
|
||||
// This class provides a mechanism to aggregate different media contents into a
|
||||
// group. This group can also be shared with the peers in a pre-defined format.
|
||||
// GroupInfo should be populated only with the |content_name| of the
|
||||
// MediaDescription.
|
||||
class ContentGroup {
|
||||
public:
|
||||
explicit ContentGroup(const std::string& semantics);
|
||||
ContentGroup(const ContentGroup&);
|
||||
ContentGroup(ContentGroup&&);
|
||||
ContentGroup& operator=(const ContentGroup&);
|
||||
ContentGroup& operator=(ContentGroup&&);
|
||||
~ContentGroup();
|
||||
|
||||
const std::string& semantics() const { return semantics_; }
|
||||
const ContentNames& content_names() const { return content_names_; }
|
||||
|
||||
const std::string* FirstContentName() const;
|
||||
bool HasContentName(const std::string& content_name) const;
|
||||
void AddContentName(const std::string& content_name);
|
||||
bool RemoveContentName(const std::string& content_name);
|
||||
|
||||
private:
|
||||
std::string semantics_;
|
||||
ContentNames content_names_;
|
||||
};
|
||||
|
||||
typedef std::vector<ContentInfo> ContentInfos;
|
||||
typedef std::vector<ContentGroup> ContentGroups;
|
||||
|
||||
const ContentInfo* FindContentInfoByName(
|
||||
const ContentInfos& contents, const std::string& name);
|
||||
const ContentInfo* FindContentInfoByType(
|
||||
const ContentInfos& contents, const std::string& type);
|
||||
|
||||
// Describes a collection of contents, each with its own name and
|
||||
// type. Analogous to a <jingle> or <session> stanza. Assumes that
|
||||
// contents are unique be name, but doesn't enforce that.
|
||||
class SessionDescription {
|
||||
public:
|
||||
SessionDescription();
|
||||
explicit SessionDescription(const ContentInfos& contents);
|
||||
SessionDescription(const ContentInfos& contents, const ContentGroups& groups);
|
||||
SessionDescription(const ContentInfos& contents,
|
||||
const TransportInfos& transports,
|
||||
const ContentGroups& groups);
|
||||
~SessionDescription();
|
||||
|
||||
SessionDescription* Copy() const;
|
||||
|
||||
// Content accessors.
|
||||
const ContentInfos& contents() const { return contents_; }
|
||||
ContentInfos& contents() { return contents_; }
|
||||
const ContentInfo* GetContentByName(const std::string& name) const;
|
||||
ContentInfo* GetContentByName(const std::string& name);
|
||||
const ContentDescription* GetContentDescriptionByName(
|
||||
const std::string& name) const;
|
||||
ContentDescription* GetContentDescriptionByName(const std::string& name);
|
||||
const ContentInfo* FirstContentByType(const std::string& type) const;
|
||||
const ContentInfo* FirstContent() const;
|
||||
|
||||
// Content mutators.
|
||||
// Adds a content to this description. Takes ownership of ContentDescription*.
|
||||
void AddContent(const std::string& name,
|
||||
const std::string& type,
|
||||
ContentDescription* description);
|
||||
void AddContent(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
ContentDescription* description);
|
||||
void AddContent(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
bool bundle_only,
|
||||
ContentDescription* description);
|
||||
bool RemoveContentByName(const std::string& name);
|
||||
|
||||
// Transport accessors.
|
||||
const TransportInfos& transport_infos() const { return transport_infos_; }
|
||||
TransportInfos& transport_infos() { return transport_infos_; }
|
||||
const TransportInfo* GetTransportInfoByName(
|
||||
const std::string& name) const;
|
||||
TransportInfo* GetTransportInfoByName(const std::string& name);
|
||||
const TransportDescription* GetTransportDescriptionByName(
|
||||
const std::string& name) const {
|
||||
const TransportInfo* tinfo = GetTransportInfoByName(name);
|
||||
return tinfo ? &tinfo->description : NULL;
|
||||
}
|
||||
|
||||
// Transport mutators.
|
||||
void set_transport_infos(const TransportInfos& transport_infos) {
|
||||
transport_infos_ = transport_infos;
|
||||
}
|
||||
// Adds a TransportInfo to this description.
|
||||
// Returns false if a TransportInfo with the same name already exists.
|
||||
bool AddTransportInfo(const TransportInfo& transport_info);
|
||||
bool RemoveTransportInfoByName(const std::string& name);
|
||||
|
||||
// Group accessors.
|
||||
const ContentGroups& groups() const { return content_groups_; }
|
||||
const ContentGroup* GetGroupByName(const std::string& name) const;
|
||||
bool HasGroup(const std::string& name) const;
|
||||
|
||||
// Group mutators.
|
||||
void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); }
|
||||
// Remove the first group with the same semantics specified by |name|.
|
||||
void RemoveGroupByName(const std::string& name);
|
||||
|
||||
// Global attributes.
|
||||
void set_msid_supported(bool supported) { msid_supported_ = supported; }
|
||||
bool msid_supported() const { return msid_supported_; }
|
||||
|
||||
private:
|
||||
SessionDescription(const SessionDescription&);
|
||||
|
||||
ContentInfos contents_;
|
||||
TransportInfos transport_infos_;
|
||||
ContentGroups content_groups_;
|
||||
bool msid_supported_ = true;
|
||||
};
|
||||
|
||||
// Indicates whether a ContentDescription was sent by the local client
|
||||
// or received from the remote client.
|
||||
enum ContentSource {
|
||||
CS_LOCAL, CS_REMOTE
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
// TODO(steveanton): Remove this forwarding header once downstream projects
|
||||
// have updated to include the file in its new location.
|
||||
#include "pc/sessiondescription.h"
|
||||
|
||||
#endif // P2P_BASE_SESSIONDESCRIPTION_H_
|
||||
|
|
|
@ -56,6 +56,8 @@ rtc_static_library("rtc_pc_base") {
|
|||
"rtptransport.h",
|
||||
"rtptransportinternal.h",
|
||||
"rtptransportinternaladapter.h",
|
||||
"sessiondescription.cc",
|
||||
"sessiondescription.h",
|
||||
"srtpfilter.cc",
|
||||
"srtpfilter.h",
|
||||
"srtpsession.cc",
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include "api/jsepsessiondescription.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/port.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "pc/mediasession.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
#include "pc/webrtcsdp.h"
|
||||
#include "rtc_base/gunit.h"
|
||||
#include "rtc_base/ptr_util.h"
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#include "api/optional.h"
|
||||
#include "p2p/base/dtlstransport.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "p2p/base/transportinfo.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
#include "rtc_base/messagequeue.h"
|
||||
#include "rtc_base/rtccertificate.h"
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#include "media/base/mediaconstants.h"
|
||||
#include "media/base/mediaengine.h" // For DataChannelType
|
||||
#include "media/base/streamparams.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "p2p/base/transportdescriptionfactory.h"
|
||||
#include "pc/jseptransport.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "media/engine/fakewebrtcvideoengine.h"
|
||||
#include "p2p/base/p2pconstants.h"
|
||||
#include "p2p/base/portinterface.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "p2p/base/teststunserver.h"
|
||||
#include "p2p/base/testturncustomizer.h"
|
||||
#include "p2p/base/testturnserver.h"
|
||||
|
@ -43,6 +42,7 @@
|
|||
#include "pc/mediasession.h"
|
||||
#include "pc/peerconnection.h"
|
||||
#include "pc/peerconnectionfactory.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
#include "pc/test/fakeaudiocapturemodule.h"
|
||||
#include "pc/test/fakeperiodicvideocapturer.h"
|
||||
#include "pc/test/fakertccertificategenerator.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#ifndef PC_RTCPMUXFILTER_H_
|
||||
#define PC_RTCPMUXFILTER_H_
|
||||
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "api/jsep.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
|
|
@ -8,23 +8,26 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
|
||||
namespace cricket {
|
||||
namespace {
|
||||
|
||||
ContentInfo* FindContentInfoByName(
|
||||
ContentInfos& contents, const std::string& name) {
|
||||
for (ContentInfos::iterator content = contents.begin();
|
||||
content != contents.end(); ++content) {
|
||||
if (content->name == name) {
|
||||
return &(*content);
|
||||
ContentInfo* FindContentInfoByName(ContentInfos* contents,
|
||||
const std::string& name) {
|
||||
RTC_DCHECK(contents);
|
||||
for (ContentInfo& content : *contents) {
|
||||
if (content.name == name) {
|
||||
return &content;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const ContentInfo* FindContentInfoByName(
|
||||
const ContentInfos& contents, const std::string& name) {
|
||||
} // namespace
|
||||
|
||||
const ContentInfo* FindContentInfoByName(const ContentInfos& contents,
|
||||
const std::string& name) {
|
||||
for (ContentInfos::const_iterator content = contents.begin();
|
||||
content != contents.end(); ++content) {
|
||||
if (content->name == name) {
|
||||
|
@ -34,8 +37,8 @@ const ContentInfo* FindContentInfoByName(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const ContentInfo* FindContentInfoByType(
|
||||
const ContentInfos& contents, const std::string& type) {
|
||||
const ContentInfo* FindContentInfoByType(const ContentInfos& contents,
|
||||
const std::string& type) {
|
||||
for (ContentInfos::const_iterator content = contents.begin();
|
||||
content != contents.end(); ++content) {
|
||||
if (content->type == type) {
|
||||
|
@ -70,8 +73,8 @@ void ContentGroup::AddContentName(const std::string& content_name) {
|
|||
}
|
||||
|
||||
bool ContentGroup::RemoveContentName(const std::string& content_name) {
|
||||
ContentNames::iterator iter = std::find(
|
||||
content_names_.begin(), content_names_.end(), content_name);
|
||||
ContentNames::iterator iter =
|
||||
std::find(content_names_.begin(), content_names_.end(), content_name);
|
||||
if (iter == content_names_.end()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -108,7 +111,7 @@ SessionDescription* SessionDescription::Copy() const {
|
|||
SessionDescription* copy = new SessionDescription(*this);
|
||||
// Copy all ContentDescriptions.
|
||||
for (ContentInfos::iterator content = copy->contents_.begin();
|
||||
content != copy->contents().end(); ++content) {
|
||||
content != copy->contents().end(); ++content) {
|
||||
content->description = content->description->Copy();
|
||||
}
|
||||
return copy;
|
||||
|
@ -119,9 +122,8 @@ const ContentInfo* SessionDescription::GetContentByName(
|
|||
return FindContentInfoByName(contents_, name);
|
||||
}
|
||||
|
||||
ContentInfo* SessionDescription::GetContentByName(
|
||||
const std::string& name) {
|
||||
return FindContentInfoByName(contents_, name);
|
||||
ContentInfo* SessionDescription::GetContentByName(const std::string& name) {
|
||||
return FindContentInfoByName(&contents_, name);
|
||||
}
|
||||
|
||||
const ContentDescription* SessionDescription::GetContentDescriptionByName(
|
||||
|
@ -136,7 +138,7 @@ const ContentDescription* SessionDescription::GetContentDescriptionByName(
|
|||
|
||||
ContentDescription* SessionDescription::GetContentDescriptionByName(
|
||||
const std::string& name) {
|
||||
ContentInfo* cinfo = FindContentInfoByName(contents_, name);
|
||||
ContentInfo* cinfo = FindContentInfoByName(&contents_, name);
|
||||
if (cinfo == NULL) {
|
||||
return NULL;
|
||||
}
|
189
pc/sessiondescription.h
Normal file
189
pc/sessiondescription.h
Normal file
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef PC_SESSIONDESCRIPTION_H_
|
||||
#define PC_SESSIONDESCRIPTION_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "p2p/base/transportinfo.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
// Describes a session content. Individual content types inherit from
|
||||
// this class. Analagous to a <jingle><content><description> or
|
||||
// <session><description>.
|
||||
class ContentDescription {
|
||||
public:
|
||||
virtual ~ContentDescription() {}
|
||||
virtual ContentDescription* Copy() const = 0;
|
||||
};
|
||||
|
||||
// Analagous to a <jingle><content> or <session><description>.
|
||||
// name = name of <content name="...">
|
||||
// type = xmlns of <content>
|
||||
struct ContentInfo {
|
||||
ContentInfo() {}
|
||||
ContentInfo(const std::string& name,
|
||||
const std::string& type,
|
||||
ContentDescription* description)
|
||||
: name(name), type(type), description(description) {}
|
||||
ContentInfo(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
ContentDescription* description)
|
||||
: name(name), type(type), rejected(rejected), description(description) {}
|
||||
ContentInfo(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
bool bundle_only,
|
||||
ContentDescription* description)
|
||||
: name(name),
|
||||
type(type),
|
||||
rejected(rejected),
|
||||
bundle_only(bundle_only),
|
||||
description(description) {}
|
||||
std::string name;
|
||||
std::string type;
|
||||
bool rejected = false;
|
||||
bool bundle_only = false;
|
||||
ContentDescription* description = nullptr;
|
||||
};
|
||||
|
||||
typedef std::vector<std::string> ContentNames;
|
||||
|
||||
// This class provides a mechanism to aggregate different media contents into a
|
||||
// group. This group can also be shared with the peers in a pre-defined format.
|
||||
// GroupInfo should be populated only with the |content_name| of the
|
||||
// MediaDescription.
|
||||
class ContentGroup {
|
||||
public:
|
||||
explicit ContentGroup(const std::string& semantics);
|
||||
ContentGroup(const ContentGroup&);
|
||||
ContentGroup(ContentGroup&&);
|
||||
ContentGroup& operator=(const ContentGroup&);
|
||||
ContentGroup& operator=(ContentGroup&&);
|
||||
~ContentGroup();
|
||||
|
||||
const std::string& semantics() const { return semantics_; }
|
||||
const ContentNames& content_names() const { return content_names_; }
|
||||
|
||||
const std::string* FirstContentName() const;
|
||||
bool HasContentName(const std::string& content_name) const;
|
||||
void AddContentName(const std::string& content_name);
|
||||
bool RemoveContentName(const std::string& content_name);
|
||||
|
||||
private:
|
||||
std::string semantics_;
|
||||
ContentNames content_names_;
|
||||
};
|
||||
|
||||
typedef std::vector<ContentInfo> ContentInfos;
|
||||
typedef std::vector<ContentGroup> ContentGroups;
|
||||
|
||||
const ContentInfo* FindContentInfoByName(const ContentInfos& contents,
|
||||
const std::string& name);
|
||||
const ContentInfo* FindContentInfoByType(const ContentInfos& contents,
|
||||
const std::string& type);
|
||||
|
||||
// Describes a collection of contents, each with its own name and
|
||||
// type. Analogous to a <jingle> or <session> stanza. Assumes that
|
||||
// contents are unique be name, but doesn't enforce that.
|
||||
class SessionDescription {
|
||||
public:
|
||||
SessionDescription();
|
||||
explicit SessionDescription(const ContentInfos& contents);
|
||||
SessionDescription(const ContentInfos& contents, const ContentGroups& groups);
|
||||
SessionDescription(const ContentInfos& contents,
|
||||
const TransportInfos& transports,
|
||||
const ContentGroups& groups);
|
||||
~SessionDescription();
|
||||
|
||||
SessionDescription* Copy() const;
|
||||
|
||||
// Content accessors.
|
||||
const ContentInfos& contents() const { return contents_; }
|
||||
ContentInfos& contents() { return contents_; }
|
||||
const ContentInfo* GetContentByName(const std::string& name) const;
|
||||
ContentInfo* GetContentByName(const std::string& name);
|
||||
const ContentDescription* GetContentDescriptionByName(
|
||||
const std::string& name) const;
|
||||
ContentDescription* GetContentDescriptionByName(const std::string& name);
|
||||
const ContentInfo* FirstContentByType(const std::string& type) const;
|
||||
const ContentInfo* FirstContent() const;
|
||||
|
||||
// Content mutators.
|
||||
// Adds a content to this description. Takes ownership of ContentDescription*.
|
||||
void AddContent(const std::string& name,
|
||||
const std::string& type,
|
||||
ContentDescription* description);
|
||||
void AddContent(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
ContentDescription* description);
|
||||
void AddContent(const std::string& name,
|
||||
const std::string& type,
|
||||
bool rejected,
|
||||
bool bundle_only,
|
||||
ContentDescription* description);
|
||||
bool RemoveContentByName(const std::string& name);
|
||||
|
||||
// Transport accessors.
|
||||
const TransportInfos& transport_infos() const { return transport_infos_; }
|
||||
TransportInfos& transport_infos() { return transport_infos_; }
|
||||
const TransportInfo* GetTransportInfoByName(const std::string& name) const;
|
||||
TransportInfo* GetTransportInfoByName(const std::string& name);
|
||||
const TransportDescription* GetTransportDescriptionByName(
|
||||
const std::string& name) const {
|
||||
const TransportInfo* tinfo = GetTransportInfoByName(name);
|
||||
return tinfo ? &tinfo->description : NULL;
|
||||
}
|
||||
|
||||
// Transport mutators.
|
||||
void set_transport_infos(const TransportInfos& transport_infos) {
|
||||
transport_infos_ = transport_infos;
|
||||
}
|
||||
// Adds a TransportInfo to this description.
|
||||
// Returns false if a TransportInfo with the same name already exists.
|
||||
bool AddTransportInfo(const TransportInfo& transport_info);
|
||||
bool RemoveTransportInfoByName(const std::string& name);
|
||||
|
||||
// Group accessors.
|
||||
const ContentGroups& groups() const { return content_groups_; }
|
||||
const ContentGroup* GetGroupByName(const std::string& name) const;
|
||||
bool HasGroup(const std::string& name) const;
|
||||
|
||||
// Group mutators.
|
||||
void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); }
|
||||
// Remove the first group with the same semantics specified by |name|.
|
||||
void RemoveGroupByName(const std::string& name);
|
||||
|
||||
// Global attributes.
|
||||
void set_msid_supported(bool supported) { msid_supported_ = supported; }
|
||||
bool msid_supported() const { return msid_supported_; }
|
||||
|
||||
private:
|
||||
SessionDescription(const SessionDescription&);
|
||||
|
||||
ContentInfos contents_;
|
||||
TransportInfos transport_infos_;
|
||||
ContentGroups content_groups_;
|
||||
bool msid_supported_ = true;
|
||||
};
|
||||
|
||||
// Indicates whether a ContentDescription was sent by the local client
|
||||
// or received from the remote client.
|
||||
enum ContentSource { CS_LOCAL, CS_REMOTE };
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // PC_SESSIONDESCRIPTION_H_
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "api/cryptoparams.h"
|
||||
#include "api/optional.h"
|
||||
#include "p2p/base/sessiondescription.h"
|
||||
#include "pc/sessiondescription.h"
|
||||
#include "rtc_base/basictypes.h"
|
||||
#include "rtc_base/buffer.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
|
|
Loading…
Reference in a new issue