本文整理汇总了C++中Participant::SetGroupVideoStream方法的典型用法代码示例。如果您正苦于以下问题:C++ Participant::SetGroupVideoStream方法的具体用法?C++ Participant::SetGroupVideoStream怎么用?C++ Participant::SetGroupVideoStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Participant
的用法示例。
在下文中一共展示了Participant::SetGroupVideoStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteParticipant
/************************
* DeleteParticipant
* Borra un participante
*************************/
int MultiConf::DeleteParticipant(int id)
{
Log(">DeleteParticipant [%d]\n",id);
//Stop recording participant just in case
StopRecordingParticipant(id);
//Block
participantsLock.WaitUnusedAndLock();
//El iterator
Participants::iterator it = participants.find(id);
//Si no esta
if (it == participants.end())
{
//Unlock
participantsLock.Unlock();
//Exit
return Error("Participant not found\n");
}
//LO obtenemos
Participant *part = it->second;
part->SetGroupVideoStream(NULL);
Log("-DeleteParticipant ending media [%d]\n",id);
//Y lo quitamos del mapa
participants.erase(it);
//Unlock
participantsLock.Unlock();
//Destroy participatn
DestroyParticipant(id,part);
//Terminamos el audio y el video
if(m_CurrentBroadCaster == id && participants.size())
{
Log("BroadCaster exist use the first coming user\n");
participants.begin()->second->SetGroupVideoStream(&m_GroupVideo);
m_CurrentBroadCaster = participants.begin()->second->GetPartId();
participants.begin()->second->SendVideoFPU();
} else if(m_CurrentBroadCaster == id && participants.size() == 0) {
Log("BroadCaster and no user left\n");
m_CurrentBroadCaster = 0;
}
Log("<DeleteParticipant [%d]\n",id);
return 1;
}
示例2: CreateParticipant
/************************
* CreateParticipant
* A�ade un participante
*************************/
int MultiConf::CreateParticipant(int mosaicId,std::wstring name,Participant::Type type)
{
Participant *part = NULL;
Log(">CreateParticipant [mosaic:%d]\n",mosaicId);
//SI no tamos iniciados pasamos
if (!inited)
return Error("Not inited\n");
//Get lock
participantsLock.WaitUnusedAndLock();
//Obtenemos el id
int partId = maxId++;
//Unlock
participantsLock.Unlock();
//Le creamos un mixer
if (!videoMixer.CreateMixer(partId))
return Error("Couldn't set video mixer\n");
//Y el de audio
if (!audioMixer.CreateMixer(partId))
{
//Borramos el de video
videoMixer.DeleteMixer(partId);
//Y salimos
return Error("Couldn't set audio mixer\n");
}
//And text
if (!textMixer.CreateMixer(partId,name))
{
//Borramos el de video y audio
videoMixer.DeleteMixer(partId);
audioMixer.DeleteMixer(partId);
//Y salimos
return Error("Couldn't set text mixer\n");
}
//Depending on the type
switch(type)
{
case Participant::RTP:
//Create RTP Participant
part = new RTPParticipant(partId, m_ConfId);
break;
case Participant::RTMP:
part = new RTMPParticipant(partId, m_ConfId);
//Create RTP Participant
break;
}
//Set inputs and outputs
part->SetVideoInput(videoMixer.GetInput(partId));
part->SetVideoOutput(videoMixer.GetOutput(partId));
part->SetAudioInput(audioMixer.GetInput(partId));
part->SetAudioOutput(audioMixer.GetOutput(partId));
part->SetTextInput(textMixer.GetInput(partId));
part->SetTextOutput(textMixer.GetOutput(partId));
//Init participant
part->Init();
//E iniciamos el mixer
videoMixer.InitMixer(partId,mosaicId);
audioMixer.InitMixer(partId);
textMixer.InitMixer(partId);
//Get lock
participantsLock.WaitUnusedAndLock();
//Lo insertamos en el map
participants[partId] = part;
//add for rtsp watcher by liuhong start
if (m_CurrentBroadCaster == 0)
{
part->SetGroupVideoStream(&m_GroupVideo);
m_CurrentBroadCaster = partId;
videoMixer.SetSlot(mosaicId,0,partId);
}
else
{
Log("BroadCaster already exist send fpu everybody\n");
//Participants::iterator it = participants.find(m_CurrentBroadCaster);
//if (it == participants.end())
//{
// return Error("Participant not found\n");
//}
//it->second->SendVideoFPU();
}
//add for rtsp watcher by end
//.........这里部分代码省略.........