Commit bb3864db authored by sivakumarmani's avatar sivakumarmani

Merge pull request #1 from 01org/master

Pull updates from master upstream.
parents 951a4520 e9cae3c6
version 0.4.0
- Logs: provide correct component version
- Fix typos in the rendererconsole.py test application
- Use GUPnP Mime Type if available
https://github.com/01org/dleyna-renderer/issues/120
- Fix dlr_device_set_position implementation
https://github.com/01org/dleyna-renderer/issues/115
- Fix dlr_device_seek implementation
https://github.com/01org/dleyna-renderer/issues/115
- Fix a couple of memory leaks
- New network filtering API
- The 'never quit' option can be set via the connector
version 0.2.2
- Various build optimizations
- Fix a crash case when the server stops
......
AC_PREREQ([2.66])
AC_INIT([dleyna-renderer],
[0.2.3],
[0.5.0],
[https://github.com/01org/dleyna-renderer/issues/new],
,
[https://01.org/dleyna/])
......@@ -83,7 +83,7 @@ AC_ARG_ENABLE(master-build,,
[master_build=no])
AS_IF([test "x$master_build" = "xno"],
[PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.2.2])],
[PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.4.0])],
[this_abs_top_srcdir=`cd "$srcdir" && pwd`;
DLEYNA_CORE_CFLAGS="-I$this_abs_top_srcdir/../dleyna-core";
DLEYNA_CORE_LIBS="-L$this_abs_top_srcdir/../dleyna-core/.libs -ldleyna-core-1.0"
......@@ -232,7 +232,6 @@ AC_SUBST([with_log_type])
AC_CONFIG_FILES([Makefile \
libdleyna/renderer/Makefile \
libdleyna/renderer/dleyna-renderer-1.0.pc \
libdleyna/renderer/dleyna-renderer-service.conf \
server/dleyna-renderer-service-1.0.pc \
server/Makefile
......
......@@ -38,7 +38,7 @@ com.intel.dLeynaRenderer.Manager
Methods:
----------
The interface com.intel.dLeynaRenderer.Manager contains 8
The interface com.intel.dLeynaRenderer.Manager contains 4
methods. Descriptions of each of these methods along with their d-Bus
signatures are given below.
......@@ -72,24 +72,6 @@ discover new DMRs which for some reason were not detected when either
they, or the device on which dLeyna-renderer runs, was started or joined
the network. New in version 0.0.2.
WhiteListEnable(b enabled) -> void
Enable or disable the Network Filtering feature.
When enabled, only devices that are on allowed networks will be available.
WhiteListAddEntries(as EntryList) -> void
Add new entries to the list of allowed networks. An Entry could be an interface
name (eth0), an ip address (127.0.0.1) or a SSID (MyWiFi)
WhiteListRemoveEntries(as EntryList) -> void
Remove entries from the list of allowed networks.
WhiteListClear() -> void
Remove all entries from the list, but it doesn't change the 'enabled' flag.
Properties:
---------
......@@ -100,15 +82,23 @@ of d-Bus properties. These properties are described below:
|------------------------------------------------------------------------------|
| Name | Type |m/o*| Description |
|------------------------------------------------------------------------------|
| NeverQuit | b | m | True if the service always stay in |
| | | | memory running. False if the service |
| | | | quit when the last client disconnects. |
|------------------------------------------------------------------------------|
| WhiteListEntries | as | m | The list of entries that compose the |
| | | | white list used to filter the networks. |
| | | | An Entry could be an interface name |
| | | | (eth0), an ip address (127.0.0.1) or |
| | | | a SSID (MyWiFi) |
|------------------------------------------------------------------------------|
| WhiteListEnabled | b | m | True if the Network Filtering is active.|
|------------------------------------------------------------------------------|
A org.freedesktop.DBus.Properties.PropertiesChanged signal is emitted when
these properties change.
These properties can be changed using the Set() method of
org.freedesktop.DBus.Properties interface.
Signals:
---------
......
libdleyna_rendererincdir = $(includedir)/dleyna-1.0/libdleyna/renderer
DLEYNA_RENDERER_VERSION = 1:3:0
AM_CFLAGS = $(GLIB_CFLAGS) \
......@@ -16,6 +14,8 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
pkglib_LTLIBRARIES = libdleyna-renderer-1.0.la
libdleyna_rendererincdir = $(includedir)/dleyna-1.0/libdleyna/renderer
libdleyna_rendererinc_HEADERS = control-point-renderer.h
libdleyna_renderer_1_0_la_LDFLAGS = -version-info $(DLEYNA_RENDERER_VERSION) \
......@@ -51,9 +51,6 @@ MAINTAINERCLEANFILES = Makefile.in \
sysconf_DATA = dleyna-renderer-service.conf
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dleyna-renderer-1.0.pc
EXTRA_DIST = $(sysconf_DATA) \
async.h \
device.h \
......@@ -64,8 +61,8 @@ EXTRA_DIST = $(sysconf_DATA) \
task.h \
upnp.h
CLEANFILES = $(pkgconfig_DATA) dleyna-renderer-service.conf
DISTCLEANFILES = $(pkgconfig_DATA) dleyna-renderer-service.conf
CLEANFILES = dleyna-renderer-service.conf
DISTCLEANFILES = dleyna-renderer-service.conf
maintainer-clean-local:
rm -rf build-aux
......@@ -1118,16 +1118,36 @@ static GVariant *prv_as_prop_from_list(GList *list)
return g_variant_ref_sink(g_variant_builder_end(&vb));
}
static void prv_update_prop_dlna_device_classes(GUPnPDeviceInfo *proxy,
GHashTable *props)
static GVariant *prv_update_prop_dlna_device_classes(GUPnPDeviceInfo *proxy,
GHashTable *props)
{
GList *dlna_classes =
GVariant *retval;
GList *dlna_classes;
retval = g_hash_table_lookup(props,
DLR_INTERFACE_PROP_DLNA_DEVICE_CLASSES);
if (retval)
goto on_exit;
dlna_classes =
gupnp_device_info_list_dlna_device_class_identifier(proxy);
if (dlna_classes != NULL)
g_hash_table_insert(props,
DLR_INTERFACE_PROP_DLNA_DEVICE_CLASSES,
prv_as_prop_from_list(dlna_classes));
if (!dlna_classes)
goto on_exit;
retval = prv_as_prop_from_list(dlna_classes);
g_hash_table_insert(props, DLR_INTERFACE_PROP_DLNA_DEVICE_CLASSES,
retval);
/* TODO: We should actually be calling g_list_free_full here but the
strings in dlna_classes are allocated by libxml and not glib. So
until this is fixed we're stuck with this. */
g_list_free(dlna_classes);
on_exit:
return retval;
}
static void prv_add_actions(dlr_device_t *device,
......@@ -1165,10 +1185,8 @@ static void prv_add_actions(dlr_device_t *device,
info = (GUPnPDeviceInfo *)dlr_device_get_context(device)->device_proxy;
prv_update_prop_dlna_device_classes(info, device->props.device_props);
val = g_hash_table_lookup(device->props.device_props,
DLR_INTERFACE_PROP_DLNA_DEVICE_CLASSES);
val = prv_update_prop_dlna_device_classes(info,
device->props.device_props);
/* If this device is not dlna compatible, there is no need */
/* to check for “X_DLNA_SeekTime” */
......@@ -2234,7 +2252,7 @@ static void prv_update_device_props(GUPnPDeviceInfo *proxy, GHashTable *props)
GVariant *val;
gchar *str;
prv_update_prop_dlna_device_classes(proxy, props);
(void) prv_update_prop_dlna_device_classes(proxy, props);
val = g_variant_ref_sink(g_variant_new_string(
gupnp_device_info_get_device_type(proxy)));
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libexecdir=@libexecdir@
includedir=${prefix}/include
libdir=@libdir@/@PACKAGE@
Name: @PACKAGE@
Description: UPnP & DLNA renderer library
Libs: -L${libdir} -ldleyna-renderer-1.0
Requires.private: glib-2.0 gio-2.0 libsoup-2.4 gupnp-1.0 gupnp-av-1.0 dleyna-core-1.0
Version: @VERSION@
\ No newline at end of file
This diff is collapsed.
......@@ -24,6 +24,7 @@
#define DLR_MANAGER_H__
#include <libdleyna/core/connector.h>
#include <libdleyna/core/settings.h>
#include <libgupnp/gupnp-context-manager.h>
#include "task.h"
......@@ -36,19 +37,20 @@ dlr_manager_t *dlr_manager_new(dleyna_connector_id_t connection,
void dlr_manager_delete(dlr_manager_t *manager);
void dlr_manager_wl_enable(dlr_task_t *task);
void dlr_manager_wl_add_entries(dlr_task_t *task);
void dlr_manager_wl_remove_entries(dlr_task_t *task);
void dlr_manager_wl_clear(dlr_task_t *task);
dleyna_white_list_t *dlr_manager_get_white_list(dlr_manager_t *manager);
void dlr_manager_get_all_props(dlr_manager_t *manager,
dleyna_settings_t *settings,
dlr_task_t *task,
dlr_manager_task_complete_t cb);
void dlr_manager_get_prop(dlr_manager_t *manager,
dleyna_settings_t *settings,
dlr_task_t *task,
dlr_manager_task_complete_t cb);
void dlr_manager_set_prop(dlr_manager_t *manager,
dleyna_settings_t *settings,
dlr_task_t *task,
dlr_manager_task_complete_t cb);
......
......@@ -30,6 +30,7 @@
#define DLR_INTERFACE_PROPERTIES_CHANGED "PropertiesChanged"
/* Manager Properties */
#define DLR_INTERFACE_PROP_NEVER_QUIT "NeverQuit"
#define DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES "WhiteListEntries"
#define DLR_INTERFACE_PROP_WHITE_LIST_ENABLED "WhiteListEnabled"
......
......@@ -34,6 +34,7 @@
#include <libdleyna/core/error.h>
#include <libdleyna/core/log.h>
#include <libdleyna/core/task-processor.h>
#include <libdleyna/core/white-list.h>
#include "async.h"
#include "control-point-renderer.h"
......@@ -150,30 +151,18 @@ static const gchar g_root_introspection[] =
" </method>"
" <method name='"DLR_INTERFACE_RESCAN"'>"
" </method>"
" <method name='"DLR_INTERFACE_WHITE_LIST_ENABLE"'>"
" <arg type='b' name='"DLR_INTERFACE_IS_ENABLED"'"
" direction='in'/>"
" </method>"
" <method name='"DLR_INTERFACE_WHITE_LIST_ADD_ENTRIES"'>"
" <arg type='as' name='"DLR_INTERFACE_ENTRY_LIST"'"
" direction='in'/>"
" </method>"
" <method name='"DLR_INTERFACE_WHITE_LIST_REMOVE_ENTRIES"'>"
" <arg type='as' name='"DLR_INTERFACE_ENTRY_LIST"'"
" direction='in'/>"
" </method>"
" <method name='"DLR_INTERFACE_WHITE_LIST_CLEAR"'>"
" </method>"
" <signal name='"DLR_INTERFACE_FOUND_RENDERER"'>"
" <arg type='o' name='"DLR_INTERFACE_PATH"'/>"
" </signal>"
" <signal name='"DLR_INTERFACE_LOST_RENDERER"'>"
" <arg type='o' name='"DLR_INTERFACE_PATH"'/>"
" </signal>"
" <property type='as' name='"DLR_INTERFACE_PROP_NEVER_QUIT"'"
" access='readwrite'/>"
" <property type='as' name='"DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES"'"
" access='read'/>"
" access='readwrite'/>"
" <property type='b' name='"DLR_INTERFACE_PROP_WHITE_LIST_ENABLED"'"
" access='read'/>"
" access='readwrite'/>"
" </interface>"
" <interface name='"DLR_INTERFACE_PROPERTIES"'>"
" <method name='"DLR_INTERFACE_GET"'>"
......@@ -190,6 +179,14 @@ static const gchar g_root_introspection[] =
" <arg type='a{sv}' name='"DLR_INTERFACE_PROPERTIES_VALUE"'"
" direction='out'/>"
" </method>"
" <method name='"DLR_INTERFACE_SET"'>"
" <arg type='s' name='"DLR_INTERFACE_INTERFACE_NAME"'"
" direction='in'/>"
" <arg type='s' name='"DLR_INTERFACE_PROPERTY_NAME"'"
" direction='in'/>"
" <arg type='v' name='"DLR_INTERFACE_VALUE"'"
" direction='in'/>"
" </method>"
" <signal name='"DLR_INTERFACE_PROPERTIES_CHANGED"'>"
" <arg type='s' name='"DLR_INTERFACE_INTERFACE_NAME"'/>"
" <arg type='a{sv}' name='"DLR_INTERFACE_CHANGED_PROPERTIES"'/>"
......@@ -533,22 +530,6 @@ static void prv_process_sync_task(dlr_task_t *task)
dlr_upnp_rescan(g_context.upnp);
dlr_task_complete(task);
break;
case DLR_TASK_WHITE_LIST_ENABLE:
dlr_manager_wl_enable(task);
dlr_task_complete(task);
break;
case DLR_TASK_WHITE_LIST_ADD_ENTRIES:
dlr_manager_wl_add_entries(task);
dlr_task_complete(task);
break;
case DLR_TASK_WHITE_LIST_REMOVE_ENTRIES:
dlr_manager_wl_remove_entries(task);
dlr_task_complete(task);
break;
case DLR_TASK_WHITE_LIST_CLEAR:
dlr_manager_wl_clear(task);
dlr_task_complete(task);
break;
case DLR_TASK_RAISE:
case DLR_TASK_QUIT:
error = g_error_new(DLEYNA_SERVER_ERROR,
......@@ -662,12 +643,16 @@ static void prv_process_async_task(dlr_task_t *task)
prv_async_task_complete);
break;
case DLR_TASK_MANAGER_GET_PROP:
dlr_manager_get_prop(g_context.manager, task,
prv_async_task_complete);
dlr_manager_get_prop(g_context.manager, g_context.settings,
task, prv_async_task_complete);
break;
case DLR_TASK_MANAGER_GET_ALL_PROPS:
dlr_manager_get_all_props(g_context.manager, task,
prv_async_task_complete);
dlr_manager_get_all_props(g_context.manager, g_context.settings,
task, prv_async_task_complete);
break;
case DLR_TASK_MANAGER_SET_PROP:
dlr_manager_set_prop(g_context.manager, g_context.settings,
task, prv_async_task_complete);
break;
default:
break;
......@@ -796,18 +781,6 @@ static void prv_manager_root_method_call(
task = dlr_task_get_servers_new(invocation);
else if (!strcmp(method, DLR_INTERFACE_RESCAN))
task = dlr_task_rescan_new(invocation);
else if (!strcmp(method, DLR_INTERFACE_WHITE_LIST_ENABLE))
task = dlr_task_wl_enable_new(invocation,
parameters);
else if (!strcmp(method, DLR_INTERFACE_WHITE_LIST_ADD_ENTRIES))
task = dlr_task_wl_add_entries_new(invocation,
parameters);
else if (!strcmp(method,
DLR_INTERFACE_WHITE_LIST_REMOVE_ENTRIES))
task = dlr_task_wl_remove_entries_new(invocation,
parameters);
else if (!strcmp(method, DLR_INTERFACE_WHITE_LIST_CLEAR))
task = dlr_task_wl_clear_new(invocation);
else
goto finished;
......@@ -836,6 +809,9 @@ static void prv_manager_props_method_call(dleyna_connector_id_t conn,
else if (!strcmp(method, DLR_INTERFACE_GET))
task = dlr_task_manager_get_prop_new(invocation, object,
parameters, &error);
else if (!strcmp(method, DLR_INTERFACE_SET))
task = dlr_task_manager_set_prop_new(invocation, object,
parameters, &error);
else
goto finished;
......@@ -1113,6 +1089,25 @@ static void prv_lost_media_server(const gchar *path)
dleyna_task_processor_remove_queues_for_sink(g_context.processor, path);
}
static void prv_white_list_init(void)
{
gboolean enabled;
GVariant *entries;
dleyna_white_list_t *wl;
DLEYNA_LOG_DEBUG("Enter");
enabled = dleyna_settings_is_white_list_enabled(g_context.settings);
entries = dleyna_settings_white_list_entries(g_context.settings);
wl = dlr_manager_get_white_list(g_context.manager);
dleyna_white_list_enable(wl, enabled);
dleyna_white_list_add_entries(wl, entries);
DLEYNA_LOG_DEBUG("Exit");
}
static gboolean prv_control_point_start_service(
dleyna_connector_id_t connection)
{
......@@ -1136,13 +1131,13 @@ static gboolean prv_control_point_start_service(
prv_lost_media_server);
g_context.manager = dlr_manager_new(connection,
dlr_upnp_get_context_manager(g_context.upnp));
dlr_upnp_get_context_manager(
g_context.upnp));
prv_white_list_init();
} else {
retval = FALSE;
}
dleyna_settings_init_white_list(g_context.settings);
return retval;
}
......
......@@ -106,6 +106,7 @@ static void prv_dlr_task_delete(dlr_task_t *task)
g_free(task->ut.get_prop.interface_name);
g_free(task->ut.get_prop.prop_name);
break;
case DLR_TASK_MANAGER_SET_PROP:
case DLR_TASK_SET_PROP:
g_free(task->ut.set_prop.interface_name);
g_free(task->ut.set_prop.prop_name);
......@@ -126,10 +127,6 @@ static void prv_dlr_task_delete(dlr_task_t *task)
g_free(task->ut.get_icon.mime_type);
g_free(task->ut.get_icon.resolution);
break;
case DLR_TASK_WHITE_LIST_ADD_ENTRIES:
case DLR_TASK_WHITE_LIST_REMOVE_ENTRIES:
if (task->ut.white_list.entries != NULL)
g_variant_unref(task->ut.white_list.entries);
default:
break;
}
......@@ -429,75 +426,22 @@ dlr_task_t *dlr_task_get_icon_new(dleyna_connector_msg_id_t invocation,
return task;
}
dlr_task_t *dlr_task_wl_enable_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters)
{
dlr_task_t *task = g_new0(dlr_task_t, 1);
task->type = DLR_TASK_WHITE_LIST_ENABLE;
task->invocation = invocation;
task->synchronous = TRUE;
g_variant_get(parameters, "(b)",
&task->ut.white_list.enabled);
return task;
}
dlr_task_t *dlr_task_wl_clear_new(dleyna_connector_msg_id_t invocation)
{
dlr_task_t *task = g_new0(dlr_task_t, 1);
task->type = DLR_TASK_WHITE_LIST_CLEAR;
task->invocation = invocation;
task->synchronous = TRUE;
return task;
}
dlr_task_t *dlr_task_wl_add_entries_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters)
{
dlr_task_t *task = g_new0(dlr_task_t, 1);
task->type = DLR_TASK_WHITE_LIST_ADD_ENTRIES;
task->invocation = invocation;
task->synchronous = TRUE;
g_variant_get(parameters, "(@as)", &task->ut.white_list.entries);
return task;
}
dlr_task_t *dlr_task_wl_remove_entries_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters)
{
dlr_task_t *task = g_new0(dlr_task_t, 1);
task->type = DLR_TASK_WHITE_LIST_REMOVE_ENTRIES;
task->invocation = invocation;
task->synchronous = TRUE;
g_variant_get(parameters, "(@as)", &task->ut.white_list.entries);
return task;
}
dlr_task_t *dlr_task_manager_get_prop_new(dleyna_connector_msg_id_t invocation,
const gchar *path,
GVariant *parameters,
GError **error)
{
dlr_task_t *task = (dlr_task_t *)g_new0(dlr_async_task_t, 1);
dlr_task_t *task;
task = prv_device_task_new(DLR_TASK_MANAGER_GET_PROP, invocation,
path, "(v)");
g_variant_get(parameters, "(ss)", &task->ut.get_prop.interface_name,
&task->ut.get_prop.prop_name);
g_strstrip(task->ut.get_prop.interface_name);
g_strstrip(task->ut.get_prop.prop_name);
task->path = g_strstrip(g_strdup(path));
task->type = DLR_TASK_MANAGER_GET_PROP;
task->invocation = invocation;
task->result_format = "(v)";
return task;
}
......@@ -506,16 +450,32 @@ dlr_task_t *dlr_task_manager_get_props_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters,
GError **error)
{
dlr_task_t *task = (dlr_task_t *)g_new0(dlr_async_task_t, 1);
dlr_task_t *task;
task = prv_device_task_new(DLR_TASK_MANAGER_GET_ALL_PROPS, invocation,
path, "(@a{sv})");
g_variant_get(parameters, "(s)", &task->ut.get_props.interface_name);
g_strstrip(task->ut.get_props.interface_name);
task->path = g_strstrip(g_strdup(path));
return task;
}
task->type = DLR_TASK_MANAGER_GET_ALL_PROPS;
task->invocation = invocation;
task->result_format = "(@a{sv})";
dlr_task_t *dlr_task_manager_set_prop_new(dleyna_connector_msg_id_t invocation,
const gchar *path,
GVariant *parameters,
GError **error)
{
dlr_task_t *task;
task = prv_device_task_new(DLR_TASK_MANAGER_SET_PROP, invocation, path,
NULL);
g_variant_get(parameters, "(ssv)", &task->ut.set_prop.interface_name,
&task->ut.set_prop.prop_name, &task->ut.set_prop.params);
g_strstrip(task->ut.set_prop.interface_name);
g_strstrip(task->ut.set_prop.prop_name);
return task;
}
......
......@@ -55,12 +55,9 @@ enum dlr_task_type_t_ {
DLR_TASK_HOST_URI,
DLR_TASK_REMOVE_URI,
DLR_TASK_GET_ICON,
DLR_TASK_WHITE_LIST_ENABLE,
DLR_TASK_WHITE_LIST_ADD_ENTRIES,
DLR_TASK_WHITE_LIST_REMOVE_ENTRIES,
DLR_TASK_WHITE_LIST_CLEAR,
DLR_TASK_MANAGER_GET_ALL_PROPS,
DLR_TASK_MANAGER_GET_PROP
DLR_TASK_MANAGER_GET_PROP,
DLR_TASK_MANAGER_SET_PROP
};
typedef enum dlr_task_type_t_ dlr_task_type_t;
......@@ -112,12 +109,6 @@ struct dlr_task_get_icon_t_ {
gchar *resolution;
};
typedef struct dlr_task_white_list_t_ dlr_task_white_list_t;
struct dlr_task_white_list_t_ {
gboolean enabled;
GVariant *entries;
};
typedef struct dlr_task_t_ dlr_task_t;
struct dlr_task_t_ {
dleyna_task_atom_t atom; /* pseudo inheritance - MUST be first field */
......@@ -136,7 +127,6 @@ struct dlr_task_t_ {
dlr_task_host_uri_t host_uri;
dlr_task_seek_t seek;
dlr_task_get_icon_t get_icon;
dlr_task_white_list_t white_list;
} ut;
};
......@@ -216,17 +206,6 @@ dlr_task_t *dlr_task_remove_uri_new(dleyna_connector_msg_id_t invocation,
dlr_task_t *dlr_task_get_icon_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters);
dlr_task_t *dlr_task_wl_enable_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters);
dlr_task_t *dlr_task_wl_clear_new(dleyna_connector_msg_id_t invocation);
dlr_task_t *dlr_task_wl_add_entries_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters);
dlr_task_t *dlr_task_wl_remove_entries_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters);
dlr_task_t *dlr_task_manager_get_prop_new(dleyna_connector_msg_id_t invocation,
const gchar *path,
GVariant *parameters,
......@@ -237,6 +216,11 @@ dlr_task_t *dlr_task_manager_get_props_new(dleyna_connector_msg_id_t invocation,
GVariant *parameters,
GError **error);
dlr_task_t *dlr_task_manager_set_prop_new(dleyna_connector_msg_id_t invocation,
const gchar *path,
GVariant *parameters,
GError **error);
void dlr_task_complete(dlr_task_t *task);
void dlr_task_fail(dlr_task_t *task, GError *error);
......
......@@ -4,5 +4,5 @@ libexecdir=@libexecdir@
Name: @PACKAGE@-service
Description: UPnP & DLNA service to discover and manipulate renderers
Requires.private: glib-2.0 gio-2.0 dleyna-core-1.0 dleyna-renderer-1.0
Version: @VERSION@
\ No newline at end of file
Requires.private: glib-2.0 gio-2.0 dleyna-core-1.0
Version: @VERSION@
......@@ -208,16 +208,20 @@ class Manager(object):
self.__manager.Rescan()
def white_list_enable(self, enable):
self.__manager.WhiteListEnable(enable)
self.set_prop("WhiteListEnabled", enable)
def white_list_add(self, entries):
self.__manager.WhiteListAddEntries(entries)
white_list = set(self.get_prop('WhiteListEntries'))
white_list = (white_list | set(entries)) - set('')
self.set_prop("WhiteListEntries", list(white_list))
def white_list_remove(self, entries):
self.__manager.WhiteListRemoveEntries(entries)
white_list = set(self.get_prop('WhiteListEntries'))
white_list = white_list - set(entries)
self.set_prop("WhiteListEntries", list(white_list))
def white_list_clear(self):
self.__manager.WhiteListClear()
self.set_prop("WhiteListEntries", [''])
def get_props(self, iface = ""):
return self._propsIF.GetAll(iface)
......@@ -225,6 +229,9 @@ class Manager(object):
def get_prop(self, prop_name, iface = ""):
return self._propsIF.Get(iface, prop_name)
def set_prop(self, prop_name, val, iface = ""):
return self._propsIF.Set(iface, prop_name, val)
def print_prop(self, prop_name, iface = ""):
print_json(self._propsIF.Get(iface, prop_name))
......
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