本文整理汇总了C++中MediaSubsession::parseSDPAttribute_bandwidth方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaSubsession::parseSDPAttribute_bandwidth方法的具体用法?C++ MediaSubsession::parseSDPAttribute_bandwidth怎么用?C++ MediaSubsession::parseSDPAttribute_bandwidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaSubsession
的用法示例。
在下文中一共展示了MediaSubsession::parseSDPAttribute_bandwidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeWithSDP
//.........这里部分代码省略.........
if (nextSDPLine == NULL) {
sdpLineStr = (char*)sdpLine;
} else {
sdpLineStr = strDup(sdpLine);
sdpLineStr[nextSDPLine-sdpLine] = '\0';
}
envir() << "Bad SDP \"m=\" line: " << sdpLineStr << "\n";
if (sdpLineStr != (char*)sdpLine) delete[] sdpLineStr;
delete[] mediumName;
delete subsession;
// Skip the following SDP lines, up until the next "m=":
while (1) {
sdpLine = nextSDPLine;
if (sdpLine == NULL) break; // we've reached the end
if (!parseSDPLine(sdpLine, nextSDPLine)) return False;
if (sdpLine[0] == 'm') break; // we've reached the next subsession
}
continue;
}
// Insert this subsession at the end of the list:
if (fSubsessionsTail == NULL) {
fSubsessionsHead = fSubsessionsTail = subsession;
} else {
fSubsessionsTail->setNext(subsession);
fSubsessionsTail = subsession;
}
subsession->serverPortNum = subsession->fClientPortNum; // by default
char const* mStart = sdpLine;
subsession->fSavedSDPLines = strDup(mStart);
subsession->fMediumName = strDup(mediumName);
delete[] mediumName;
subsession->fProtocolName = strDup(protocolName);
subsession->fRTPPayloadFormat = payloadFormat;
// Process the following SDP lines, up until the next "m=":
while (1) {
sdpLine = nextSDPLine;
if (sdpLine == NULL) break; // we've reached the end
if (!parseSDPLine(sdpLine, nextSDPLine)) return False;
if (sdpLine[0] == 'm') break; // we've reached the next subsession
// Check for various special SDP lines that we understand:
if (subsession->parseSDPLine_c(sdpLine)) continue;
if (subsession->parseSDPAttribute_rtpmap(sdpLine)) continue;
if (subsession->parseSDPAttribute_control(sdpLine)) continue;
if (subsession->parseSDPAttribute_range(sdpLine)) continue;
if (subsession->parseSDPAttribute_fmtp(sdpLine)) continue;
if (subsession->parseSDPAttribute_source_filter(sdpLine)) continue;
if (subsession->parseSDPAttribute_x_dimensions(sdpLine)) continue;
if (subsession->parseSDPAttribute_framerate(sdpLine)) continue;
if ( subsession->parseSDPAttribute_bandwidth( sdpLine ) )
{
continue;
}
#ifdef SUPPORT_REAL_RTSP
if (RealParseSDPAttributes(subsession, sdpLine)) continue;
#endif
// (Later, check for malformed lines, and other valid SDP lines#####)
}
if (sdpLine != NULL) subsession->fSavedSDPLines[sdpLine-mStart] = '\0';
// If we don't yet know the codec name, try looking it up from the
// list of static payload types:
if (subsession->fCodecName == NULL) {
subsession->fCodecName
= lookupPayloadFormat(subsession->fRTPPayloadFormat,
subsession->fRTPTimestampFrequency,
subsession->fNumChannels);
if (subsession->fCodecName == NULL) {
char typeStr[20];
sprintf(typeStr, "%d", subsession->fRTPPayloadFormat);
envir().setResultMsg("Unknown codec name for RTP payload type ",
typeStr);
return False;
}
}
// If we don't yet know this subsession's RTP timestamp frequency
// (because it uses a dynamic payload type and the corresponding
// SDP "rtpmap" attribute erroneously didn't specify it),
// then guess it now:
if (subsession->fRTPTimestampFrequency == 0) {
subsession->fRTPTimestampFrequency
= guessRTPTimestampFrequency(subsession->fMediumName,
subsession->fCodecName);
}
}
return True;
}