Commit aa782278 authored by Éloi Bail's avatar Éloi Bail Committed by Stepan Salenikovich

daemon: emit signal when media parameters changed

User is able to change media parameters / account.
When a new parameter is set in daemon, a signal would be helpful to notify UI
to refresh its media information.
This patchset adds signal mediaParametersChanged broadcast if a new media
parameter is succesfully set in daemon. AccoundID is also specified in
parameters.

Refs #77483
Change-Id: I2efc0b260da5774fa56cda74f64c8dec209552df
parent 3939750f
......@@ -982,5 +982,18 @@
<arg type="a{ss}" name="shortcutsMap" direction="in">
</arg>
</method>
<signal name="mediaParametersChanged" tp:name-for-bindings="mediaParametersChanged">
<tp:added version="2.3.0"/>
<tp:docstring>
Notify clients that a media parameter changed.
</tp:docstring>
<arg type="s" name="accountID">
<tp:docstring>
An account id.
</tp:docstring>
</arg>
</signal>
</interface>
</node>
......@@ -192,6 +192,7 @@ DBusClient::initLibrary(int flags)
exportable_callback<ConfigurationSignal::CertificatePathPinned>(bind(&DBusConfigurationManager::certificatePathPinned, confM, _1, _2 )),
exportable_callback<ConfigurationSignal::CertificateExpired>(bind(&DBusConfigurationManager::certificateExpired, confM, _1 )),
exportable_callback<ConfigurationSignal::CertificateStateChanged>(bind(&DBusConfigurationManager::certificateStateChanged, confM, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::MediaParametersChanged>(bind(&DBusConfigurationManager::mediaParametersChanged, confM, _1 )),
};
// Presence event handlers
......
......@@ -401,6 +401,7 @@ setCodecDetails(const std::string& accountID,
if (codec->systemCodecInfo.mediaType & ring::MEDIA_AUDIO) {
if (auto foundCodec = std::static_pointer_cast<ring::AccountAudioCodecInfo>(codec)) {
foundCodec->setCodecSpecifications(details);
ring::emitSignal<ConfigurationSignal::MediaParametersChanged>(accountID);
return true;
}
}
......@@ -416,6 +417,7 @@ setCodecDetails(const std::string& accountID,
auto call = ring::Manager::instance().getCurrentCall();
call->restartMediaSender();
}
ring::emitSignal<ConfigurationSignal::MediaParametersChanged>(accountID);
return true;
}
}
......
......@@ -76,6 +76,7 @@ getSignalHandlers()
exported_callback<DRing::ConfigurationSignal::CertificateStateChanged>(),
exported_callback<DRing::ConfigurationSignal::IncomingAccountMessage>(),
exported_callback<DRing::ConfigurationSignal::IncomingTrustRequest>(),
exported_callback<DRing::ConfigurationSignal::MediaParametersChanged>(),
exported_callback<DRing::ConfigurationSignal::Error>(),
#ifdef __ANDROID__
exported_callback<DRing::ConfigurationSignal::GetHardwareAudioFormat>(),
......
......@@ -210,6 +210,10 @@ struct ConfigurationSignal {
constexpr static const char* name = "CertificateStateChanged";
using cb_type = void(const std::string& /*account_id*/, const std::string& /*certId*/, const std::string& /*state*/);
};
struct MediaParametersChanged {
constexpr static const char* name = "MediaParametersChanged";
using cb_type = void(const std::string& /*accountId*/);
};
#ifdef __ANDROID__
/**
* These are special getters for Android so the daemon can retreive
......
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