Commit 0f22a36f authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk

videomanger: modify the switchInput method to allow previewing in the setting

- now, audio only call can be allowed to enable the previewing in the setting
- in LRC, call start startpreview

Change-Id: I671841ee663fdf50790d772ce6298d1d5bd88900
parent 510b5a17
......@@ -316,6 +316,8 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
*/
void updateDetails(const std::map<std::string, std::string>& details);
bool hasVideo() const { return not isAudioOnly_; }
protected:
virtual void merge(Call& scall);
......
......@@ -36,6 +36,7 @@
#include "audio/ringbufferpool.h"
#include "dring/media_const.h"
#include "libav_utils.h"
#include "call_const.h"
#include <functional>
#include <memory>
......@@ -463,20 +464,21 @@ bool
switchInput(const std::string& resource)
{
if (auto call = jami::Manager::instance().getCurrentCall()) {
// TODO remove this part when clients are updated to use Calljami::Manager::switchInput
call->switchInput(resource);
return true;
} else {
bool ret = true;
if (auto input = jami::Manager::instance().getVideoManager().videoInput.lock())
ret = input->switchInput(resource).valid();
else
JAMI_WARN("Video input not initialized");
if (auto input = jami::getAudioInput(jami::RingBufferPool::DEFAULT_ID))
ret &= input->switchInput(resource).valid();
return ret;
if (call->hasVideo()) {
// TODO remove this part when clients are updated to use Calljami::Manager::switchInput
call->switchInput(resource);
return true;
}
}
bool ret = true;
if (auto input = jami::Manager::instance().getVideoManager().videoInput.lock())
ret = input->switchInput(resource).valid();
else
JAMI_WARN("Video input not initialized");
if (auto input = jami::getAudioInput(jami::RingBufferPool::DEFAULT_ID))
ret &= input->switchInput(resource).valid();
return ret;
}
bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment