conference: only create video mixer if needed

This avoids video mixer/camera access for calls with no video

Refs #45998

Change-Id: I5d1a6776a861bbd883863e02c6a02e682def4b0e
This commit is contained in:
Tristan Matthews
2014-04-23 15:42:07 -04:00
parent 2355b71e94
commit e1b19d8f1d
2 changed files with 5 additions and 2 deletions

View File

@ -51,7 +51,7 @@ Conference::Conference()
, confState_(ACTIVE_ATTACHED) , confState_(ACTIVE_ATTACHED)
, participants_() , participants_()
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
, videoMixer_(new sfl_video::VideoMixer(id_)) , videoMixer_(nullptr)
#endif #endif
{ {
Recordable::initRecFilename(id_); Recordable::initRecFilename(id_);
@ -184,6 +184,8 @@ std::string Conference::getConfID() const {
#ifdef SFL_VIDEO #ifdef SFL_VIDEO
std::shared_ptr<sfl_video::VideoMixer> Conference::getVideoMixer() std::shared_ptr<sfl_video::VideoMixer> Conference::getVideoMixer()
{ {
if (!videoMixer_)
videoMixer_.reset(new sfl_video::VideoMixer(id_));
return videoMixer_; return videoMixer_;
} }
#endif #endif

View File

@ -246,7 +246,8 @@ void VideoRtpSession::setupConferenceVideoPipeline()
void VideoRtpSession::getMixerFromConference(Conference &conf) void VideoRtpSession::getMixerFromConference(Conference &conf)
{ {
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
videoMixerSP_ = std::move(conf.getVideoMixer()); if (sending_ or receiving_)
videoMixerSP_ = std::move(conf.getVideoMixer());
} }
void VideoRtpSession::enterConference(Conference *conf) void VideoRtpSession::enterConference(Conference *conf)