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> { ...@@ -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); void updateDetails(const std::map<std::string, std::string>& details);
bool hasVideo() const { return not isAudioOnly_; }
protected: protected:
virtual void merge(Call& scall); virtual void merge(Call& scall);
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "audio/ringbufferpool.h" #include "audio/ringbufferpool.h"
#include "dring/media_const.h" #include "dring/media_const.h"
#include "libav_utils.h" #include "libav_utils.h"
#include "call_const.h"
#include <functional> #include <functional>
#include <memory> #include <memory>
...@@ -463,10 +464,12 @@ bool ...@@ -463,10 +464,12 @@ bool
switchInput(const std::string& resource) switchInput(const std::string& resource)
{ {
if (auto call = jami::Manager::instance().getCurrentCall()) { if (auto call = jami::Manager::instance().getCurrentCall()) {
if (call->hasVideo()) {
// TODO remove this part when clients are updated to use Calljami::Manager::switchInput // TODO remove this part when clients are updated to use Calljami::Manager::switchInput
call->switchInput(resource); call->switchInput(resource);
return true; return true;
} else { }
}
bool ret = true; bool ret = true;
if (auto input = jami::Manager::instance().getVideoManager().videoInput.lock()) if (auto input = jami::Manager::instance().getVideoManager().videoInput.lock())
ret = input->switchInput(resource).valid(); ret = input->switchInput(resource).valid();
...@@ -476,7 +479,6 @@ switchInput(const std::string& resource) ...@@ -476,7 +479,6 @@ switchInput(const std::string& resource)
if (auto input = jami::getAudioInput(jami::RingBufferPool::DEFAULT_ID)) if (auto input = jami::getAudioInput(jami::RingBufferPool::DEFAULT_ID))
ret &= input->switchInput(resource).valid(); ret &= input->switchInput(resource).valid();
return ret; return ret;
}
} }
bool 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