本文整理汇总了C++中StreamState::referenceCount方法的典型用法代码示例。如果您正苦于以下问题:C++ StreamState::referenceCount方法的具体用法?C++ StreamState::referenceCount怎么用?C++ StreamState::referenceCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamState
的用法示例。
在下文中一共展示了StreamState::referenceCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteStream
void OnDemandServerMediaSubsession::deleteStream(unsigned clientSessionId,
void*& streamToken) {
StreamState* streamState = (StreamState*)streamToken;
// Look up (and remove) the destinations for this client session:
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (destinations != NULL) {
fDestinationsHashTable->Remove((char const*)clientSessionId);
// Stop streaming to these destinations:
if (streamState != NULL) streamState->endPlaying(destinations);
}
// Delete the "StreamState" structure if it's no longer being used:
if (streamState != NULL) {
if (streamState->referenceCount() > 0) --streamState->referenceCount();
if (streamState->referenceCount() == 0) {
delete streamState;
streamToken = NULL;
}
}
// Finally, delete the destinations themselves:
delete destinations;
}
示例2: deleteStream
void EncoderMediaSubsession::deleteStream(unsigned clientSessionId,
void*& streamToken) {
StreamState* streamState = (StreamState*)streamToken;
Debug(ckite_log_message, "deleteStream entry \n");
// Look up (and remove) the destinations for this client session:
Destinations* destinations
= (Destinations*)(fDestinationsHashTable->Lookup((char const*)clientSessionId));
if (destinations != NULL) {
fDestinationsHashTable->Remove((char const*)clientSessionId);
// Stop streaming to these destinations:
if (streamState != NULL) streamState->endPlaying(destinations, vType, aType);
}
// Delete the "StreamState" structure if it's no longer being used:
if (streamState != NULL) {
if (streamState->referenceCount() > 0) --streamState->referenceCount();
if (streamState->referenceCount() == 0) {
delete streamState;
if (fLastStreamToken == streamToken) fLastStreamToken = NULL;
streamToken = NULL;
}
}
// Finally, delete the destinations themselves:
delete destinations;
}