本文整理汇总了C++中SdpMediaSection::GetPort方法的典型用法代码示例。如果您正苦于以下问题:C++ SdpMediaSection::GetPort方法的具体用法?C++ SdpMediaSection::GetPort怎么用?C++ SdpMediaSection::GetPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SdpMediaSection
的用法示例。
在下文中一共展示了SdpMediaSection::GetPort方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
SdpHelper::MsectionIsDisabled(const SdpMediaSection& msection) const
{
return !msection.GetPort() &&
!msection.GetAttributeList().HasAttribute(
SdpAttribute::kBundleOnlyAttribute);
}
示例2: SdpMultiStringAttribute
nsresult
SdpHelper::CopyTransportParams(size_t numComponents,
const SdpMediaSection& oldLocal,
SdpMediaSection* newLocal)
{
// Copy over m-section details
newLocal->SetPort(oldLocal.GetPort());
newLocal->GetConnection() = oldLocal.GetConnection();
const SdpAttributeList& oldLocalAttrs = oldLocal.GetAttributeList();
SdpAttributeList& newLocalAttrs = newLocal->GetAttributeList();
// Now we copy over attributes that won't be added by the usual logic
if (oldLocalAttrs.HasAttribute(SdpAttribute::kCandidateAttribute) &&
numComponents) {
UniquePtr<SdpMultiStringAttribute> candidateAttrs(
new SdpMultiStringAttribute(SdpAttribute::kCandidateAttribute));
for (const std::string& candidate : oldLocalAttrs.GetCandidate()) {
size_t component;
nsresult rv = GetComponent(candidate, &component);
NS_ENSURE_SUCCESS(rv, rv);
if (numComponents >= component) {
candidateAttrs->mValues.push_back(candidate);
}
}
if (candidateAttrs->mValues.size()) {
newLocalAttrs.SetAttribute(candidateAttrs.release());
}
}
if (numComponents == 2 &&
oldLocalAttrs.HasAttribute(SdpAttribute::kRtcpAttribute)) {
// copy rtcp attribute if we had one that we are using
newLocalAttrs.SetAttribute(new SdpRtcpAttribute(oldLocalAttrs.GetRtcp()));
}
return NS_OK;
}