本文整理汇总了C++中OSRef::GetRefCount方法的典型用法代码示例。如果您正苦于以下问题:C++ OSRef::GetRefCount方法的具体用法?C++ OSRef::GetRefCount怎么用?C++ OSRef::GetRefCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSRef
的用法示例。
在下文中一共展示了OSRef::GetRefCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveOutput
void RemoveOutput(ReflectorOutput* inOutput, ReflectorSession* inSession, Bool16 killClients)
{
//This function removes the output from the ReflectorSession, then
Assert(inSession);
if (inSession != NULL)
{
if (inOutput != NULL)
{
inSession->RemoveOutput(inOutput,true);
//qtss_printf("QTSSReflectorModule.cpp:RemoveOutput it is a client session\n");
}
else
{ // it is a Broadcaster session
//qtss_printf("QTSSReflectorModule.cpp:RemoveOutput it is a broadcaster session\n");
//SourceInfo* theInfo = inSession->GetSourceInfo();
//Assert(theInfo);
//
//if (theInfo->IsRTSPControlled())
//{
// FileDeleter(inSession->GetSourcePath());
//}
//
//if (killClients || 1)
//{ inSession->TearDownAllOutputs();
//}
}
//qtss_printf("QTSSReflectorModule.cpp:RemoveOutput refcount =%lu\n", inSession->GetRef()->GetRefCount());
//check if the ReflectorSession should be deleted
//(it should if its ref count has dropped to 0)
OSMutexLocker locker (sSessionMap->GetMutex());
OSRef* theSessionRef = inSession->GetRef();
if (theSessionRef != NULL)
{
if (theSessionRef->GetRefCount() == 0)
{
RTSPRelaySession* proxySession = (RTSPRelaySession*)inSession->GetRTSPRelaySession();
if(proxySession != NULL)
{
proxySession->SetReflectorSession(NULL);
sClientSessionMap->UnRegister(proxySession->GetRef());
proxySession->Signal(Task::kKillEvent);
}
inSession->SetRTSPRelaySession(NULL);
sSessionMap->UnRegister(theSessionRef);
delete inSession;
}
//else if (theSessionRef->GetRefCount() == 1)
//{
// //qtss_printf("QTSSReflector.cpp:RemoveOutput Delete SESSION=%lu\n",(UInt32)inSession);
// RTSPRelaySession* proxySession = (RTSPRelaySession*)inSession->GetRelaySession();
// if(proxySession != NULL)
// {
// proxySession->SetReflectorSession(NULL);
// sClientSessionMap->UnRegister(proxySession->GetRef());
// proxySession->Signal(Task::kKillEvent);
// }
// inSession->SetRelaySession(NULL);
// sSessionMap->UnRegister(theSessionRef);
// delete inSession;
//}
else
{
qtss_printf("QTSSReflector.cpp:RemoveOutput Release SESSION=%lu RefCount=%d\n",(UInt64)inSession,theSessionRef->GetRefCount());
sSessionMap->Release(theSessionRef); // one of the sessions on the ref is ending just decrement the count
}
}
}
delete inOutput;
}