本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}