Skip to content
Snippets Groups Projects
Commit 7eb1e737 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

videomanager: don't start audio preview in switchInput

Change-Id: I820d008b9f437e4396f076fade34f3f9d9f8d053
parent e7b3b5e4
Branches
Tags
No related merge requests found
...@@ -457,7 +457,6 @@ startCamera() ...@@ -457,7 +457,6 @@ startCamera()
void void
stopCamera() stopCamera()
{ {
if (switchInput(""))
jami::Manager::instance().getVideoManager().started = false; jami::Manager::instance().getVideoManager().started = false;
jami::Manager::instance().getVideoManager().videoPreview.reset(); jami::Manager::instance().getVideoManager().videoPreview.reset();
} }
...@@ -467,6 +466,7 @@ startAudioDevice() ...@@ -467,6 +466,7 @@ startAudioDevice()
{ {
jami::Manager::instance().getVideoManager().audioPreview = jami::getAudioInput( jami::Manager::instance().getVideoManager().audioPreview = jami::getAudioInput(
jami::RingBufferPool::DEFAULT_ID); jami::RingBufferPool::DEFAULT_ID);
jami::Manager::instance().getVideoManager().audioPreview->switchInput("");
} }
void void
...@@ -520,20 +520,13 @@ stopLocalRecorder(const std::string& filepath) ...@@ -520,20 +520,13 @@ stopLocalRecorder(const std::string& filepath)
bool bool
switchInput(const std::string& resource) switchInput(const std::string& resource)
{ {
if (auto call = jami::Manager::instance().getCurrentCall()) {
if (call->hasVideo()) {
// TODO remove this part when clients are updated to use Calljami::Manager::switchInput
call->switchInput(resource);
return true;
}
}
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();
else else
JAMI_WARN("Video input not initialized"); JAMI_WARN("Video input not initialized");
if (auto input = jami::getAudioInput(jami::RingBufferPool::DEFAULT_ID)) if (auto input = jami::Manager::instance().getVideoManager().audioPreview)
ret &= input->switchInput(resource).valid(); ret &= input->switchInput(resource).valid();
return ret; return ret;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment