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

manager: allow switchInput on conference

Change-Id: I83e6fe6ff660fb5dc6dc2b834131dcb098d13ade
parent 84ad5808
Branches
No related tags found
No related merge requests found
......@@ -150,10 +150,19 @@ bool Conference::toggleRecording()
return startRecording;
}
std::string Conference::getConfID() const {
const std::string&
Conference::getConfID() const {
return id_;
}
void
Conference::switchInput(const std::string& input)
{
#ifdef ENABLE_VIDEO
getVideoMixer()->switchInput(input);
#endif
}
#ifdef ENABLE_VIDEO
std::shared_ptr<video::VideoMixer> Conference::getVideoMixer()
{
......
......@@ -58,7 +58,7 @@ class Conference : public Recordable {
/**
* Return the conference id
*/
std::string getConfID() const;
const std::string& getConfID() const;
/**
* Return the current conference state
......@@ -104,7 +104,9 @@ class Conference : public Recordable {
/**
* Start/stop recording toggle
*/
virtual bool toggleRecording();
bool toggleRecording() override;
void switchInput(const std::string& input);
#ifdef ENABLE_VIDEO
std::shared_ptr<video::VideoMixer> getVideoMixer();
......
......@@ -2236,14 +2236,15 @@ Manager::getCurrentAudioDevicesIndex()
bool
Manager::switchInput(const std::string& call_id, const std::string& res)
{
auto call = getCallFromCallID(call_id);
if (!call) {
JAMI_ERR("Call %s is NULL", call_id.c_str());
return false;
}
if (auto conf = getConferenceFromID(call_id)) {
conf->switchInput(res);
return true;
} else if (auto call = getCallFromCallID(call_id)) {
call->switchInput(res);
return true;
}
return false;
}
int
Manager::isRingtoneEnabled(const std::string& id)
......
......@@ -88,6 +88,15 @@ VideoMixer::~VideoMixer()
loop_.join();
}
void
VideoMixer::switchInput(const std::string& input)
{
if (auto local = videoLocal_) {
if (auto localInput = std::dynamic_pointer_cast<VideoInput>(local))
localInput->switchInput(input);
}
}
void
VideoMixer::attached(Observable<std::shared_ptr<MediaFrame>>* ob)
{
......
......@@ -54,6 +54,8 @@ public:
void attached(Observable<std::shared_ptr<MediaFrame>>* ob) override;
void detached(Observable<std::shared_ptr<MediaFrame>>* ob) override;
void switchInput(const std::string& input);
private:
NON_COPYABLE(VideoMixer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment