Skip to content
Snippets Groups Projects
Commit 04a8dfa4 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

callmodel: fix mute video

Change-Id: Ic0c05b9099bc21b8ee936cbe3aef641534d55f77
parent cbef11a9
No related branches found
No related tags found
No related merge requests found
......@@ -320,14 +320,16 @@ AvAdapter::stopSharing(const QString& source)
->removeMedia(callId,
libjami::Media::Details::MEDIA_TYPE_VIDEO,
libjami::Media::VideoProtocolPrefix::DISPLAY,
muteCamera_);
muteCamera_,
true);
} else {
qDebug() << "Stopping file: " << source;
lrcInstance_->getCurrentCallModel()
->removeMedia(callId,
libjami::Media::Details::MEDIA_TYPE_VIDEO,
libjami::Media::VideoProtocolPrefix::FILE,
muteCamera_);
muteCamera_,
true);
}
}
}
......
......@@ -976,7 +976,7 @@ CallAdapter::muteCameraToggle()
callModel->removeMedia(callId,
libjami::Media::Details::MEDIA_TYPE_VIDEO,
libjami::Media::VideoProtocolPrefix::CAMERA,
mute);
mute, false);
else
callModel->addMedia(callId,
lrcInstance_->avModel().getCurrentVideoCaptureDevice(),
......
......@@ -125,11 +125,13 @@ public:
* @param source Of the media
* @param type Audio/video
* @param mute
* @param removeAll Remove Audio/Video
*/
void removeMedia(const QString& callId,
const QString& mediaType,
const QString& type,
bool muteCamera);
bool muteCamera,
bool removeAll);
/**
* Get the call from its call id
......
......@@ -613,7 +613,8 @@ void
CallModel::removeMedia(const QString& callId,
const QString& mediaType,
const QString& type,
bool muteCamera)
bool muteCamera,
bool removeAll)
{
auto& callInfo = pimpl_->calls[callId];
if (!callInfo)
......@@ -629,7 +630,7 @@ CallModel::removeMedia(const QString& callId,
replaceIdx = true;
label = media[MediaAttributeKey::LABEL];
} else {
if (!media[MediaAttributeKey::SOURCE].startsWith(type)) {
if (!removeAll || !media[MediaAttributeKey::SOURCE].startsWith(type)) {
if (media[MediaAttributeKey::MEDIA_TYPE] == mediaType) {
auto newMedia = media;
if (replaceIdx) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment