Skip to content
Snippets Groups Projects
Commit d8cf4e97 authored by Pierre Lespagnol's avatar Pierre Lespagnol Committed by Sébastien Blin
Browse files

conference: fix switch input for conference

Change-Id: I9a4dbce6a574da439a627f99cb60e5aa0926bc7c
parent 151e8412
No related branches found
No related tags found
No related merge requests found
......@@ -334,6 +334,14 @@ VideoInput::deleteDecoder()
decoder_.reset();
}
void
VideoInput::stopInput()
{
clearOptions();
loop_.stop();
}
void VideoInput::clearOptions()
{
decOpts_ = {};
......
......@@ -84,6 +84,8 @@ public:
*/
void* obtainFrame(int length);
void releaseFrame(void *frame);
#else
void stopInput();
#endif
private:
......
......@@ -91,10 +91,20 @@ VideoMixer::~VideoMixer()
void
VideoMixer::switchInput(const std::string& input)
{
// Detach videoInput from mixer
videoLocal_->detach(this);
if (auto local = videoLocal_) {
if (auto localInput = std::dynamic_pointer_cast<VideoInput>(local))
if (auto localInput = std::dynamic_pointer_cast<VideoInput>(local)) {
#if !VIDEO_CLIENT_INPUT
// Stop old VideoInput
localInput->stopInput();
#endif
// Start new VideoInput
localInput->switchInput(input);
}
}
// Re-attach videoInput to mixer
videoLocal_->attach(this);
}
void
......
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