本文整理汇总了C++中MediaSubsession::setSessionId方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaSubsession::setSessionId方法的具体用法?C++ MediaSubsession::setSessionId怎么用?C++ MediaSubsession::setSessionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaSubsession
的用法示例。
在下文中一共展示了MediaSubsession::setSessionId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenConnection
//.........这里部分代码省略.........
if (groupsock != NULL)
{
delete groupsock;
groupsock = NULL;
}
}
}
while ((groupsock == NULL) && (port <= this->rtspRtpClientPortRangeEnd));
// Did we find a free port? If not, we fall back to a random port chosen
// by LIVE555.
if (groupsock != NULL)
{
delete groupsock;
groupsock = NULL;
subsession->setClientPortNum(port);
}
}
if (!subsession->initiate() || subsession->rtpSource() == NULL)
{
TCHAR *message = FormatString(_T("failed to create receiver for sub-session, medium = %s, codec = %s"), subSessionName, subSessionCodecName);
this->LogRtspMessage(LOGGER_ERROR, METHOD_OPEN_CONNECTION_NAME, message);
FREE_MEM(message);
FREE_MEM(subSessionName);
FREE_MEM(subSessionCodecName);
continue;
}
this->logger.Log(LOGGER_VERBOSE, _T("%s: %s: created receiver for sub-session, medium = %s, codec = %s"), PROTOCOL_IMPLEMENTATION_NAME, METHOD_OPEN_CONNECTION_NAME, subSessionName, subSessionCodecName);
FREE_MEM(subSessionName);
FREE_MEM(subSessionCodecName);
// set session ID, doesn't matter what
subsession->setSessionId(subsession->mediumName());
// because we're saving the incoming data, rather than playing
// it in real time, allow an especially large time threshold
// for reordering misordered incoming packets:
subsession->rtpSource()->setPacketReorderingThresholdTime(1000000); // 1 second
// set the RTP source's OS socket buffer size as appropriate
int socketNum = subsession->rtpSource()->RTPgs()->socketNum();
unsigned int currentBufferSize = getReceiveBufferSize(*this->rtspEnvironment, socketNum);
if (this->defaultBufferSize > currentBufferSize)
{
setReceiveBufferTo(*this->rtspEnvironment, socketNum, this->defaultBufferSize);
unsigned setBufferSize = getReceiveBufferSize(*this->rtspEnvironment, socketNum);
if (setBufferSize == this->defaultBufferSize)
{
this->logger.Log(LOGGER_VERBOSE, _T("%s: %s: set buffer size for sub-session, previous size = %i, requested size = %i, current size = %i"), PROTOCOL_IMPLEMENTATION_NAME, METHOD_OPEN_CONNECTION_NAME, subSessionName, currentBufferSize, this->defaultBufferSize, setBufferSize);
}
else
{
this->logger.Log(LOGGER_WARNING, _T("%s: %s: failed to set buffer size for sub-session, previous size = %i, requested size = %i, current size = %i"), PROTOCOL_IMPLEMENTATION_NAME, METHOD_OPEN_CONNECTION_NAME, subSessionName, currentBufferSize, this->defaultBufferSize, setBufferSize);
}
}
if (SendRtspCommand(METHOD_OPEN_CONNECTION_NAME, _T("SETUP"), subsession) != STATUS_OK)
{
CloseConnection();
return STATUS_ERROR;
}
rtspSource = subsession->rtpSource();
break;
}