void OneToManyProcessor::addSubscriber(MediaSink* webRtcConn, const std::string& peerId) { ELOG_DEBUG("Adding subscriber"); boost::mutex::scoped_lock lock(myMonitor_); ELOG_DEBUG("From %u, %u ", publisher->getAudioSourceSSRC() , publisher->getVideoSourceSSRC()); webRtcConn->setAudioSinkSSRC(this->publisher->getAudioSourceSSRC()); webRtcConn->setVideoSinkSSRC(this->publisher->getVideoSourceSSRC()); ELOG_DEBUG("Subscribers ssrcs: Audio %u, video, %u from %u, %u ", webRtcConn->getAudioSinkSSRC(), webRtcConn->getVideoSinkSSRC(), this->publisher->getAudioSourceSSRC() , this->publisher->getVideoSourceSSRC()); FeedbackSource* fbsource = webRtcConn->getFeedbackSource(); if (fbsource!=NULL){ ELOG_DEBUG("adding fbsource"); fbsource->setFeedbackSink(this); } this->subscribers[peerId] = sink_ptr(webRtcConn); }
void OneToManyProcessor::addSubscriber(MediaSink* webRtcConn, const std::string& peerId) { ELOG_DEBUG("Adding subscriber"); boost::mutex::scoped_lock lock(myMonitor_); ELOG_DEBUG("From %u, %u ", publisher->getAudioSourceSSRC(), publisher->getVideoSourceSSRC()); webRtcConn->setAudioSinkSSRC(this->publisher->getAudioSourceSSRC()); webRtcConn->setVideoSinkSSRC(this->publisher->getVideoSourceSSRC()); ELOG_DEBUG("Subscribers ssrcs: Audio %u, video, %u from %u, %u ", webRtcConn->getAudioSinkSSRC(), webRtcConn->getVideoSinkSSRC(), this->publisher->getAudioSourceSSRC() , this->publisher->getVideoSourceSSRC()); FeedbackSource* fbsource = webRtcConn->getFeedbackSource(); if (fbsource != NULL) { ELOG_DEBUG("adding fbsource"); fbsource->setFeedbackSink(this); } if (this->subscribers.find(peerId) != subscribers.end()) { ELOG_WARN("This OTM already has a subscriber with peerId %s, substituting it", peerId.c_str()); this->subscribers.erase(peerId); } this->subscribers[peerId] = sink_ptr(webRtcConn); }