Skip to content
Snippets Groups Projects
Commit 3df31d22 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Sébastien Blin
Browse files

conference: fix audio only call for conference

Change-Id: I4ac35628dff7e8c5a686a184e00228cd2c61a134
parent 3ff1548d
No related branches found
No related tags found
No related merge requests found
......@@ -1593,8 +1593,6 @@ SIPCall::initMediaStreams(const std::vector<MediaAttribute>& mediaAttrList)
stream.mediaAttribute_->toString(true).c_str());
}
assert(rtpStreams_.size() == mediaAttrList.size());
JAMI_DBG("[call:%s] Created %lu Media streams", getCallId().c_str(), rtpStreams_.size());
return rtpStreams_.size();
......@@ -2318,10 +2316,20 @@ SIPCall::enterConference(const std::string& confId)
JAMI_ERR("Unknown conference [%s]", confId.c_str());
return;
}
auto const& videoRtp = getVideoRtp();
if (videoRtp)
auto videoRtp = getVideoRtp();
if (not videoRtp) {
// In conference, we need to have a video RTP session even
// if it's an audio only call
videoRtp = addDummyVideoRtpSession();
if (not videoRtp) {
throw std::runtime_error("Failed to create dummy RTP video session");
}
}
videoRtp->enterConference(conf.get());
#endif
#ifdef ENABLE_PLUGIN
clearCallAVStreams();
#endif
......@@ -2340,6 +2348,34 @@ SIPCall::exitConference()
#endif
}
std::shared_ptr<Observable<std::shared_ptr<MediaFrame>>>
SIPCall::getReceiveVideoFrameActiveWriter()
{
#ifdef ENABLE_VIDEO
auto videoRtp = getVideoRtp();
if (videoRtp)
return videoRtp->getReceiveVideoFrameActiveWriter();
#endif
return {};
}
std::shared_ptr<video::VideoRtpSession>
SIPCall::addDummyVideoRtpSession()
{
#ifdef ENABLE_VIDEO
MediaAttribute mediaAttr(MediaType::MEDIA_VIDEO, true, true, false, "", "dummy video session");
addMediaStream(mediaAttr);
auto& stream = rtpStreams_.back();
createRtpSession(stream);
if (stream.rtpSession_) {
return std::dynamic_pointer_cast<video::VideoRtpSession>(stream.rtpSession_);
}
#endif
return {};
}
std::shared_ptr<AudioRtpSession>
SIPCall::getAudioRtp() const
{
......
......@@ -151,15 +151,7 @@ public:
void enterConference(const std::string& confId) override;
void exitConference() override;
std::shared_ptr<Observable<std::shared_ptr<MediaFrame>>> getReceiveVideoFrameActiveWriter()
override
{
auto const& videoRtp = getVideoRtp();
if (videoRtp)
return videoRtp->getReceiveVideoFrameActiveWriter();
return nullptr;
}
override;
bool hasVideo() const override;
bool isAudioMuted() const override;
bool isVideoMuted() const override;
......@@ -257,6 +249,7 @@ public:
* Returns a pointer to the VideoRtp object
*/
std::shared_ptr<video::VideoRtpSession> getVideoRtp() const;
std::shared_ptr<video::VideoRtpSession> addDummyVideoRtpSession();
#endif
void setSecure(bool sec);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment