本文整理汇总了C++中MediaSubsession::mctSLAPSessionId方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaSubsession::mctSLAPSessionId方法的具体用法?C++ MediaSubsession::mctSLAPSessionId怎么用?C++ MediaSubsession::mctSLAPSessionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaSubsession
的用法示例。
在下文中一共展示了MediaSubsession::mctSLAPSessionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iter
Boolean MediaSession
::initiateByMediaType(char const* mimeType,
MediaSubsession*& resultSubsession,
PrioritizedRTPStreamSelector*& resultMultiSource,
int& resultMultiSourceSessionId,
int useSpecialRTPoffset) {
// Look through this session's subsessions for media that match "mimeType"
resultSubsession = NULL;
resultMultiSource = NULL;
resultMultiSourceSessionId = 0;
unsigned maxStaggerSeconds = 0;
MediaSubsessionIterator iter(*this);
MediaSubsession* subsession;
while ((subsession = iter.next()) != NULL) {
if (resultMultiSourceSessionId != 0
&& subsession->mctSLAPSessionId() != resultMultiSourceSessionId) {
// We're using a multi-source SLAP session, but this subsession
// isn't part of it
continue;
}
Boolean wasAlreadyInitiated = subsession->readSource() != NULL;
if (!wasAlreadyInitiated) {
// Try to create a source for this subsession:
if (!subsession->initiate(useSpecialRTPoffset)) return False;
}
// Make sure the source's MIME type is one that we handle:
if (strcmp(subsession->readSource()->MIMEtype(), mimeType) != 0) {
if (!wasAlreadyInitiated) subsession->deInitiate();
continue;
}
if (subsession->mctSLAPSessionId() == 0) {
// Normal case: a single session
resultSubsession = subsession;
break; // use this
} else {
// Special case: a multi-source SLAP session
resultMultiSourceSessionId = subsession->mctSLAPSessionId();
unsigned subsessionStaggerSeconds = subsession->mctSLAPStagger();
if (subsessionStaggerSeconds > maxStaggerSeconds) {
maxStaggerSeconds = subsessionStaggerSeconds;
}
}
}
if (resultSubsession == NULL && resultMultiSourceSessionId == 0) {
envir().setResultMsg("Session has no usable media subsession");
return False;
}
if (resultMultiSourceSessionId != 0) {
// We have a multi-source MCT SLAP session; create a selector for it:
unsigned seqNumStagger = computeSeqNumStagger(maxStaggerSeconds);
resultMultiSource
= PrioritizedRTPStreamSelector::createNew(envir(), seqNumStagger);
if (resultMultiSource == NULL) return False;
// Note: each subsession has its own RTCP instance; we don't return them
// Then run through the subsessions again, adding each of the sources:
iter.reset();
while ((subsession = iter.next()) != NULL) {
if (subsession->mctSLAPSessionId() == resultMultiSourceSessionId) {
resultMultiSource->addInputRTPStream(subsession->rtpSource(),
subsession->rtcpInstance());
}
}
}
return True;
}