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
Branches
No related tags found
No related merge requests found
...@@ -334,6 +334,14 @@ VideoInput::deleteDecoder() ...@@ -334,6 +334,14 @@ VideoInput::deleteDecoder()
decoder_.reset(); decoder_.reset();
} }
void
VideoInput::stopInput()
{
clearOptions();
loop_.stop();
}
void VideoInput::clearOptions() void VideoInput::clearOptions()
{ {
decOpts_ = {}; decOpts_ = {};
......
...@@ -84,6 +84,8 @@ public: ...@@ -84,6 +84,8 @@ public:
*/ */
void* obtainFrame(int length); void* obtainFrame(int length);
void releaseFrame(void *frame); void releaseFrame(void *frame);
#else
void stopInput();
#endif #endif
private: private:
......
...@@ -91,11 +91,21 @@ VideoMixer::~VideoMixer() ...@@ -91,11 +91,21 @@ VideoMixer::~VideoMixer()
void void
VideoMixer::switchInput(const std::string& input) VideoMixer::switchInput(const std::string& input)
{ {
// Detach videoInput from mixer
videoLocal_->detach(this);
if (auto local = videoLocal_) { 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); localInput->switchInput(input);
} }
} }
// Re-attach videoInput to mixer
videoLocal_->attach(this);
}
void void
VideoMixer::attached(Observable<std::shared_ptr<MediaFrame>>* ob) VideoMixer::attached(Observable<std::shared_ptr<MediaFrame>>* ob)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment