Commit 94c8f4b6 authored by Philippe Gorley's avatar Philippe Gorley Committed by Philippe Gorley

accel: add signals when toggled

Preemptively adds signal for hardware encoding so version won't have to
be bumped again.

Change-Id: Ie3b828671fab3628853b85a2a8259200e9a809c0
Gitlab: #55
parent 8d0d80b3
......@@ -779,6 +779,24 @@
</arg>
</method>
<!-- Hardware encoding/decoding signals -->
<signal name="hardwareDecodingChanged" tp:name-for-bindings="hardwareDecodingChanged">
<arg type="b" name="state">
<tp:docstring>
If hardware decoding is enabled
</tp:docstring>
</arg>
<tp:docstring>Signal triggered when hardware decoding changes.</tp:docstring>
</signal>
<signal name="hardwareEncodingChanged" tp:name-for-bindings="hardwareEncodingChanged">
<arg type="b" name="state">
<tp:docstring>
If hardware encoding is enabled
</tp:docstring>
</arg>
<tp:docstring>Signal triggered when hardware encoding changes.</tp:docstring>
</signal>
<!-- Audio devices methods -->
<method name="getAudioPluginList" tp:name-for-bindings="getAudioPluginList">
......
......@@ -186,6 +186,8 @@ DBusClient::initLibrary(int flags)
exportable_callback<ConfigurationSignal::CertificateStateChanged>(bind(&DBusConfigurationManager::certificateStateChanged, confM, _1, _2, _3 )),
exportable_callback<ConfigurationSignal::MediaParametersChanged>(bind(&DBusConfigurationManager::mediaParametersChanged, confM, _1 )),
exportable_callback<ConfigurationSignal::MigrationEnded>(bind(&DBusConfigurationManager::migrationEnded, confM, _1, _2 )),
exportable_callback<ConfigurationSignal::HardwareDecodingChanged>(bind(&DBusConfigurationManager::hardwareDecodingChanged, confM, _1 )),
exportable_callback<ConfigurationSignal::HardwareEncodingChanged>(bind(&DBusConfigurationManager::hardwareEncodingChanged, confM, _1 )),
};
// Presence event handlers
......
......@@ -56,6 +56,9 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
};
%}
......@@ -247,4 +250,7 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
};
......@@ -235,4 +235,8 @@ public:
virtual void migrationEnded(const std::string& /*accountId*/, const std::string& /*state*/){}
virtual void deviceRevocationEnded(const std::string& /*accountId*/, const std::string& /*device*/, int /*status*/){}
virtual void hardwareDecodingChanged(bool /*state*/){}
virtual void hardwareEncodingChanged(bool /*state*/){}
};
......@@ -2,7 +2,7 @@ dnl Jami - configure.ac for automake 1.9 and autoconf 2.59
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([Ring Daemon],[7.2.0],[ring@gnu.org],[ring])
AC_INIT([Ring Daemon],[7.3.0],[ring@gnu.org],[ring])
AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-2018]])
AC_REVISION([$Revision$])
......
......@@ -81,6 +81,8 @@ getSignalHandlers()
exported_callback<DRing::ConfigurationSignal::GetAppDataPath>(),
exported_callback<DRing::ConfigurationSignal::GetDeviceName>(),
#endif
exported_callback<DRing::ConfigurationSignal::HardwareDecodingChanged>(),
exported_callback<DRing::ConfigurationSignal::HardwareEncodingChanged>(),
/* Debug */
exported_callback<DRing::DebugSignal::MessageSend>(),
......@@ -135,4 +137,4 @@ registerSignalHandlers(const std::map<std::string,
}
}
}
\ No newline at end of file
}
......@@ -338,6 +338,14 @@ struct DRING_PUBLIC ConfigurationSignal {
using cb_type = void(std::vector<std::string>* /* path_ret */);
};
#endif
struct DRING_PUBLIC HardwareDecodingChanged {
constexpr static const char* name = "HardwareDecodingChanged";
using cb_type = void(bool /* state */);
};
struct DRING_PUBLIC HardwareEncodingChanged {
constexpr static const char* name = "HardwareEncodingChanged";
using cb_type = void(bool /* state */);
};
};
// Can be used when a client's stdout is not available
......
......@@ -35,6 +35,7 @@
#include "string_utils.h"
#include "logger.h"
#include "client/ring_signal.h"
#include <iostream>
#include <unistd.h>
......@@ -381,6 +382,7 @@ void
MediaDecoder::enableAccel(bool enableAccel)
{
enableAccel_ = enableAccel;
emitSignal<DRing::ConfigurationSignal::HardwareDecodingChanged>(enableAccel_);
if (!enableAccel) {
accel_ = {};
if (decoderCtx_->hw_device_ctx)
......
......@@ -22,6 +22,7 @@
#define __PREFERENCE_H__
#include "config/serializable.h"
#include "client/ring_signal.h"
#include <string>
#include <map>
#include <vector>
......@@ -462,6 +463,7 @@ class VideoPreferences : public Serializable {
void setDecodingAccelerated(bool decodingAccelerated) {
decodingAccelerated_ = decodingAccelerated;
emitSignal<DRing::ConfigurationSignal::HardwareDecodingChanged>(decodingAccelerated_);
}
private:
......
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