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


C++ Participant::GetType方法代码示例

本文整理汇总了C++中Participant::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ Participant::GetType方法的具体用法?C++ Participant::GetType怎么用?C++ Participant::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Participant的用法示例。


在下文中一共展示了Participant::GetType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ConsumeParticipantOutputToken

/********************************************************
 * ConsumeBroadcastToken
 *   Check and consume a token for conference watcher
 ********************************************************/
Participant* MultiConf::ConsumeParticipantOutputToken(const std::wstring &token)
{
	//Check token
	ParticipantTokens::iterator it = outputTokens.find(token);

	//Check we found one
	if (it==outputTokens.end())
		//Broadcast not found
		return NULL;

	//Get participant id
	int partId = it->second;

	//Remove token
	outputTokens.erase(it);

	//Get it
	Participants::iterator itPart = participants.find(partId);

	//Check if not found
	if (itPart==participants.end())
		//Not found
		return NULL;

	//Get it
	Participant* part = itPart->second;

	//Asert correct tipe
	if (part->GetType()!=Participant::RTMP)
		//Esit
		return NULL;

	//return it
	return part;
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:39,代码来源:multiconf.cpp

示例2: ConsumeParticipantInputToken

RTMPMediaStream::Listener* MultiConf::ConsumeParticipantInputToken(const std::wstring &token)
{
	//Check token
	ParticipantTokens::iterator it = inputTokens.find(token);

	//Check we found one
	if (it==inputTokens.end())
	{
		//Error
		Error("Participant token not found\n");
		//Broadcast not found
		return NULL;
	}

	//Get participant id
	int partId = it->second;

	//Remove token
	inputTokens.erase(it);

	//Get it
	Participants::iterator itPart = participants.find(partId);

	//Check if not found
	if (itPart==participants.end())
	{
		//Error
		Error("Participant not found\n");
		//Broadcast not found
		return NULL;
	}

	//Get it
	Participant* part = itPart->second;

	//Asert correct tipe
	if (part->GetType()!=Participant::RTMP)
	{
		//Error
		Error("Participant type not RTMP");

		//Broadcast not found
		return NULL;
	}

	//return it
	return (RTMPMediaStream::Listener*)(RTMPParticipant*)part;
}
开发者ID:tidehc,项目名称:media-server-1,代码行数:48,代码来源:multiconf.cpp

示例3: GetParticipant

Participant *MultiConf::GetParticipant(int partId,Participant::Type type)
{
	//Find participant
	Participant *part = GetParticipant(partId);

	//If no participant
	if (!part)
		//Exit
		return NULL;

	//Ensure it is from the correct type
	if (part->GetType()!=type)
		//Error
		return (Participant *)Error("Participant is not of desired type");
	
	//Return it
	return part;
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:18,代码来源:multiconf.cpp

示例4: StopSendingVideo

/************************
* StopSendingVideo
* 	StopSendingVideo
*************************/
int MultiConf::StopSendingVideo(int id)
{
	int ret = 0;

	Log("-StopSendingVideo [%d]\n",id);

	//Use list
	participantsLock.IncUse();

	 //El iterator
        Participants::iterator it = participants.find(id);

	//Si no esta
	if (it == participants.end()) {
		Log("Participant is not of RTP type, may be from rtsp.\n");
		m_GroupVideo.StopSending(id);
		participantsLock.DecUse();
		return 1;
	}
	
	//Get the participant
        Participant *part = (*it).second;

	//Ensure it is from the correct type
	if (part->GetType()!=Participant::RTP)
		//Not possible
		Log("Participant is not of RTP type, may be from rtsp.\n");

	
	m_GroupVideo.StopSending(id);
	//Unlock
	participantsLock.DecUse();

	return 1;
	//Stop sending the video
	//return ((RTPParticipant*)part)->StopSendingVideo();
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:41,代码来源:multiconf.cpp

示例5:

/************************
* StartSendingVideo
* 	StartSendingVideo
*************************/
RTPSession *MultiConf::StartSendingVideo(int id,char *sendVideoIp,int sendVideoPort,VideoCodec::RTPMap& rtpMap)
{
	int ret = 0;

	Log("-StartSendingVideo [%d]\n",id);
	//Use list
	participantsLock.IncUse();
	Participants::iterator it = participants.find(id);
	RTPSession *rtp = NULL;
	//Si no esta
	if (it == participants.end()) {
		Log("Participant is not of RTP type, may be from rtsp.\n");
		rtp = m_GroupVideo.StartSending(id,sendVideoIp,sendVideoPort,rtpMap, NULL);
		SendIdrPacket(rtp);
		participantsLock.DecUse();
		return rtp;
	}
	
	 //Get the participant
        Participant *part = (*it).second;

	//Ensure it is from the correct type
	if (part->GetType()!=Participant::RTP)
		//Not possible
		Log("Participant is not of RTP type, may be from rtsp.\n");

	rtp = ((RTPParticipant*)part)->GetVideoRTPSession();
	m_GroupVideo.StartSending(id,sendVideoIp,sendVideoPort,rtpMap, rtp);
	if(m_CurrentBroadCaster != id)
		SendIdrPacket(rtp);

	//Unlock
	participantsLock.DecUse();
	//Start sending the video
	//return ((RTPParticipant*)part)->StartSendingVideo(sendVideoIp,sendVideoPort,rtpMap);
	return rtp;
}
开发者ID:chenxiuheng,项目名称:mcumediaserver,代码行数:41,代码来源:multiconf.cpp


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