当前位置: 首页>>代码示例>>C++>>正文


C++ StreamState::referenceCount方法代码示例

本文整理汇总了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;
}
开发者ID:DayDayUpCQ,项目名称:live555,代码行数:26,代码来源:OnDemandServerMediaSubsession.cpp

示例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;
}
开发者ID:akaminnya,项目名称:openpernet,代码行数:28,代码来源:EncoderMediaSubsession.cpp


注:本文中的StreamState::referenceCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。