+version 0.2.1
+ - dleyna-connector-dbus v0.2.0
+ - dleyna-core v0.2.2
+ - dleyna-renderer v0.2.2
+ - dleyna-server v0.2.1
+ - dleyna-control v0.2.0
+
version 0.1.0
- dleyna-connector-dbus v0.1.0
- dleyna-core v0.1.0
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dleyna-linux 0.2.0.
+# Generated by GNU Autoconf 2.69 for dleyna-linux 0.2.1.
#
# Report bugs to <https://github.com/01org/dleyna-linux/issues/new>.
#
# Identity of this package.
PACKAGE_NAME='dleyna-linux'
PACKAGE_TARNAME='dleyna-linux'
-PACKAGE_VERSION='0.2.0'
-PACKAGE_STRING='dleyna-linux 0.2.0'
+PACKAGE_VERSION='0.2.1'
+PACKAGE_STRING='dleyna-linux 0.2.1'
PACKAGE_BUGREPORT='https://github.com/01org/dleyna-linux/issues/new'
PACKAGE_URL='https://01.org/dleyna/'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dleyna-linux 0.2.0 to adapt to many kinds of systems.
+\`configure' configures dleyna-linux 0.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dleyna-linux 0.2.0:";;
+ short | recursive ) echo "Configuration of dleyna-linux 0.2.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dleyna-linux configure 0.2.0
+dleyna-linux configure 0.2.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dleyna-linux $as_me 0.2.0, which was
+It was created by dleyna-linux $as_me 0.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='dleyna-linux'
- VERSION='0.2.0'
+ VERSION='0.2.1'
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dleyna-linux $as_me 0.2.0, which was
+This file was extended by dleyna-linux $as_me 0.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dleyna-linux config.status 0.2.0
+dleyna-linux config.status 0.2.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
AC_PREREQ([2.66])
AC_INIT([dleyna-linux],
- [0.2.0],
+ [0.2.1],
[https://github.com/01org/dleyna-linux/issues/new],
,
[https://01.org/dleyna/])
+version 0.2.0
+ - Change publish_object() signature
+
version 0.1.0
- Prepare for first stable branch
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1
# automake: $automake_version
# autoconf: $autoconf_version
#
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
+VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1"
TIMESTAMP=""
package_revision=1.3337
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dleyna-connector-dbus 0.1.0.
+# Generated by GNU Autoconf 2.69 for dleyna-connector-dbus 0.2.0.
#
# Report bugs to <https://github.com/01org/dleyna-connector-dbus/issues/new>.
#
# Identity of this package.
PACKAGE_NAME='dleyna-connector-dbus'
PACKAGE_TARNAME='dleyna-connector-dbus'
-PACKAGE_VERSION='0.1.0'
-PACKAGE_STRING='dleyna-connector-dbus 0.1.0'
+PACKAGE_VERSION='0.2.0'
+PACKAGE_STRING='dleyna-connector-dbus 0.2.0'
PACKAGE_BUGREPORT='https://github.com/01org/dleyna-connector-dbus/issues/new'
PACKAGE_URL='https://01.org/dleyna/'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dleyna-connector-dbus 0.1.0 to adapt to many kinds of systems.
+\`configure' configures dleyna-connector-dbus 0.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dleyna-connector-dbus 0.1.0:";;
+ short | recursive ) echo "Configuration of dleyna-connector-dbus 0.2.0:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dleyna-connector-dbus configure 0.1.0
+dleyna-connector-dbus configure 0.2.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dleyna-connector-dbus $as_me 0.1.0, which was
+It was created by dleyna-connector-dbus $as_me 0.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='dleyna-connector-dbus'
- VERSION='0.1.0'
+ VERSION='0.2.0'
cat >>confdefs.h <<_ACEOF
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
pkg_cv_DLEYNA_CORE_CFLAGS="$DLEYNA_CORE_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.2.1\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.2.1") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_DLEYNA_CORE_CFLAGS=`$PKG_CONFIG --cflags "dleyna-core-1.0 >= 0.0.1" 2>/dev/null`
+ pkg_cv_DLEYNA_CORE_CFLAGS=`$PKG_CONFIG --cflags "dleyna-core-1.0 >= 0.2.1" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
pkg_cv_DLEYNA_CORE_LIBS="$DLEYNA_CORE_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.2.1\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.2.1") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_DLEYNA_CORE_LIBS=`$PKG_CONFIG --libs "dleyna-core-1.0 >= 0.0.1" 2>/dev/null`
+ pkg_cv_DLEYNA_CORE_LIBS=`$PKG_CONFIG --libs "dleyna-core-1.0 >= 0.2.1" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dleyna-core-1.0 >= 0.0.1" 2>&1`
+ DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dleyna-core-1.0 >= 0.2.1" 2>&1`
else
- DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dleyna-core-1.0 >= 0.0.1" 2>&1`
+ DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dleyna-core-1.0 >= 0.2.1" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$DLEYNA_CORE_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (dleyna-core-1.0 >= 0.0.1) were not met:
+ as_fn_error $? "Package requirements (dleyna-core-1.0 >= 0.2.1) were not met:
$DLEYNA_CORE_PKG_ERRORS
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dleyna-connector-dbus $as_me 0.1.0, which was
+This file was extended by dleyna-connector-dbus $as_me 0.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dleyna-connector-dbus config.status 0.1.0
+dleyna-connector-dbus config.status 0.2.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
AC_PREREQ([2.66])
AC_INIT([dleyna-connector-dbus],
- [0.1.0],
+ [0.2.0],
[https://github.com/01org/dleyna-connector-dbus/issues/new],
,
[https://01.org/dleyna/])
[master_build=no])
AS_IF([test "x$master_build" = "xno"],
- [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.0.1])],
+ [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.2.1])],
[DLEYNA_CORE_CFLAGS="-I../dleyna-core";
DLEYNA_CORE_LIBS="-L../dleyna-core/.libs -ldleyna-core-1.0"
])
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
;;
esac
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- gnu*)
- ;;
-
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
}
static GDBusInterfaceInfo *prv_find_interface_info(gboolean root,
- guint interface_index)
+ const gchar *interface_name)
{
GDBusNodeInfo *node;
+ GDBusInterfaceInfo **interface;
node = (root) ? g_context.root_node_info : g_context.server_node_info;
- return node->interfaces[interface_index];
+ interface = node->interfaces;
+ while (*interface) {
+ if (!strcmp(interface_name, (*interface)->name))
+ break;
+ interface++;
+ }
+
+ return *interface;
}
static void prv_object_method_call(GDBusConnection *conn,
dleyna_connector_id_t connection,
const gchar *object_path,
gboolean root,
- guint interface_index,
+ const gchar* interface_name,
const dleyna_connector_dispatch_cb_t *cb_table_1)
{
guint object_id;
object = g_new0(dleyna_dbus_object_t, 1);
- info = prv_find_interface_info(root, interface_index);
+ info = prv_find_interface_info(root, interface_name);
object_id = g_dbus_connection_register_object(
(GDBusConnection *)connection,
object_path,
+version 0.2.2
+ - Change connector publish_object() signature
+ - Add network filtering support
+ - Code cleanup
+
version 0.1.0
- Prepare for first stable branch
connectordir = $(libdir)/dleyna-1.0/connectors
sysconfigdir = $(sysconfdir)
-DLEYNA_CORE_VERSION = 1:2:0
+DLEYNA_CORE_VERSION = 2:0:1
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
libdleyna/core/service-task.h \
libdleyna/core/settings.h \
libdleyna/core/task-atom.h \
- libdleyna/core/task-processor.h
+ libdleyna/core/task-processor.h \
+ libdleyna/core/white-list.h
libdleyna_core_1_0_la_LDFLAGS = -version-info $(DLEYNA_CORE_VERSION) \
libdleyna/core/main-loop.c \
libdleyna/core/service-task.c \
libdleyna/core/settings.c \
- libdleyna/core/task-processor.c
+ libdleyna/core/task-processor.c \
+ libdleyna/core/white-list.c
libdleyna_core_1_0_la_LIBADD = $(GLIB_LIBS) \
$(GIO_LIBS) \
libdleyna/core/connector-mgr.lo libdleyna/core/error.lo \
libdleyna/core/log.lo libdleyna/core/main-loop.lo \
libdleyna/core/service-task.lo libdleyna/core/settings.lo \
- libdleyna/core/task-processor.lo
+ libdleyna/core/task-processor.lo libdleyna/core/white-list.lo
libdleyna_core_1_0_la_OBJECTS = $(am_libdleyna_core_1_0_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
libdleyna_coreincdir = $(includedir)/dleyna-1.0/libdleyna/core
connectordir = $(libdir)/dleyna-1.0/connectors
sysconfigdir = $(sysconfdir)
-DLEYNA_CORE_VERSION = 1:2:0
+DLEYNA_CORE_VERSION = 2:0:1
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(GMODULE_CFLAGS) \
libdleyna/core/service-task.h \
libdleyna/core/settings.h \
libdleyna/core/task-atom.h \
- libdleyna/core/task-processor.h
+ libdleyna/core/task-processor.h \
+ libdleyna/core/white-list.h
libdleyna_core_1_0_la_LDFLAGS = -version-info $(DLEYNA_CORE_VERSION) \
-no-undefined
libdleyna/core/main-loop.c \
libdleyna/core/service-task.c \
libdleyna/core/settings.c \
- libdleyna/core/task-processor.c
+ libdleyna/core/task-processor.c \
+ libdleyna/core/white-list.c
libdleyna_core_1_0_la_LIBADD = $(GLIB_LIBS) \
$(GIO_LIBS) \
libdleyna/core/$(DEPDIR)/$(am__dirstamp)
libdleyna/core/task-processor.lo: libdleyna/core/$(am__dirstamp) \
libdleyna/core/$(DEPDIR)/$(am__dirstamp)
+libdleyna/core/white-list.lo: libdleyna/core/$(am__dirstamp) \
+ libdleyna/core/$(DEPDIR)/$(am__dirstamp)
libdleyna-core-1.0.la: $(libdleyna_core_1_0_la_OBJECTS) $(libdleyna_core_1_0_la_DEPENDENCIES) $(EXTRA_libdleyna_core_1_0_la_DEPENDENCIES)
$(AM_V_CCLD)$(libdleyna_core_1_0_la_LINK) -rpath $(libdir) $(libdleyna_core_1_0_la_OBJECTS) $(libdleyna_core_1_0_la_LIBADD) $(LIBS)
-rm -f libdleyna/core/settings.lo
-rm -f libdleyna/core/task-processor.$(OBJEXT)
-rm -f libdleyna/core/task-processor.lo
+ -rm -f libdleyna/core/white-list.$(OBJEXT)
+ -rm -f libdleyna/core/white-list.lo
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@libdleyna/core/$(DEPDIR)/service-task.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libdleyna/core/$(DEPDIR)/settings.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libdleyna/core/$(DEPDIR)/task-processor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libdleyna/core/$(DEPDIR)/white-list.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1
# automake: $automake_version
# autoconf: $autoconf_version
#
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
+VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1"
TIMESTAMP=""
package_revision=1.3337
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dleyna-core 0.1.0.
+# Generated by GNU Autoconf 2.69 for dleyna-core 0.2.2.
#
# Report bugs to <https://github.com/01org/dleyna-core/issues/new>.
#
# Identity of this package.
PACKAGE_NAME='dleyna-core'
PACKAGE_TARNAME='dleyna-core'
-PACKAGE_VERSION='0.1.0'
-PACKAGE_STRING='dleyna-core 0.1.0'
+PACKAGE_VERSION='0.2.2'
+PACKAGE_STRING='dleyna-core 0.2.2'
PACKAGE_BUGREPORT='https://github.com/01org/dleyna-core/issues/new'
PACKAGE_URL='https://01.org/dleyna/'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dleyna-core 0.1.0 to adapt to many kinds of systems.
+\`configure' configures dleyna-core 0.2.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dleyna-core 0.1.0:";;
+ short | recursive ) echo "Configuration of dleyna-core 0.2.2:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dleyna-core configure 0.1.0
+dleyna-core configure 0.2.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dleyna-core $as_me 0.1.0, which was
+It was created by dleyna-core $as_me 0.2.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='dleyna-core'
- VERSION='0.1.0'
+ VERSION='0.2.2'
cat >>confdefs.h <<_ACEOF
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
pkg_cv_GUPNP_CFLAGS="$GUPNP_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.19.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.19.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.20.5\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.20.5") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_GUPNP_CFLAGS=`$PKG_CONFIG --cflags "gupnp-1.0 >= 0.19.1" 2>/dev/null`
+ pkg_cv_GUPNP_CFLAGS=`$PKG_CONFIG --cflags "gupnp-1.0 >= 0.20.5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
pkg_cv_GUPNP_LIBS="$GUPNP_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.19.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.19.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.20.5\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.20.5") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_GUPNP_LIBS=`$PKG_CONFIG --libs "gupnp-1.0 >= 0.19.1" 2>/dev/null`
+ pkg_cv_GUPNP_LIBS=`$PKG_CONFIG --libs "gupnp-1.0 >= 0.20.5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- GUPNP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gupnp-1.0 >= 0.19.1" 2>&1`
+ GUPNP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gupnp-1.0 >= 0.20.5" 2>&1`
else
- GUPNP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gupnp-1.0 >= 0.19.1" 2>&1`
+ GUPNP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gupnp-1.0 >= 0.20.5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GUPNP_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (gupnp-1.0 >= 0.19.1) were not met:
+ as_fn_error $? "Package requirements (gupnp-1.0 >= 0.20.5) were not met:
$GUPNP_PKG_ERRORS
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dleyna-core $as_me 0.1.0, which was
+This file was extended by dleyna-core $as_me 0.2.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dleyna-core config.status 0.1.0
+dleyna-core config.status 0.2.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
AC_PREREQ([2.66])
AC_INIT([dleyna-core],
- [0.1.0],
+ [0.2.2],
[https://github.com/01org/dleyna-core/issues/new],
,
[https://01.org/dleyna/])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.28])
PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= 2.28])
-PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.19.1])
+PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.20.5])
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h syslog.h])
#include "connector-mgr.h"
#include "log.h"
-static GHashTable *g_connectors = NULL;
+static GHashTable *g_connectors;
const dleyna_connector_t *dleyna_connector_mgr_load(const gchar *name)
{
dleyna_connector_id_t connection,
const gchar *object_path,
gboolean root,
- guint interface_index,
+ const gchar *interface_name,
const dleyna_connector_dispatch_cb_t *cb_table_1);
typedef guint (*dleyna_connector_publish_subtree_t)(
dleyna_connector_id_t connection,
*/
#ifdef DLEYNA_DEBUG_ENABLED
#define DLEYNA_LOG_HELPER(priority, flags, fmt, ...) \
- do { \
dleyna_log_trace(priority, flags, "%s : %s() --- " fmt,\
- __FILE__, __func__, ## __VA_ARGS__); \
- } while (0)
+ __FILE__, __func__, ## __VA_ARGS__);
#else
#define DLEYNA_LOG_HELPER(priority, flags, fmt, ...) \
- do { \
- dleyna_log_trace(priority, flags, fmt, ## __VA_ARGS__);\
- } while (0)
+ dleyna_log_trace(priority, flags, fmt, ## __VA_ARGS__);
#endif
*/
#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
#define DLEYNA_LOG_DEBUG_NL() \
- do { \
- dleyna_log_trace(LOG_DEBUG, G_LOG_LEVEL_DEBUG, " "); \
- } while (0)
+ dleyna_log_trace(LOG_DEBUG, G_LOG_LEVEL_DEBUG, " ");
#else
#define DLEYNA_LOG_DEBUG_NL()
#endif
{
int retval = 1;
+#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init();
+#endif
dleyna_log_init(server);
#include "log.h"
#include "settings.h"
+#include "white-list.h"
struct dleyna_settings_t_ {
GKeyFile *keyfile;
/* Log section */
dleyna_log_type_t log_type;
int log_level;
+
+ /* netf section */
+ gboolean netf_enabled;
+ GVariant *netf_entries;
};
#define DLEYNA_SETTINGS_GROUP_GENERAL "general"
#define DLEYNA_SETTINGS_KEY_NEVER_QUIT "never-quit"
#define DLEYNA_SETTINGS_KEY_CONNECTOR_NAME "connector-name"
-#define DLEYNA_SETTINGS_GROUP_LOG "log"
-#define DLEYNA_SETTINGS_KEY_LOG_TYPE "log-type"
-#define DLEYNA_SETTINGS_KEY_LOG_LEVEL "log-level"
+#define DLEYNA_SETTINGS_GROUP_LOG "log"
+#define DLEYNA_SETTINGS_KEY_LOG_TYPE "log-type"
+#define DLEYNA_SETTINGS_KEY_LOG_LEVEL "log-level"
+
+#define DLEYNA_SETTINGS_GROUP_NETF "netf"
+#define DLEYNA_SETTINGS_KEY_NETF_ENABLED "netf-enabled"
+#define DLEYNA_SETTINGS_KEY_NETF_LIST "netf-list"
#define DLEYNA_SETTINGS_DEFAULT_NEVER_QUIT DLEYNA_NEVER_QUIT
#define DLEYNA_SETTINGS_DEFAULT_CONNECTOR_NAME DLEYNA_CONNECTOR_NAME
#define DLEYNA_SETTINGS_LOG_KEYS(sys, loc, settings) \
do { \
+ gchar *str = NULL; \
+ \
DLEYNA_LOG_DEBUG_NL(); \
DLEYNA_LOG_INFO("Load file [%s]", loc ? loc : sys); \
DLEYNA_LOG_DEBUG_NL(); \
+ \
DLEYNA_LOG_DEBUG("[General settings]"); \
DLEYNA_LOG_DEBUG("Never Quit: %s", (settings)->never_quit ? "T" : "F");\
DLEYNA_LOG_DEBUG_NL(); \
DLEYNA_LOG_DEBUG("Connector Name: %s", (settings)->connector_name);\
DLEYNA_LOG_DEBUG_NL(); \
+ \
DLEYNA_LOG_DEBUG("[Logging settings]"); \
DLEYNA_LOG_DEBUG("Log Type : %d", (settings)->log_type); \
DLEYNA_LOG_DEBUG("Log Level: 0x%02X", (settings)->log_level); \
DLEYNA_LOG_DEBUG_NL(); \
+ \
+ if ((settings)->netf_entries != NULL) \
+ str = g_variant_print((settings)->netf_entries, FALSE); \
+ DLEYNA_LOG_DEBUG("[Network filtering settings]"); \
+ DLEYNA_LOG_DEBUG("Enabled : %s", (settings)->netf_enabled ? "T" : "F");\
+ DLEYNA_LOG_DEBUG("Entries: %s", str); \
+ g_free(str); \
+ DLEYNA_LOG_DEBUG_NL(); \
} while (0)
return keyfile;
}
+static GVariant *prv_to_netf_entries(char **list)
+{
+ GVariantBuilder vb;
+ GVariant *result = NULL;
+
+ if ((list != NULL) && (*list != NULL)) {
+ g_variant_builder_init(&vb, G_VARIANT_TYPE("as"));
+
+ while (*list != NULL) {
+ g_variant_builder_add(&vb, "s", *list);
+ list++;
+ }
+
+ result = g_variant_ref_sink(g_variant_builder_end(&vb));
+ }
+
+ return result;
+}
+
static int prv_to_log_level(gint *int_list, gsize length)
{
gsize i;
gchar *s_val;
gint *int_star;
gsize length;
+ gchar **list;
b_val = g_key_file_get_boolean(keyfile,
DLEYNA_SETTINGS_GROUP_GENERAL,
&error);
if (error == NULL) {
- settings->log_level = prv_to_log_level(int_star,
- length);
+ settings->log_level = prv_to_log_level(int_star, length);
g_free(int_star);
} else {
g_error_free(error);
error = NULL;
}
+
+ b_val = g_key_file_get_boolean(keyfile,
+ DLEYNA_SETTINGS_GROUP_NETF,
+ DLEYNA_SETTINGS_KEY_NETF_ENABLED,
+ &error);
+
+ if (error == NULL) {
+ settings->netf_enabled = b_val;
+ } else {
+ g_error_free(error);
+ error = NULL;
+ }
+
+ list = g_key_file_get_string_list(keyfile,
+ DLEYNA_SETTINGS_GROUP_NETF,
+ DLEYNA_SETTINGS_KEY_NETF_LIST,
+ NULL,
+ &error);
+
+ if (error == NULL) {
+ settings->netf_entries = prv_to_netf_entries(list);
+ g_strfreev(list);
+ } else {
+ g_error_free(error);
+ error = NULL;
+ }
}
static void prv_init_default(dleyna_settings_t *settings)
settings->log_type = DLEYNA_SETTINGS_DEFAULT_LOG_TYPE;
settings->log_level = DLEYNA_SETTINGS_DEFAULT_LOG_LEVEL;
+
+ settings->netf_enabled = FALSE;
+ settings->netf_entries = NULL;
}
static void prv_keyfile_init(dleyna_settings_t *settings,
static void prv_keyfile_finalize(dleyna_settings_t *settings)
{
+ if (settings->netf_entries != NULL) {
+ g_variant_unref(settings->netf_entries);
+ settings->netf_entries = NULL;
+ }
+
if (settings->keyfile != NULL) {
g_key_file_free(settings->keyfile);
settings->keyfile = NULL;
}
}
+static gboolean prv_netf_entries_are_equal(GVariant *old, GVariant *new)
+{
+ gboolean match;
+ GVariantIter iter1;
+ GVariantIter iter2;
+ gchar *entry1;
+ gchar *entry2;
+
+ match = (old == new);
+
+ if (match ||
+ ((old == NULL) && (new != NULL)) ||
+ ((old != NULL) && (new == NULL)))
+ goto exit;
+
+ (void) g_variant_iter_init(&iter1, old);
+
+ while (g_variant_iter_next(&iter1, "&s", &entry1)) {
+ (void) g_variant_iter_init(&iter2, new);
+
+ while (g_variant_iter_next(&iter2, "&s", &entry2) && !match)
+ match = !strcmp(entry1, entry2);
+
+ if (!match)
+ break;
+ }
+
+exit:
+ return match;
+}
+
static void prv_reload(dleyna_settings_t *settings)
{
gchar *sys_path = NULL;
gchar *loc_path = NULL;
+ gboolean saved_netf_enabled;
+ GVariant *saved_netf_entries;
+ GVariant *netf_entries;
DLEYNA_LOG_INFO("Reload local configuration file");
+ /* Save all White List information */
+ saved_netf_enabled = settings->netf_enabled;
+ saved_netf_entries = settings->netf_entries;
+ /* Prevent prv_keyfile_finalize()) to free it */
+ settings->netf_entries = NULL;
+
prv_keyfile_finalize(settings);
prv_init_default(settings);
prv_get_keyfile_path(settings->file_name, &sys_path, &loc_path);
if (sys_path || loc_path)
prv_keyfile_init(settings, sys_path, loc_path);
+ netf_entries = settings->netf_entries;
+
+ /* FIXME: Block white list signals instead */
+ /* A little optimization hack:
+ * 1 - Updating the wl list has no effect if the wl is disabled.
+ * 2 - If the enabled settings has changed to disabled, apply first.
+ * 3 - If it has changed to enabled, update the list first, then
+ * apply the change last.
+ */
+ if (!settings->netf_enabled && saved_netf_enabled)
+ dleyna_white_list_enable(settings->netf_enabled, TRUE);
+
+ /* Remove old entries if new ones are different.
+ * Don't clear() to avoid to loose entries added by a client
+ */
+ if (!prv_netf_entries_are_equal(saved_netf_entries, netf_entries)) {
+ dleyna_white_list_remove_entries(saved_netf_entries, FALSE);
+ dleyna_white_list_add_entries(netf_entries, TRUE);
+ }
+
+ if (settings->netf_enabled && !saved_netf_enabled)
+ dleyna_white_list_enable(settings->netf_enabled, TRUE);
+
+ if (saved_netf_entries != NULL)
+ g_variant_unref(saved_netf_entries);
+
DLEYNA_SETTINGS_LOG_KEYS(sys_path, loc_path, settings);
g_free(sys_path);
g_file_monitor_cancel(settings->monitor);
g_object_unref(settings->monitor);
}
+
g_free(settings->connector_name);
g_free(settings->file_name);
g_free(settings);
}
+
+void dleyna_settings_init_white_list(dleyna_settings_t *settings)
+{
+ dleyna_white_list_add_entries(settings->netf_entries, TRUE);
+ dleyna_white_list_enable(settings->netf_enabled, TRUE);
+}
typedef struct dleyna_settings_t_ dleyna_settings_t;
void dleyna_settings_new(const gchar *server, dleyna_settings_t **settings);
+
void dleyna_settings_delete(dleyna_settings_t *settings);
+void dleyna_settings_init_white_list(dleyna_settings_t *settings);
+
gboolean dleyna_settings_is_never_quit(dleyna_settings_t *settings);
+
const gchar *dleyna_settings_connector_name(dleyna_settings_t *settings);
#endif /* DLEYNA_SETTINGS_H__ */
--- /dev/null
+/*
+ * dLeyna
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
+ *
+ */
+
+#include <string.h>
+
+#include "white-list.h"
+#include "log.h"
+
+static dleyna_white_list_t g_wl_cb;
+
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+static void prv_dump_wl_entries(GUPnPWhiteList *wl)
+{
+ GList *l;
+
+ l = gupnp_white_list_get_entries(wl);
+
+ DLEYNA_LOG_DEBUG_NL();
+ DLEYNA_LOG_DEBUG("White List entries:");
+
+ if (l != NULL) {
+ while (l != NULL) {
+ DLEYNA_LOG_DEBUG(" Entry: [%s].", (char *)l->data);
+ l = l->next;
+ }
+ } else {
+ DLEYNA_LOG_DEBUG(" White List Empty.");
+ }
+
+ DLEYNA_LOG_DEBUG_NL();
+}
+#endif
+
+void dleyna_white_list_enable(gboolean enabled, gboolean notify)
+{
+ if (g_wl_cb.wl != NULL) {
+ gupnp_white_list_set_enabled(g_wl_cb.wl, enabled);
+
+ DLEYNA_LOG_DEBUG("White List enabled: %d", enabled);
+
+ if (notify && (g_wl_cb.cb_enabled != NULL))
+ g_wl_cb.cb_enabled(g_wl_cb.user_data);
+ }
+}
+
+void dleyna_white_list_add_entries(GVariant *entries, gboolean notify)
+{
+ GVariantIter viter;
+ gchar *entry;
+
+ if ((entries != NULL) && (g_wl_cb.wl != NULL)) {
+ (void) g_variant_iter_init(&viter, entries);
+
+ while (g_variant_iter_next(&viter, "&s", &entry))
+ (void) gupnp_white_list_add_entry(g_wl_cb.wl, entry);
+
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ prv_dump_wl_entries(g_wl_cb.wl);
+#endif
+
+ if (notify && (g_wl_cb.cb_entries != NULL))
+ g_wl_cb.cb_entries(g_wl_cb.user_data);
+ }
+}
+
+void dleyna_white_list_remove_entries(GVariant *entries, gboolean notify)
+{
+ GVariantIter viter;
+ gchar *entry;
+
+ if ((entries != NULL) && (g_wl_cb.wl != NULL)) {
+ (void) g_variant_iter_init(&viter, entries);
+
+ while (g_variant_iter_next(&viter, "&s", &entry))
+ (void) gupnp_white_list_remove_entry(g_wl_cb.wl, entry);
+
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ prv_dump_wl_entries(g_wl_cb.wl);
+#endif
+
+ if (notify && (g_wl_cb.cb_entries != NULL))
+ g_wl_cb.cb_entries(g_wl_cb.user_data);
+ }
+}
+
+void dleyna_white_list_clear(gboolean notify)
+{
+ if (g_wl_cb.wl != NULL) {
+ gupnp_white_list_clear(g_wl_cb.wl);
+
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ prv_dump_wl_entries(g_wl_cb.wl);
+#endif
+
+ if (notify && (g_wl_cb.cb_entries != NULL))
+ g_wl_cb.cb_entries(g_wl_cb.user_data);
+ }
+}
+
+void dleyna_white_list_set_info(dleyna_white_list_t *data)
+{
+ if (data != NULL)
+ memcpy(&g_wl_cb, data, sizeof(dleyna_white_list_t));
+ else
+ memset(&g_wl_cb, 0, sizeof(dleyna_white_list_t));
+}
--- /dev/null
+/*
+ * dLeyna
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
+ *
+ */
+
+#ifndef DLEYNA_WHITE_LIST_H__
+#define DLEYNA_WHITE_LIST_H__
+
+#include <glib.h>
+#include <libgupnp/gupnp-white-list.h>
+
+typedef void (*dleyna_white_list_notify_t)(gpointer user_data);
+
+typedef struct dleyna_white_list_t_ dleyna_white_list_t;
+
+struct dleyna_white_list_t_ {
+ GUPnPWhiteList *wl;
+ dleyna_white_list_notify_t cb_enabled;
+ dleyna_white_list_notify_t cb_entries;
+ gpointer user_data;
+};
+
+void dleyna_white_list_enable(gboolean enabled, gboolean notify);
+
+void dleyna_white_list_add_entries(GVariant *entries, gboolean notify);
+
+void dleyna_white_list_remove_entries(GVariant *entries, gboolean notify);
+
+void dleyna_white_list_clear(gboolean notify);
+
+void dleyna_white_list_set_info(dleyna_white_list_t *data);
+
+#endif /* DLEYNA_WHITE_LIST_H__ */
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
;;
esac
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- gnu*)
- ;;
-
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
+version 0.2.2
+ - Various build optimizations
+ - Fix a crash case when the server stops
+ - Code cleanup
+ - Documentation fixes
+ - GetAll: do not fail if the DMR returns an error for GetPositionInf
+ https://github.com/01org/dleyna-renderer/issues/92
+ - Fix a crash case for Rescan()
+ - Fix #78: MPRIS OpenUri() does not start playing
+ https://github.com/01org/dleyna-renderer/issues/78
+ - Add new SetUri API to Player
+ https://github.com/01org/dleyna-renderer/issues/94
+ - Add OpenNextUri() method
+ https://github.com/01org/dleyna-renderer/issues/35
+ - Handling of the publish_object() connector API change
+ - Fix bug #97 - dLeyna renderer can crash if renderer dissapears
+ https://github.com/01org/dleyna-renderer/issues/97
+ - Enable byte seek
+ https://github.com/01org/dleyna-renderer/issues/59
+ - Change GetRenderers() API as well as FoundRenderer/LostRenderer
+ signals: use object paths instead of strings
+ https://github.com/01org/dleyna-renderer/issues/110
+ - Add Network Filtering support
+
version 0.1.0
- Prepare for first stable branch
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1
# automake: $automake_version
# autoconf: $autoconf_version
#
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
+VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1"
TIMESTAMP=""
package_revision=1.3337
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dleyna-renderer 0.2.0.
+# Generated by GNU Autoconf 2.69 for dleyna-renderer 0.2.2.
#
# Report bugs to <https://github.com/01org/dleyna-renderer/issues/new>.
#
# Identity of this package.
PACKAGE_NAME='dleyna-renderer'
PACKAGE_TARNAME='dleyna-renderer'
-PACKAGE_VERSION='0.2.0'
-PACKAGE_STRING='dleyna-renderer 0.2.0'
+PACKAGE_VERSION='0.2.2'
+PACKAGE_STRING='dleyna-renderer 0.2.2'
PACKAGE_BUGREPORT='https://github.com/01org/dleyna-renderer/issues/new'
PACKAGE_URL='https://01.org/dleyna/'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dleyna-renderer 0.2.0 to adapt to many kinds of systems.
+\`configure' configures dleyna-renderer 0.2.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dleyna-renderer 0.2.0:";;
+ short | recursive ) echo "Configuration of dleyna-renderer 0.2.2:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dleyna-renderer configure 0.2.0
+dleyna-renderer configure 0.2.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dleyna-renderer $as_me 0.2.0, which was
+It was created by dleyna-renderer $as_me 0.2.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='dleyna-renderer'
- VERSION='0.2.0'
+ VERSION='0.2.2'
cat >>confdefs.h <<_ACEOF
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
pkg_cv_GUPNP_CFLAGS="$GUPNP_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.20.3\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.20.3") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.20.5\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.20.5") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_GUPNP_CFLAGS=`$PKG_CONFIG --cflags "gupnp-1.0 >= 0.20.3" 2>/dev/null`
+ pkg_cv_GUPNP_CFLAGS=`$PKG_CONFIG --cflags "gupnp-1.0 >= 0.20.5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
pkg_cv_GUPNP_LIBS="$GUPNP_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.20.3\""; } >&5
- ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.20.3") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gupnp-1.0 >= 0.20.5\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gupnp-1.0 >= 0.20.5") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_GUPNP_LIBS=`$PKG_CONFIG --libs "gupnp-1.0 >= 0.20.3" 2>/dev/null`
+ pkg_cv_GUPNP_LIBS=`$PKG_CONFIG --libs "gupnp-1.0 >= 0.20.5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- GUPNP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gupnp-1.0 >= 0.20.3" 2>&1`
+ GUPNP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gupnp-1.0 >= 0.20.5" 2>&1`
else
- GUPNP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gupnp-1.0 >= 0.20.3" 2>&1`
+ GUPNP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gupnp-1.0 >= 0.20.5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GUPNP_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (gupnp-1.0 >= 0.20.3) were not met:
+ as_fn_error $? "Package requirements (gupnp-1.0 >= 0.20.5) were not met:
$GUPNP_PKG_ERRORS
pkg_cv_DLEYNA_CORE_CFLAGS="$DLEYNA_CORE_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.2.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.2.2") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_DLEYNA_CORE_CFLAGS=`$PKG_CONFIG --cflags "dleyna-core-1.0 >= 0.0.1" 2>/dev/null`
+ pkg_cv_DLEYNA_CORE_CFLAGS=`$PKG_CONFIG --cflags "dleyna-core-1.0 >= 0.2.2" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
pkg_cv_DLEYNA_CORE_LIBS="$DLEYNA_CORE_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.2.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.2.2") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_DLEYNA_CORE_LIBS=`$PKG_CONFIG --libs "dleyna-core-1.0 >= 0.0.1" 2>/dev/null`
+ pkg_cv_DLEYNA_CORE_LIBS=`$PKG_CONFIG --libs "dleyna-core-1.0 >= 0.2.2" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dleyna-core-1.0 >= 0.0.1" 2>&1`
+ DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dleyna-core-1.0 >= 0.2.2" 2>&1`
else
- DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dleyna-core-1.0 >= 0.0.1" 2>&1`
+ DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dleyna-core-1.0 >= 0.2.2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$DLEYNA_CORE_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (dleyna-core-1.0 >= 0.0.1) were not met:
+ as_fn_error $? "Package requirements (dleyna-core-1.0 >= 0.2.2) were not met:
$DLEYNA_CORE_PKG_ERRORS
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dleyna-renderer $as_me 0.2.0, which was
+This file was extended by dleyna-renderer $as_me 0.2.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dleyna-renderer config.status 0.2.0
+dleyna-renderer config.status 0.2.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
- enable-werror : ${enable_werror}
- enable-debug : ${enable_debug}
- enable-never-quit : ${enable_never_quit}
- - with_connector-name : ${with_connector_name}
+ - with-connector-name : ${with_connector_name}
- disable-optimization: ${disable_optimization}
- with-log-level : ${with_log_level}
- with-log-type : ${with_log_type}
AC_PREREQ([2.66])
AC_INIT([dleyna-renderer],
- [0.2.0],
+ [0.2.2],
[https://github.com/01org/dleyna-renderer/issues/new],
,
[https://01.org/dleyna/])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.28])
PKG_CHECK_MODULES([GSSDP], [gssdp-1.0 >= 0.13.2])
-PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.20.3])
+PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.20.5])
PKG_CHECK_MODULES([GUPNPAV], [gupnp-av-1.0 >= 0.11.5])
PKG_CHECK_MODULES([GUPNPDLNA], [gupnp-dlna-2.0 >= 0.9.4])
PKG_CHECK_MODULES([SOUP], [libsoup-2.4 >= 2.28.2])
[master_build=no])
AS_IF([test "x$master_build" = "xno"],
- [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.0.1])],
+ [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.2.2])],
[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"
- enable-werror : ${enable_werror}
- enable-debug : ${enable_debug}
- enable-never-quit : ${enable_never_quit}
- - with_connector-name : ${with_connector_name}
+ - with-connector-name : ${with_connector_name}
- disable-optimization: ${disable_optimization}
- with-log-level : ${with_log_level}
- with-log-type : ${with_log_type}
libdleyna_rendererincdir = $(includedir)/dleyna-1.0/libdleyna/renderer
-DLEYNA_RENDERER_VERSION = 1:2:0
+DLEYNA_RENDERER_VERSION = 1:3:0
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-lib_LTLIBRARIES = libdleyna-renderer-1.0.la
+pkglib_LTLIBRARIES = libdleyna-renderer-1.0.la
libdleyna_rendererinc_HEADERS = control-point-renderer.h
async.c \
device.c \
host-service.c \
+ manager.c \
server.c \
task.c \
upnp.c
device.h \
host-service.h \
prop-defs.h \
+ manager.h \
server.h \
task.h \
upnp.h
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
+am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(sysconfdir)" \
"$(DESTDIR)$(libdleyna_rendererincdir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libdleyna_renderer_1_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am__objects_1 =
am_libdleyna_renderer_1_0_la_OBJECTS = $(am__objects_1) async.lo \
- device.lo host-service.lo server.lo task.lo upnp.lo
+ device.lo host-service.lo manager.lo server.lo task.lo upnp.lo
libdleyna_renderer_1_0_la_OBJECTS = \
$(am_libdleyna_renderer_1_0_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
with_log_level = @with_log_level@
with_log_type = @with_log_type@
libdleyna_rendererincdir = $(includedir)/dleyna-1.0/libdleyna/renderer
-DLEYNA_RENDERER_VERSION = 1:2:0
+DLEYNA_RENDERER_VERSION = 1:3:0
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DLEYNA_CORE_CFLAGS) \
-include config.h
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-lib_LTLIBRARIES = libdleyna-renderer-1.0.la
+pkglib_LTLIBRARIES = libdleyna-renderer-1.0.la
libdleyna_rendererinc_HEADERS = control-point-renderer.h
libdleyna_renderer_1_0_la_LDFLAGS = -version-info $(DLEYNA_RENDERER_VERSION) \
-no-undefined
async.c \
device.c \
host-service.c \
+ manager.c \
server.c \
task.c \
upnp.c
device.h \
host-service.h \
prop-defs.h \
+ manager.h \
server.h \
task.h \
upnp.h
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
dleyna-renderer-service.conf: $(top_builddir)/config.status $(srcdir)/dleyna-renderer-service.conf.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
}
-uninstall-libLTLIBRARIES:
+uninstall-pkglibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
done
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libdleyna-renderer-1.0.la: $(libdleyna_renderer_1_0_la_OBJECTS) $(libdleyna_renderer_1_0_la_DEPENDENCIES) $(EXTRA_libdleyna_renderer_1_0_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdleyna_renderer_1_0_la_LINK) -rpath $(libdir) $(libdleyna_renderer_1_0_la_OBJECTS) $(libdleyna_renderer_1_0_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libdleyna_renderer_1_0_la_LINK) -rpath $(pkglibdir) $(libdleyna_renderer_1_0_la_OBJECTS) $(libdleyna_renderer_1_0_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/async.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/host-service.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/task.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upnp.Plo@am__quote@
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(libdleyna_rendererincdir)"; do \
+ for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(libdleyna_rendererincdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
install-dvi-am:
-install-exec-am: install-libLTLIBRARIES install-sysconfDATA
+install-exec-am: install-pkglibLTLIBRARIES install-sysconfDATA
install-html: install-html-am
ps-am:
-uninstall-am: uninstall-libLTLIBRARIES \
- uninstall-libdleyna_rendererincHEADERS uninstall-pkgconfigDATA \
+uninstall-am: uninstall-libdleyna_rendererincHEADERS \
+ uninstall-pkgconfigDATA uninstall-pkglibLTLIBRARIES \
uninstall-sysconfDATA
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags distclean \
+ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
- install-libLTLIBRARIES install-libdleyna_rendererincHEADERS \
- install-man install-pdf install-pdf-am install-pkgconfigDATA \
+ install-libdleyna_rendererincHEADERS install-man install-pdf \
+ install-pdf-am install-pkgconfigDATA install-pkglibLTLIBRARIES \
install-ps install-ps-am install-strip install-sysconfDATA \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic maintainer-clean-local mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-libLTLIBRARIES \
uninstall-libdleyna_rendererincHEADERS uninstall-pkgconfigDATA \
- uninstall-sysconfDATA
+ uninstall-pkglibLTLIBRARIES uninstall-sysconfDATA
maintainer-clean-local:
{
dlr_async_task_t *cb_data = user_data;
- DLEYNA_LOG_DEBUG("Enter. Error %p", (void *)cb_data->error);
+ DLEYNA_LOG_DEBUG("Enter. %s %s", cb_data->error ? "Error:" : "Success.",
+ cb_data->error ? cb_data->error->message : "");
DLEYNA_LOG_DEBUG_NL();
if (cb_data->proxy != NULL)
dlr_device_local_cb_t local_cb;
};
+typedef struct dlr_rc_event_t_ dlr_rc_event_t;
+struct dlr_rc_event_t_ {
+ dlr_device_t *device;
+ guint dev_volume;
+ guint mute;
+ guint source_id;
+};
+
/* Private structure used in chain task */
typedef struct prv_new_device_ct_t_ prv_new_device_ct_t;
struct prv_new_device_ct_t_ {
GValue *value,
gpointer user_data);
-static void prv_props_update(dlr_device_t *device, dlr_task_t *task);
+static gboolean prv_props_update(dlr_device_t *device, dlr_task_t *task);
static void prv_get_rates_values(GList *allowed_tp_speeds,
GVariant **mpris_tp_speeds,
const char *interface,
GVariant *changed_props)
{
-#if DLR_LOG_LEVEL & DLR_LOG_LEVEL_DEBUG
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
gchar *params;
#endif
GVariant *val = g_variant_ref_sink(g_variant_new("(s@a{sv}as)",
DLR_INTERFACE_PROPERTIES_CHANGED,
device->path);
-#if DLR_LOG_LEVEL & DLR_LOG_LEVEL_DEBUG
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
params = g_variant_print(val, FALSE);
DLEYNA_LOG_DEBUG("Params: %s", params);
g_free(params);
g_ptr_array_free(dev->dlna_transport_play_speeds, TRUE);
if (dev->mpris_transport_play_speeds)
g_variant_unref(dev->mpris_transport_play_speeds);
+ g_hash_table_unref(dev->rc_event_handlers);
g_free(dev->rate);
g_free(dev->icon.mime_type);
device->connection,
device->path,
FALSE,
- i,
+ dlr_renderer_get_interface_name(i),
table + i);
if (!device->ids[i]) {
return NULL;
}
+static void prv_free_rc_event(gpointer user_data)
+{
+ dlr_rc_event_t *event = user_data;
+
+ if (event->source_id)
+ g_source_remove(event->source_id);
+ g_free(event);
+}
+
void dlr_device_construct(
dlr_device_t *dev,
dlr_device_context_t *context,
dev->contexts = g_ptr_array_new_with_free_func(prv_dlr_context_delete);
dev->path = new_path;
dev->rate = g_strdup("1");
+ dev->rc_event_handlers = g_hash_table_new_full(g_int_hash, g_int_equal,
+ g_free,
+ prv_free_rc_event);
prv_props_init(&dev->props);
return;
}
+static GVariant *prv_as_prop_from_list(GList *list)
+{
+ GVariantBuilder vb;
+
+ g_variant_builder_init(&vb, G_VARIANT_TYPE("as"));
+
+ do {
+ g_variant_builder_add(&vb, "s", list->data);
+ } while ((list = g_list_next(list)));
+
+ return g_variant_ref_sink(g_variant_builder_end(&vb));
+}
+
+static void prv_update_prop_dlna_device_classes(GUPnPDeviceInfo *proxy,
+ GHashTable *props)
+{
+ GList *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));
+}
+
static void prv_add_actions(dlr_device_t *device,
const gchar *actions,
GVariantBuilder *changed_props_vb)
gboolean play = FALSE;
gboolean ppause = FALSE;
gboolean seek = FALSE;
+ gboolean timeseek_missing = FALSE;
+ gboolean byteseek = FALSE;
gboolean next = FALSE;
gboolean previous = FALSE;
GVariant *val;
GRegex *regex;
gchar *tmp_str;
gchar **speeds;
+ GVariantIter iter;
+ gchar *dlna_device_class;
+ gchar *pos;
+ GUPnPDeviceInfo *info;
regex = g_regex_new("\\\\,", 0, 0, NULL);
tmp_str = g_regex_replace_literal(regex, actions, -1, 0, "*", 0, NULL);
true_val = g_variant_ref_sink(g_variant_new_boolean(TRUE));
false_val = g_variant_ref_sink(g_variant_new_boolean(FALSE));
+ 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);
+
+ /* If this device is not dlna compatible, there is no need */
+ /* to check for “X_DLNA_SeekTime” */
+ if (val) {
+ g_variant_iter_init(&iter, val);
+ while (g_variant_iter_next(&iter, "s", &dlna_device_class)) {
+ /* Could be DMR-version or M-DMR-version*/
+ pos = g_strrstr(dlna_device_class, "DMR-");
+ if (!pos || pos + 4 == 0 || strtof(pos + 4, 0) < 1.5f) {
+ g_free(dlna_device_class);
+ continue;
+ }
+
+ DLEYNA_LOG_DEBUG("DLNA version ≥ 1.50 pour %s",
+ device->path);
+ timeseek_missing = TRUE;
+ g_free(dlna_device_class);
+ break;
+ }
+ }
+
while (parts[i]) {
g_strstrip(parts[i]);
} else if (!strcmp(parts[i], "Previous")) {
previous = TRUE;
} else if (!strncmp(parts[i], "X_DLNA_PS=",
- strlen("X_DLNA_PS="))) {
+ strlen("X_DLNA_PS="))) {
speeds = g_strsplit(parts[i] + strlen("X_DLNA_PS="),
"*", 0);
prv_add_dlna_speeds(device, speeds, changed_props_vb);
g_strfreev(speeds);
+ } else if (!strcmp(parts[i], "X_DLNA_SeekTime")) {
+ timeseek_missing = FALSE;
+ } else if (!strcmp(parts[i], "X_DLNA_SeekByte")) {
+ byteseek = TRUE;
}
++i;
}
DLR_INTERFACE_PROP_CAN_PAUSE, val,
changed_props_vb);
- val = seek ? true_val : false_val;
+ val = seek && !timeseek_missing ? true_val : false_val;
g_variant_ref(val);
prv_change_props(device->props.player_props,
DLR_INTERFACE_PROP_CAN_SEEK, val,
changed_props_vb);
+ val = seek && byteseek ? true_val : false_val;
+ g_variant_ref(val);
+ prv_change_props(device->props.player_props,
+ DLR_INTERFACE_PROP_CAN_BYTE_SEEK, val,
+ changed_props_vb);
+
val = next ? true_val : false_val;
g_variant_ref(val);
prv_change_props(device->props.player_props,
changed_props_vb);
}
+static void prv_add_relcount(dlr_device_t *device,
+ const gchar *relcount,
+ GVariantBuilder *changed_props_vb)
+{
+ GVariant *val;
+ guint64 count = strtoll(relcount, NULL, 10);
+
+ val = g_variant_ref_sink(g_variant_new_uint64(count));
+ prv_change_props(device->props.player_props,
+ DLR_INTERFACE_PROP_BYTE_POSITION, val,
+ changed_props_vb);
+}
+
static void prv_found_item(GUPnPDIDLLiteParser *parser,
GUPnPDIDLLiteObject *object,
gpointer user_data)
g_object_unref(parser);
}
-static void prv_rc_last_change_cb(GUPnPServiceProxy *proxy,
- const char *variable,
- GValue *value,
- gpointer user_data)
+static gboolean prv_process_rc_last_change(gpointer user_data)
{
- GUPnPLastChangeParser *parser;
- dlr_device_t *device = user_data;
+ dlr_rc_event_t *event = user_data;
GVariantBuilder *changed_props_vb;
GVariant *changed_props;
GVariant *val;
- guint dev_volume = G_MAXUINT;
double mpris_volume;
- guint mute = G_MAXUINT;
-
- parser = gupnp_last_change_parser_new();
-
- if (!gupnp_last_change_parser_parse_last_change(
- parser, 0,
- g_value_get_string(value),
- NULL,
- "Volume", G_TYPE_UINT, &dev_volume,
- "Mute", G_TYPE_UINT, &mute,
- NULL))
- goto on_error;
+ dlr_device_t *device = event->device;
+ gint source_id;
- if (device->props.synced == FALSE)
- prv_props_update(device, NULL);
+ if (!device->props.synced && !prv_props_update(device, NULL))
+ goto on_lost_device;
if (device->max_volume == 0)
goto on_error;
changed_props_vb = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
- if (dev_volume != G_MAXUINT) {
- mpris_volume = (double)dev_volume / (double)device->max_volume;
+ if (event->dev_volume != G_MAXUINT) {
+ mpris_volume = (double) event->dev_volume /
+ (double) device->max_volume;
val = g_variant_ref_sink(g_variant_new_double(mpris_volume));
prv_change_props(device->props.player_props,
DLR_INTERFACE_PROP_VOLUME, val,
changed_props_vb);
}
- if (mute != G_MAXUINT) {
+ if (event->mute != G_MAXUINT) {
val = g_variant_ref_sink(
- g_variant_new_boolean(mute ? TRUE : FALSE));
+ g_variant_new_boolean(event->mute ? TRUE
+ : FALSE));
prv_change_props(device->props.player_props,
DLR_INTERFACE_PROP_MUTE, val,
changed_props_vb);
g_variant_builder_unref(changed_props_vb);
on_error:
+ source_id = (gint) event->source_id;
+ event->source_id = 0;
+ g_hash_table_remove(device->rc_event_handlers, &source_id);
+
+on_lost_device:
+
+ return FALSE;
+}
+
+static void prv_rc_last_change_cb(GUPnPServiceProxy *proxy,
+ const char *variable,
+ GValue *value,
+ gpointer user_data)
+{
+ GUPnPLastChangeParser *parser;
+ dlr_rc_event_t *event;
+ guint dev_volume = G_MAXUINT;
+ guint mute = G_MAXUINT;
+ gint *key;
+
+ parser = gupnp_last_change_parser_new();
+
+ if (!gupnp_last_change_parser_parse_last_change(
+ parser, 0,
+ g_value_get_string(value),
+ NULL,
+ "Volume", G_TYPE_UINT, &dev_volume,
+ "Mute", G_TYPE_UINT, &mute,
+ NULL))
+ goto on_error;
+
+ event = g_new0(dlr_rc_event_t, 1);
+ event->dev_volume = dev_volume;
+ event->mute = mute;
+ event->device = user_data;
+
+ /* We cannot execute the code in prv_process_rc_last_change directly
+ in this function as it can cause the main loop to be iterated, which
+ may cause a crash when we return back to GUPnP. This code will be
+ re-written once we can cancel calls to retrieve the service
+ introspection data. */
+
+ event->source_id = g_idle_add(prv_process_rc_last_change, event);
+ key = g_new(gint, 1);
+ *key = (gint) event->source_id;
+ g_hash_table_insert(event->device->rc_event_handlers, key, event);
+
+on_error:
g_object_unref(parser);
}
gpointer user_data)
{
gchar *rel_pos = NULL;
+ gchar *rel_cnt = NULL;
const gchar *message;
gboolean end;
dlr_async_task_t *cb_data = user_data;
dlr_device_data_t *device_data = cb_data->private;
GVariantBuilder *changed_props_vb;
GVariant *changed_props;
+ gint expected_props = 2;
end = gupnp_service_proxy_end_action(cb_data->proxy, cb_data->action,
- &error, "RelTime",
- G_TYPE_STRING, &rel_pos, NULL);
- if (!end || (rel_pos == NULL)) {
- message = (error != NULL) ? error->message : "Invalid result";
- cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
- DLEYNA_ERROR_OPERATION_FAILED,
- "GetPositionInfo operation failed: %s",
- message);
+ &error,
+ "RelTime", G_TYPE_STRING, &rel_pos,
+ "RelCount", G_TYPE_STRING,
+ &rel_cnt, NULL);
+
+ if (!end && !cb_data->task.type == DLR_TASK_GET_ALL_PROPS)
goto on_error;
+
+ if (rel_pos == NULL) {
+ expected_props--;
+ if (cb_data->task.type == DLR_TASK_GET_ALL_PROPS) {
+ /* Do not fail, just remove the property */
+ g_hash_table_remove(cb_data->device->props.player_props,
+ DLR_INTERFACE_PROP_POSITION);
+ } else if (!strcmp(cb_data->task.ut.get_prop.prop_name,
+ DLR_INTERFACE_PROP_POSITION)) {
+ goto on_error;
+ }
+ }
+
+ if (rel_cnt == NULL) {
+ expected_props--;
+ if (cb_data->task.type == DLR_TASK_GET_ALL_PROPS) {
+ /* Do not fail, just remove the property */
+ g_hash_table_remove(cb_data->device->props.player_props,
+ DLR_INTERFACE_PROP_BYTE_POSITION);
+ } else if (!strcmp(cb_data->task.ut.get_prop.prop_name,
+ DLR_INTERFACE_PROP_BYTE_POSITION)) {
+ goto on_error;
+ }
}
+ if (!expected_props)
+ goto out;
+
changed_props_vb = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
- g_strstrip(rel_pos);
- prv_add_reltime(cb_data->device, rel_pos, changed_props_vb);
- g_free(rel_pos);
+ if (rel_pos != NULL) {
+ g_strstrip(rel_pos);
+ prv_add_reltime(cb_data->device, rel_pos, changed_props_vb);
+ }
+ if (rel_cnt != NULL) {
+ g_strstrip(rel_cnt);
+ prv_add_relcount(cb_data->device, rel_cnt, changed_props_vb);
+ }
changed_props = g_variant_ref_sink(
g_variant_builder_end(changed_props_vb));
g_variant_unref(changed_props);
g_variant_builder_unref(changed_props_vb);
+ goto out;
+
on_error:
+ message = (error != NULL) ? error->message :
+ "Invalid result";
+ cb_data->error = g_error_new(
+ DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_OPERATION_FAILED,
+ "GetPositionInfo operation failed: %s",
+ message);
+
+out:
+
+ g_free(rel_pos);
+ g_free(rel_cnt);
+
if (error != NULL)
g_error_free(error);
return;
}
-static void prv_get_av_service_states_values(GUPnPServiceProxy *av_proxy,
- GVariant **mpris_tp_speeds,
- GPtrArray **upnp_tp_speeds,
- double *min_rate,
- double *max_rate)
+static gboolean prv_get_av_service_states_values(GUPnPServiceProxy *av_proxy,
+ GVariant **mpris_tp_speeds,
+ GPtrArray **upnp_tp_speeds,
+ double *min_rate,
+ double *max_rate)
{
const GUPnPServiceStateVariableInfo *svi;
GUPnPServiceIntrospection *introspection;
GError *error = NULL;
GVariant *speeds = NULL;
GList *allowed_values;
+ gpointer weak_ref = NULL;
+ gboolean device_alive = TRUE;
+
+ /* TODO: this weak_ref hack is needed as
+ gupnp_service_info_get_introspection iterates the main loop.
+ This can result in our device getting deleted before this
+ function returns. Ultimately, this code needs to be re-written
+ to use gupnp_service_info_get_introspection_async but this cannot
+ really be done until GUPnP provides a way to cancel this function. */
+
+ weak_ref = av_proxy;
+ g_object_add_weak_pointer(G_OBJECT(av_proxy), &weak_ref);
+
+ introspection = gupnp_service_info_get_introspection(
+ GUPNP_SERVICE_INFO(av_proxy),
+ &error);
+
+ if (!weak_ref) {
+ DLEYNA_LOG_WARNING("Lost device during introspection call");
+ device_alive = FALSE;
+ goto exit;
+ }
+
+ g_object_remove_weak_pointer(G_OBJECT(av_proxy), &weak_ref);
- introspection = gupnp_service_info_get_introspection(
- GUPNP_SERVICE_INFO(av_proxy),
- &error);
if (error != NULL) {
DLEYNA_LOG_DEBUG(
"failed to fetch AV service introspection file");
exit:
- return;
+ return device_alive;
}
-static void prv_get_rc_service_states_values(GUPnPServiceProxy *rc_proxy,
- guint *max_volume)
+static gboolean prv_get_rc_service_states_values(GUPnPServiceProxy *rc_proxy,
+ guint *max_volume)
{
const GUPnPServiceStateVariableInfo *svi;
GUPnPServiceIntrospection *introspection;
GError *error = NULL;
+ gpointer weak_ref = NULL;
+ gboolean device_alive = TRUE;
+
+ /* TODO: this weak_ref hack is needed as
+ gupnp_service_info_get_introspection iterates the main loop.
+ This can result in our device getting deleted before this
+ function returns. Ultimately, this code needs to be re-written
+ to use gupnp_service_info_get_introspection_async but this cannot
+ really be done until GUPnP provides a way to cancel this function. */
+
+ weak_ref = rc_proxy;
+ g_object_add_weak_pointer(G_OBJECT(rc_proxy), &weak_ref);
+
+ introspection = gupnp_service_info_get_introspection(
+ GUPNP_SERVICE_INFO(rc_proxy),
+ &error);
+
+ if (!weak_ref) {
+ DLEYNA_LOG_WARNING("Lost device during introspection call");
+ device_alive = FALSE;
+ goto exit;
+ }
+
+ g_object_remove_weak_pointer(G_OBJECT(rc_proxy), &weak_ref);
- introspection = gupnp_service_info_get_introspection(
- GUPNP_SERVICE_INFO(rc_proxy),
- &error);
if (error != NULL) {
DLEYNA_LOG_DEBUG(
"failed to fetch RC service introspection file");
exit:
- return;
+ return device_alive;
}
static void prv_update_device_props(GUPnPDeviceInfo *proxy, GHashTable *props)
GVariant *val;
gchar *str;
+ prv_update_prop_dlna_device_classes(proxy, props);
+
val = g_variant_ref_sink(g_variant_new_string(
gupnp_device_info_get_device_type(proxy)));
g_hash_table_insert(props, DLR_INTERFACE_PROP_DEVICE_TYPE, val);
val = g_variant_ref_sink(g_variant_new_string(str));
g_hash_table_insert(props, DLR_INTERFACE_PROP_PRESENTATION_URL, val);
g_free(str);
-
}
static void prv_add_player_speed_props(GHashTable *player_props,
}
}
-static void prv_props_update(dlr_device_t *device, dlr_task_t *task)
+static gboolean prv_props_update(dlr_device_t *device, dlr_task_t *task)
{
GVariant *val;
GUPnPDeviceInfo *info;
dlr_props_t *props = &device->props;
GVariantBuilder *changed_props_vb;
GVariant *changed_props;
+ gboolean device_alive = TRUE;
context = dlr_device_get_context(device);
g_hash_table_insert(props->root_props, DLR_INTERFACE_PROP_IDENTITY,
g_variant_ref(val));
- changed_props_vb = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
-
service_proxies = &context->service_proxies;
+ /* TODO: We should not retrieve these values here. They should be
+ retrieved during device construction. */
+
if (service_proxies->av_proxy)
- prv_get_av_service_states_values(
- service_proxies->av_proxy,
- &device->mpris_transport_play_speeds,
- &device->transport_play_speeds,
- &device->min_rate,
- &device->max_rate);
+ if (!prv_get_av_service_states_values(
+ service_proxies->av_proxy,
+ &device->mpris_transport_play_speeds,
+ &device->transport_play_speeds,
+ &device->min_rate,
+ &device->max_rate)) {
+ DLEYNA_LOG_DEBUG("Lost Device AV");
+
+ device_alive = FALSE;
+ goto on_lost_device;
+ }
+
+ /* TODO: We should not retrieve these values here. They should be
+ retrieved during device construction. */
if (service_proxies->rc_proxy)
- prv_get_rc_service_states_values(service_proxies->rc_proxy,
- &device->max_volume);
+ if (!prv_get_rc_service_states_values(service_proxies->rc_proxy,
+ &device->max_volume)) {
+ DLEYNA_LOG_DEBUG("Lost Device RC");
+ device_alive = FALSE;
+ goto on_lost_device;
+ }
+
+ changed_props_vb = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
prv_add_player_speed_props(device->props.player_props,
device->min_rate, device->max_rate,
changed_props);
g_variant_unref(changed_props);
g_variant_builder_unref(changed_props_vb);
+
+on_lost_device:
+
+ return device_alive;
}
static void prv_complete_get_prop(dlr_async_task_t *cb_data)
g_variant_iter_init(&iter, tps);
while (g_variant_iter_next(&iter, "d", &tps_value)) {
-
if (fabs(mpris_rate - tps_value) <= 0.01) {
val = g_variant_ref_sink(
g_variant_new_double(tps_value));
if ((!strcmp(get_prop->interface_name, DLR_INTERFACE_PLAYER) ||
!strcmp(get_prop->interface_name, "")) &&
(!strcmp(task->ut.get_prop.prop_name,
- DLR_INTERFACE_PROP_POSITION))) {
+ DLR_INTERFACE_PROP_POSITION) ||
+ !strcmp(task->ut.get_prop.prop_name,
+ DLR_INTERFACE_PROP_BYTE_POSITION))) {
/* Need to read the current position. This property is not
evented */
cb_data->cb = cb;
cb_data->device = device;
- if (!device->props.synced)
- prv_props_update(device, task);
+ if (!device->props.synced && !prv_props_update(device, task)) {
+ cb_data->error = g_error_new(
+ DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_OPERATION_FAILED,
+ "Lost Device");
+ } else {
+ prv_get_prop(cb_data);
+ }
- prv_get_prop(cb_data);
(void) g_idle_add(dlr_async_task_complete, cb_data);
}
}
dlr_task_get_props_t *get_props = &task->ut.get_props;
dlr_device_data_t *device_cb_data;
- if (!device->props.synced)
- prv_props_update(device, task);
+ cb_data->cb = cb;
+ cb_data->device = device;
- if ((!strcmp(get_props->interface_name, DLR_INTERFACE_PLAYER) ||
+ if (!device->props.synced && !prv_props_update(device, task)) {
+ cb_data->error = g_error_new(
+ DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_OPERATION_FAILED,
+ "Lost Device");
+ (void) g_idle_add(dlr_async_task_complete, cb_data);
+ } else if ((!strcmp(get_props->interface_name, DLR_INTERFACE_PLAYER) ||
!strcmp(get_props->interface_name, ""))) {
-
/* Need to read the current position. This property is not
evented */
device_cb_data = g_new(dlr_device_data_t, 1);
device_cb_data->local_cb = prv_complete_get_props;
- cb_data->cb = cb;
cb_data->private = device_cb_data;
- cb_data->device = device;
cb_data->free_private = g_free;
prv_get_position_info(cb_data);
} else {
- cb_data->cb = cb;
- cb_data->device = device;
-
prv_get_props(cb_data);
(void) g_idle_add(dlr_async_task_complete, cb_data);
}
{
dlr_async_task_t *cb_data = user_data;
GError *upnp_error = NULL;
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ gchar *type;
+#endif
if (!gupnp_service_proxy_end_action(cb_data->proxy, cb_data->action,
&upnp_error, NULL)) {
upnp_error->message);
g_error_free(upnp_error);
- goto exit;
+ goto on_error;
}
prv_reset_transport_speed_props(cb_data->device);
-exit:
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ if (cb_data->task.type == DLR_TASK_OPEN_URI)
+ type = "OPEN URI";
+ else if (cb_data->task.type == DLR_TASK_OPEN_NEXT_URI)
+ type = "OPEN NEXT URI";
+ else if (cb_data->task.type == DLR_TASK_SET_URI)
+ type = "SET URI";
+
+ DLEYNA_LOG_DEBUG("Task: %s", type);
+#endif
+
+ if (cb_data->task.type == DLR_TASK_OPEN_URI) {
+ cb_data->action =
+ gupnp_service_proxy_begin_action(
+ cb_data->proxy,
+ "Play",
+ prv_simple_call_cb,
+ cb_data,
+ "InstanceID", G_TYPE_INT, 0,
+ "Speed", G_TYPE_STRING,
+ cb_data->device->rate, NULL);
+ goto on_exit;
+ }
+
+on_error:
(void) g_idle_add(dlr_async_task_complete, cb_data);
g_cancellable_disconnect(cb_data->cancellable, cb_data->cancel_id);
+
+on_exit:
+ return;
}
void dlr_device_open_uri(dlr_device_t *device, dlr_task_t *task,
DLEYNA_LOG_INFO("URI: %s", open_uri_data->uri);
DLEYNA_LOG_INFO("METADATA: %s", metadata ? metadata : "Not provided");
+ DLEYNA_LOG_INFO("ACTION: %s", open_uri_data->operation);
context = dlr_device_get_context(device);
cb_data->cb = cb;
cb_data->action =
gupnp_service_proxy_begin_action(cb_data->proxy,
- "SetAVTransportURI",
+ open_uri_data->operation,
prv_open_uri_cb,
cb_data,
"InstanceID", G_TYPE_INT, 0,
- "CurrentURI", G_TYPE_STRING,
+ open_uri_data->uri_type,
+ G_TYPE_STRING,
open_uri_data->uri,
- "CurrentURIMetaData",
+ open_uri_data->metadata_type,
G_TYPE_STRING,
metadata ? metadata : "",
NULL);
if (!strcmp(pos_type, "TRACK_NR"))
position = g_strdup_printf("%u", seek_data->track_number);
- else
+ else if (g_strrstr(pos_type, "_TIME") != NULL)
position = prv_int64_to_duration(seek_data->position);
+ else
+ position = g_strdup_printf("%llu",
+ (long long unsigned int)seek_data->counter_position);
DLEYNA_LOG_INFO("set %s position : %s", pos_type, position);
void dlr_device_seek(dlr_device_t *device, dlr_task_t *task,
dlr_upnp_task_complete_t cb)
{
- prv_device_set_position(device, task, "REL_TIME", cb);
+ if (task->type == DLR_TASK_SEEK)
+ prv_device_set_position(device, task, "REL_TIME", cb);
+ else
+ prv_device_set_position(device, task, "REL_COUNT", cb);
}
void dlr_device_set_position(dlr_device_t *device, dlr_task_t *task,
dlr_upnp_task_complete_t cb)
{
- prv_device_set_position(device, task, "ABS_TIME", cb);
+ if (task->type == DLR_TASK_SET_POSITION)
+ prv_device_set_position(device, task, "ABS_TIME", cb);
+ else
+ prv_device_set_position(device, task, "ABS_COUNT", cb);
}
void dlr_device_goto_track(dlr_device_t *device, dlr_task_t *task,
double max_rate;
guint construct_step;
dlr_device_icon_t icon;
+ GHashTable *rc_event_handlers;
};
void dlr_device_construct(
exec_prefix=@exec_prefix@
libexecdir=@libexecdir@
includedir=${prefix}/include
-libdir=@libdir@
+libdir=@libdir@/@PACKAGE@
Name: @PACKAGE@
Description: UPnP & DLNA renderer library
# You can't enable levels disabled at compile time
# level=8 means all level flags defined at compile time.
log-level=7
+
+
+# Network filtering
+[netf]
+
+# true: Enable the network filtering.
+# false: Disable the network filtering.
+netf-enabled=false
+
+# Comma-separated list of interface name, SSID or IP address.
+# If netf is enabled but the list is empty, it behaves as disabled.
+netf-list=
# You can't enable levels disabled at compile time
# level=8 means all level flags defined at compile time.
log-level=@with_log_level@
+
+
+# Network filtering
+[netf]
+
+# true: Enable the network filtering.
+# false: Disable the network filtering.
+netf-enabled=false
+
+# Comma-separated list of interface name, SSID or IP address.
+# If netf is enabled but the list is empty, it behaves as disabled.
+netf-list=
--- /dev/null
+/*
+ * dLeyna
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
+ *
+ */
+
+#include <glib.h>
+#include <string.h>
+
+#include <libdleyna/core/error.h>
+#include <libdleyna/core/log.h>
+#include <libdleyna/core/service-task.h>
+#include <libdleyna/core/white-list.h>
+
+#include "async.h"
+#include "manager.h"
+#include "prop-defs.h"
+#include "server.h"
+
+struct dlr_manager_t_ {
+ dleyna_connector_id_t connection;
+ GUPnPContextManager *cm;
+};
+
+static void prv_add_list_wl_entries(gpointer data, gpointer user_data)
+{
+ GVariantBuilder *vb = (GVariantBuilder *)user_data;
+ gchar *entry = (gchar *)data;
+
+ g_variant_builder_add(vb, "s", entry);
+}
+
+static void prv_add_all_props(GUPnPContextManager *manager, GVariantBuilder *vb)
+{
+ GUPnPWhiteList *wl;
+ GList *list;
+ GVariantBuilder vb2;
+
+ wl = gupnp_context_manager_get_white_list(manager);
+ list = gupnp_white_list_get_entries(wl);
+
+ g_variant_builder_add(vb, "{sv}", DLR_INTERFACE_PROP_WHITE_LIST_ENABLED,
+ g_variant_new_boolean(
+ gupnp_white_list_get_enabled(wl)));
+
+ g_variant_builder_init(&vb2, G_VARIANT_TYPE("as"));
+ g_list_foreach(list, prv_add_list_wl_entries, &vb2);
+
+ g_variant_builder_add(vb, "{sv}", DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES,
+ g_variant_builder_end(&vb2));
+}
+
+static GVariant *prv_get_prop(GUPnPContextManager *manager, const gchar *prop)
+{
+ GVariant *retval = NULL;
+ GUPnPWhiteList *wl;
+ GVariantBuilder vb;
+ GList *list;
+ gboolean b_value;
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ gchar *prop_str;
+#endif
+
+ wl = gupnp_context_manager_get_white_list(manager);
+
+ if (!strcmp(prop, DLR_INTERFACE_PROP_WHITE_LIST_ENABLED)) {
+ b_value = gupnp_white_list_get_enabled(wl);
+ retval = g_variant_ref_sink(g_variant_new_boolean(b_value));
+
+ } else if (!strcmp(prop, DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES)) {
+ list = gupnp_white_list_get_entries(wl);
+
+ g_variant_builder_init(&vb, G_VARIANT_TYPE("as"));
+ g_list_foreach(list, prv_add_list_wl_entries, &vb);
+ retval = g_variant_ref_sink(g_variant_builder_end(&vb));
+ }
+
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ if (retval) {
+ prop_str = g_variant_print(retval, FALSE);
+ DLEYNA_LOG_DEBUG("Prop %s = %s", prop, prop_str);
+ g_free(prop_str);
+ }
+#endif
+
+ return retval;
+}
+
+static void prv_wl_notify_prop(dlr_manager_t *manager, const gchar *prop_name)
+{
+ GVariant *prop_val;
+ GVariant *val;
+ GVariantBuilder array;
+
+ prop_val = prv_get_prop(manager->cm, prop_name);
+
+ g_variant_builder_init(&array, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&array, "{sv}", prop_name, prop_val);
+
+ val = g_variant_new("(s@a{sv}as)", DLEYNA_SERVER_INTERFACE_MANAGER,
+ g_variant_builder_end(&array),
+ NULL);
+
+ (void) dlr_renderer_get_connector()->notify(
+ manager->connection,
+ DLEYNA_SERVER_OBJECT,
+ DLR_INTERFACE_PROPERTIES,
+ DLR_INTERFACE_PROPERTIES_CHANGED,
+ val,
+ NULL);
+ g_variant_unref(prop_val);
+}
+
+static void prv_wl_notify_enabled_prop(gpointer user_data)
+{
+ prv_wl_notify_prop((dlr_manager_t *)user_data,
+ DLR_INTERFACE_PROP_WHITE_LIST_ENABLED);
+}
+
+static void prv_wl_notify_entries_prop(gpointer user_data)
+{
+ prv_wl_notify_prop((dlr_manager_t *)user_data,
+ DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES);
+}
+
+dlr_manager_t *dlr_manager_new(dleyna_connector_id_t connection,
+ GUPnPContextManager *connection_manager)
+{
+ dlr_manager_t *manager = g_new0(dlr_manager_t, 1);
+ dleyna_white_list_t wl_info;
+
+ manager->connection = connection;
+ manager->cm = connection_manager;
+
+ wl_info.wl = gupnp_context_manager_get_white_list(manager->cm);
+ wl_info.cb_enabled = prv_wl_notify_enabled_prop;
+ wl_info.cb_entries = prv_wl_notify_entries_prop;
+ wl_info.user_data = manager;
+
+ dleyna_white_list_set_info(&wl_info);
+
+ return manager;
+}
+
+void dlr_manager_delete(dlr_manager_t *manager)
+{
+ if (manager != NULL) {
+ dleyna_white_list_set_info(NULL);
+ g_free(manager);
+ }
+}
+
+void dlr_manager_wl_enable(dlr_task_t *task)
+{
+ dleyna_white_list_enable(task->ut.white_list.enabled, TRUE);
+}
+
+void dlr_manager_wl_add_entries(dlr_task_t *task)
+{
+ dleyna_white_list_add_entries(task->ut.white_list.entries, TRUE);
+}
+
+void dlr_manager_wl_remove_entries(dlr_task_t *task)
+{
+ dleyna_white_list_remove_entries(task->ut.white_list.entries, TRUE);
+}
+
+void dlr_manager_wl_clear(dlr_task_t *task)
+{
+ dleyna_white_list_clear(TRUE);
+}
+
+void dlr_manager_get_all_props(dlr_manager_t *manager,
+ dlr_task_t *task,
+ dlr_manager_task_complete_t cb)
+{
+ dlr_async_task_t *cb_data = (dlr_async_task_t *)task;
+ dlr_task_get_props_t *task_data = &task->ut.get_props;
+ GVariantBuilder vb;
+
+ DLEYNA_LOG_DEBUG("Enter");
+ DLEYNA_LOG_DEBUG("Path: %s", task->path);
+ DLEYNA_LOG_DEBUG("Interface %s", task->ut.get_prop.interface_name);
+
+ cb_data->cb = cb;
+
+ g_variant_builder_init(&vb, G_VARIANT_TYPE("a{sv}"));
+
+ if (!strcmp(task_data->interface_name,
+ DLEYNA_SERVER_INTERFACE_MANAGER) ||
+ !strcmp(task_data->interface_name, "")) {
+ cb_data->cancel_id = g_cancellable_connect(
+ cb_data->cancellable,
+ G_CALLBACK(dlr_async_task_cancelled),
+ cb_data, NULL);
+
+ prv_add_all_props(manager->cm, &vb);
+
+ cb_data->task.result = g_variant_ref_sink(
+ g_variant_builder_end(&vb));
+ } else {
+ DLEYNA_LOG_WARNING("Interface is unknown.");
+
+ cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_UNKNOWN_INTERFACE,
+ "Interface is unknown.");
+ }
+
+ (void) g_idle_add(dlr_async_task_complete, cb_data);
+ g_cancellable_disconnect(cb_data->cancellable, cb_data->cancel_id);
+
+ DLEYNA_LOG_DEBUG("Exit");
+}
+
+void dlr_manager_get_prop(dlr_manager_t *manager,
+ dlr_task_t *task,
+ dlr_manager_task_complete_t cb)
+{
+ dlr_async_task_t *cb_data = (dlr_async_task_t *)task;
+ dlr_task_get_prop_t *task_data = &task->ut.get_prop;
+
+ DLEYNA_LOG_DEBUG("Enter");
+ DLEYNA_LOG_DEBUG("Path: %s", task->path);
+ DLEYNA_LOG_DEBUG("Interface %s", task->ut.get_prop.interface_name);
+ DLEYNA_LOG_DEBUG("Prop.%s", task->ut.get_prop.prop_name);
+
+ cb_data->cb = cb;
+
+ if (!strcmp(task_data->interface_name,
+ DLEYNA_SERVER_INTERFACE_MANAGER) ||
+ !strcmp(task_data->interface_name, "")) {
+ cb_data->cancel_id = g_cancellable_connect(
+ cb_data->cancellable,
+ G_CALLBACK(dlr_async_task_cancelled),
+ cb_data, NULL);
+
+ cb_data->task.result = prv_get_prop(manager->cm,
+ task_data->prop_name);
+
+ if (!cb_data->task.result)
+ cb_data->error = g_error_new(
+ DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_UNKNOWN_PROPERTY,
+ "Unknown property");
+ } else {
+ DLEYNA_LOG_WARNING("Interface is unknown.");
+
+ cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_UNKNOWN_INTERFACE,
+ "Interface is unknown.");
+ }
+
+ (void) g_idle_add(dlr_async_task_complete, cb_data);
+ g_cancellable_disconnect(cb_data->cancellable, cb_data->cancel_id);
+
+ DLEYNA_LOG_DEBUG("Exit");
+}
--- /dev/null
+/*
+ * dLeyna
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
+ *
+ */
+
+#ifndef DLR_MANAGER_H__
+#define DLR_MANAGER_H__
+
+#include <libdleyna/core/connector.h>
+#include <libgupnp/gupnp-context-manager.h>
+
+#include "task.h"
+
+typedef struct dlr_manager_t_ dlr_manager_t;
+typedef void (*dlr_manager_task_complete_t)(dlr_task_t *task, GError *error);
+
+dlr_manager_t *dlr_manager_new(dleyna_connector_id_t connection,
+ GUPnPContextManager *connection_manager);
+
+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);
+
+void dlr_manager_get_all_props(dlr_manager_t *manager,
+ dlr_task_t *task,
+ dlr_manager_task_complete_t cb);
+
+void dlr_manager_get_prop(dlr_manager_t *manager,
+ dlr_task_t *task,
+ dlr_manager_task_complete_t cb);
+
+#endif /* DLR_MANAGER_H__ */
#define DLR_INTERFACE_PROPERTIES_CHANGED "PropertiesChanged"
+/* Manager Properties */
+#define DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES "WhiteListEntries"
+#define DLR_INTERFACE_PROP_WHITE_LIST_ENABLED "WhiteListEnabled"
+
#define DLR_INTERFACE_PROP_CAN_QUIT "CanQuit"
#define DLR_INTERFACE_PROP_CAN_RAISE "CanRaise"
#define DLR_INTERFACE_PROP_CAN_SET_FULLSCREEN "CanSetFullscreen"
#define DLR_INTERFACE_PROP_RATE "Rate"
#define DLR_INTERFACE_PROP_CAN_PLAY "CanPlay"
#define DLR_INTERFACE_PROP_CAN_SEEK "CanSeek"
+#define DLR_INTERFACE_PROP_CAN_BYTE_SEEK "CanByteSeek"
#define DLR_INTERFACE_PROP_CAN_CONTROL "CanControl"
#define DLR_INTERFACE_PROP_CAN_PAUSE "CanPause"
#define DLR_INTERFACE_PROP_CAN_NEXT "CanGoNext"
#define DLR_INTERFACE_PROP_CAN_PREVIOUS "CanGoPrevious"
#define DLR_INTERFACE_PROP_POSITION "Position"
+#define DLR_INTERFACE_PROP_BYTE_POSITION "BytePosition"
#define DLR_INTERFACE_PROP_METADATA "Metadata"
#define DLR_INTERFACE_PROP_TRANSPORT_PLAY_SPEEDS "TransportPlaySpeeds"
#define DLR_INTERFACE_PROP_MINIMUM_RATE "MinimumRate"
#define DLR_INTERFACE_PROP_NUMBER_OF_TRACKS "NumberOfTracks"
#define DLR_INTERFACE_PROP_MUTE "Mute"
+#define DLR_INTERFACE_PROP_DLNA_DEVICE_CLASSES "DeviceClasses"
#define DLR_INTERFACE_PROP_DEVICE_TYPE "DeviceType"
#define DLR_INTERFACE_PROP_UDN "UDN"
#define DLR_INTERFACE_PROP_FRIENDLY_NAME "FriendlyName"
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
-#include <sys/signalfd.h>
#include <libdleyna/core/connector.h>
#include <libdleyna/core/control-point.h>
#include "async.h"
#include "control-point-renderer.h"
#include "device.h"
+#include "manager.h"
#include "prop-defs.h"
#include "server.h"
#include "upnp.h"
#define DLR_INTERFACE_GET_RENDERERS "GetRenderers"
#define DLR_INTERFACE_RESCAN "Rescan"
#define DLR_INTERFACE_RELEASE "Release"
+#define DLR_INTERFACE_WHITE_LIST_ENABLE "WhiteListEnable"
+#define DLR_INTERFACE_WHITE_LIST_ADD_ENTRIES "WhiteListAddEntries"
+#define DLR_INTERFACE_WHITE_LIST_REMOVE_ENTRIES "WhiteListRemoveEntries"
+#define DLR_INTERFACE_WHITE_LIST_CLEAR "WhiteListClear"
+
+#define DLR_INTERFACE_ENTRY_LIST "EntryList"
+#define DLR_INTERFACE_IS_ENABLED "IsEnabled"
#define DLR_INTERFACE_FOUND_RENDERER "FoundRenderer"
#define DLR_INTERFACE_LOST_RENDERER "LostRenderer"
#define DLR_INTERFACE_VALUE "value"
#define DLR_INTERFACE_OFFSET "offset"
#define DLR_INTERFACE_POSITION "position"
+#define DLR_INTERFACE_BYTE_POSITION "byte_position"
#define DLR_INTERFACE_TRACKID "trackid"
#define DLR_INTERFACE_TRACK_NUMBER "TrackNumber"
#define DLR_INTERFACE_STOP "Stop"
#define DLR_INTERFACE_OPEN_URI "OpenUri"
#define DLR_INTERFACE_OPEN_URI_EX "OpenUriEx"
+#define DLR_INTERFACE_OPEN_NEXT_URI "OpenNextUri"
+#define DLR_INTERFACE_SET_URI "SetUri"
#define DLR_INTERFACE_SEEK "Seek"
+#define DLR_INTERFACE_BYTE_SEEK "ByteSeek"
#define DLR_INTERFACE_SET_POSITION "SetPosition"
+#define DLR_INTERFACE_SET_BYTE_POSITION "SetBytePosition"
#define DLR_INTERFACE_GOTO_TRACK "GotoTrack"
#define DLR_INTERFACE_CANCEL "Cancel"
#define DLR_INTERFACE_MIME_TYPE "MimeType"
#define DLR_INTERFACE_REQ_MIME_TYPE "RequestedMimeType"
+enum dlr_manager_interface_type_ {
+ DLR_MANAGER_INTERFACE_MANAGER,
+ DLR_MANAGER_INTERFACE_INFO_PROPERTIES,
+ DLR_MANAGER_INTERFACE_INFO_MAX
+};
+
typedef struct dlr_context_t_ dlr_context_t;
struct dlr_context_t_ {
- guint dlr_id;
+ guint dlr_id[DLR_MANAGER_INTERFACE_INFO_MAX];
dleyna_connector_id_t connection;
guint watchers;
dleyna_task_processor_t *processor;
const dleyna_connector_t *connector;
dlr_upnp_t *upnp;
dleyna_settings_t *settings;
+ dlr_manager_t *manager;
};
static dlr_context_t g_context;
" <method name='"DLR_INTERFACE_RELEASE"'>"
" </method>"
" <method name='"DLR_INTERFACE_GET_RENDERERS"'>"
- " <arg type='as' name='"DLR_INTERFACE_RENDERERS"'"
+ " <arg type='ao' name='"DLR_INTERFACE_RENDERERS"'"
" direction='out'/>"
" </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='s' name='"DLR_INTERFACE_PATH"'/>"
+ " <arg type='o' name='"DLR_INTERFACE_PATH"'/>"
" </signal>"
" <signal name='"DLR_INTERFACE_LOST_RENDERER"'>"
- " <arg type='s' name='"DLR_INTERFACE_PATH"'/>"
+ " <arg type='o' name='"DLR_INTERFACE_PATH"'/>"
+ " </signal>"
+ " <property type='as' name='"DLR_INTERFACE_PROP_WHITE_LIST_ENTRIES"'"
+ " access='read'/>"
+ " <property type='b' name='"DLR_INTERFACE_PROP_WHITE_LIST_ENABLED"'"
+ " access='read'/>"
+ " </interface>"
+ " <interface name='"DLR_INTERFACE_PROPERTIES"'>"
+ " <method name='"DLR_INTERFACE_GET"'>"
+ " <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='out'/>"
+ " </method>"
+ " <method name='"DLR_INTERFACE_GET_ALL"'>"
+ " <arg type='s' name='"DLR_INTERFACE_INTERFACE_NAME"'"
+ " direction='in'/>"
+ " <arg type='a{sv}' name='"DLR_INTERFACE_PROPERTIES_VALUE"'"
+ " direction='out'/>"
+ " </method>"
+ " <signal name='"DLR_INTERFACE_PROPERTIES_CHANGED"'>"
+ " <arg type='s' name='"DLR_INTERFACE_INTERFACE_NAME"'/>"
+ " <arg type='a{sv}' name='"DLR_INTERFACE_CHANGED_PROPERTIES"'/>"
+ " <arg type='as' name='"
+ DLR_INTERFACE_INVALIDATED_PROPERTIES"'/>"
" </signal>"
" </interface>"
"</node>";
" <arg type='s' name='"DLR_INTERFACE_METADATA"'"
" direction='in'/>"
" </method>"
+ " <method name='"DLR_INTERFACE_OPEN_NEXT_URI"'>"
+ " <arg type='s' name='"DLR_INTERFACE_URI"'"
+ " direction='in'/>"
+ " <arg type='s' name='"DLR_INTERFACE_METADATA"'"
+ " direction='in'/>"
+ " </method>"
+ " <method name='"DLR_INTERFACE_SET_URI"'>"
+ " <arg type='s' name='"DLR_INTERFACE_URI"'"
+ " direction='in'/>"
+ " <arg type='s' name='"DLR_INTERFACE_METADATA"'"
+ " direction='in'/>"
+ " </method>"
" <method name='"DLR_INTERFACE_SEEK"'>"
" <arg type='x' name='"DLR_INTERFACE_OFFSET"'"
" direction='in'/>"
" </method>"
+ " <method name='"DLR_INTERFACE_BYTE_SEEK"'>"
+ " <arg type='x' name='"DLR_INTERFACE_OFFSET"'"
+ " direction='in'/>"
+ " </method>"
" <method name='"DLR_INTERFACE_SET_POSITION"'>"
" <arg type='o' name='"DLR_INTERFACE_TRACKID"'"
" direction='in'/>"
" <arg type='x' name='"DLR_INTERFACE_POSITION"'"
" direction='in'/>"
" </method>"
+ " <method name='"DLR_INTERFACE_SET_BYTE_POSITION"'>"
+ " <arg type='o' name='"DLR_INTERFACE_TRACKID"'"
+ " direction='in'/>"
+ " <arg type='x' name='"DLR_INTERFACE_BYTE_POSITION"'"
+ " direction='in'/>"
+ " </method>"
" <method name='"DLR_INTERFACE_GOTO_TRACK"'>"
" <arg type='u' name='"DLR_INTERFACE_TRACK_NUMBER"'"
" direction='in'/>"
" access='read'/>"
" <property type='b' name='"DLR_INTERFACE_PROP_CAN_SEEK"'"
" access='read'/>"
+ " <property type='b' name='"DLR_INTERFACE_PROP_CAN_BYTE_SEEK"'"
+ " access='read'/>"
" <property type='b' name='"DLR_INTERFACE_PROP_CAN_CONTROL"'"
" access='read'/>"
" <property type='b' name='"DLR_INTERFACE_PROP_CAN_PAUSE"'"
" access='read'/>"
" <property type='x' name='"DLR_INTERFACE_PROP_POSITION"'"
" access='read'/>"
+ " <property type='x' name='"DLR_INTERFACE_PROP_BYTE_POSITION"'"
+ " access='read'/>"
" <property type='a{sv}' name='"DLR_INTERFACE_PROP_METADATA"'"
" access='read'/>"
" <property type='u' name='"DLR_INTERFACE_PROP_CURRENT_TRACK"'"
" <arg type='s' name='"DLR_INTERFACE_MIME_TYPE"'"
" direction='out'/>"
" </method>"
+ " <property type='as' "
+ " name='"DLR_INTERFACE_PROP_DLNA_DEVICE_CLASSES"'"
+ " access='read'/>"
" <property type='s' name='"DLR_INTERFACE_PROP_DEVICE_TYPE"'"
" access='read'/>"
" <property type='s' name='"DLR_INTERFACE_PROP_UDN"'"
" </interface>"
"</node>";
+static const gchar *g_manager_interfaces[DLR_MANAGER_INTERFACE_INFO_MAX] = {
+ /* MUST be in the exact same order as g_root_introspection */
+ DLEYNA_SERVER_INTERFACE_MANAGER,
+ DLR_INTERFACE_PROPERTIES
+};
+
static void prv_process_task(dleyna_task_atom_t *task, gpointer user_data);
-static void prv_dlr_method_call(dleyna_connector_id_t conn,
- const gchar *sender,
- const gchar *object,
- const gchar *interface,
- const gchar *method,
- GVariant *parameters,
- dleyna_connector_msg_id_t invocation);
+static void prv_manager_root_method_call(dleyna_connector_id_t conn,
+ const gchar *sender,
+ const gchar *object,
+ const gchar *interface,
+ const gchar *method,
+ GVariant *parameters,
+ dleyna_connector_msg_id_t invocation);
+
+static void prv_manager_props_method_call(dleyna_connector_id_t conn,
+ const gchar *sender,
+ const gchar *object,
+ const gchar *interface,
+ const gchar *method,
+ GVariant *parameters,
+ dleyna_connector_msg_id_t invocation);
static void prv_dlr_device_method_call(dleyna_connector_id_t conn,
const gchar *sender,
GVariant *parameters,
dleyna_connector_msg_id_t invocation);
-static const dleyna_connector_dispatch_cb_t g_root_vtables[1] = {
- prv_dlr_method_call
+static const dleyna_connector_dispatch_cb_t
+ g_root_vtables[DLR_MANAGER_INTERFACE_INFO_MAX] = {
+ /* MUST be in the exact same order as g_root_introspection */
+ prv_manager_root_method_call,
+ prv_manager_props_method_call
};
static const dleyna_connector_dispatch_cb_t
g_server_vtables[DLR_INTERFACE_INFO_MAX] = {
- /* MUST be in the exact same order as g_msu_server_introspection */
+ /* MUST be in the exact same order as g_server_introspection */
prv_props_method_call,
prv_dlr_device_method_call,
prv_dlr_player_method_call,
prv_renderer_device_method_call
};
+static const gchar *g_server_interfaces[DLR_INTERFACE_INFO_MAX] = {
+ /* MUST be in the exact same order as g_server_introspection */
+ DLR_INTERFACE_PROPERTIES,
+ DLR_INTERFACE_SERVER,
+ DLR_INTERFACE_PLAYER,
+ DLEYNA_INTERFACE_PUSH_HOST,
+ DLEYNA_SERVER_INTERFACE_RENDERER_DEVICE
+};
+
+const gchar *dlr_renderer_get_interface_name(guint index)
+{
+ return g_server_interfaces[index];
+}
+
const dleyna_connector_t *dlr_renderer_get_connector(void)
{
return g_context.connector;
switch (task->type) {
case DLR_TASK_GET_VERSION:
+ task->result = g_variant_ref_sink(g_variant_new_string(
+ VERSION));
dlr_task_complete(task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
break;
case DLR_TASK_GET_SERVERS:
task->result = dlr_upnp_get_server_ids(g_context.upnp);
dlr_task_complete(task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
break;
case DLR_TASK_RESCAN:
dlr_upnp_rescan(g_context.upnp);
dlr_task_complete(task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
+ 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:
DLEYNA_ERROR_NOT_SUPPORTED,
"Command not supported.");
dlr_task_fail(task, error);
- dleyna_task_queue_task_completed(task->atom.queue_id);
g_error_free(error);
break;
default:
+ goto finished;
break;
}
+
+ dleyna_task_queue_task_completed(task->atom.queue_id);
+
+finished:
+ return;
}
static void prv_async_task_complete(dlr_task_t *task, GError *error)
{
DLEYNA_LOG_DEBUG("Enter");
- if (error) {
+ if (!error) {
+ dlr_task_complete(task);
+ } else {
dlr_task_fail(task, error);
g_error_free(error);
- } else {
- dlr_task_complete(task);
}
dleyna_task_queue_task_completed(task->atom.queue_id);
prv_async_task_complete);
break;
case DLR_TASK_OPEN_URI:
+ case DLR_TASK_OPEN_NEXT_URI:
+ case DLR_TASK_SET_URI:
dlr_upnp_open_uri(g_context.upnp, task,
prv_async_task_complete);
break;
case DLR_TASK_SEEK:
+ case DLR_TASK_BYTE_SEEK:
dlr_upnp_seek(g_context.upnp, task,
prv_async_task_complete);
break;
case DLR_TASK_SET_POSITION:
+ case DLR_TASK_SET_BYTE_POSITION:
dlr_upnp_set_position(g_context.upnp, task,
prv_async_task_complete);
break;
dlr_upnp_get_icon(g_context.upnp, task,
prv_async_task_complete);
break;
+ case DLR_TASK_MANAGER_GET_PROP:
+ dlr_manager_get_prop(g_context.manager, 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);
+ break;
default:
break;
}
static void prv_control_point_stop_service(void)
{
+ uint i;
+
if (g_context.upnp) {
dlr_upnp_unsubscribe(g_context.upnp);
dlr_upnp_delete(g_context.upnp);
}
if (g_context.connection) {
- if (g_context.dlr_id)
- g_context.connector->unpublish_object(
+ for (i = 0; i < DLR_MANAGER_INTERFACE_INFO_MAX; i++)
+ if (g_context.dlr_id[i])
+ g_context.connector->unpublish_object(
g_context.connection,
- g_context.dlr_id);
+ g_context.dlr_id[i]);
}
}
dleyna_task_queue_add_task(queue_id, &task->atom);
}
-static void prv_dlr_method_call(dleyna_connector_id_t conn,
+static void prv_manager_root_method_call(
+ dleyna_connector_id_t conn,
const gchar *sender, const gchar *object,
const gchar *interface,
const gchar *method, GVariant *parameters,
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;
return;
}
+static void prv_manager_props_method_call(dleyna_connector_id_t conn,
+ const gchar *sender,
+ const gchar *object,
+ const gchar *interface,
+ const gchar *method,
+ GVariant *parameters,
+ dleyna_connector_msg_id_t invocation)
+{
+ dlr_task_t *task;
+ GError *error = NULL;
+
+ if (!strcmp(method, DLR_INTERFACE_GET_ALL))
+ task = dlr_task_manager_get_props_new(invocation, object,
+ parameters, &error);
+ else if (!strcmp(method, DLR_INTERFACE_GET))
+ task = dlr_task_manager_get_prop_new(invocation, object,
+ parameters, &error);
+ else
+ goto finished;
+
+ if (!task) {
+ g_context.connector->return_error(invocation, error);
+ g_error_free(error);
+
+ goto finished;
+ }
+
+ prv_add_task(task, sender, task->path);
+
+finished:
+
+ return;
+}
+
static const gchar *prv_get_device_id(const gchar *object, GError **error)
{
dlr_device_t *device;
task = dlr_task_open_uri_new(invocation, object, parameters);
else if (!strcmp(method, DLR_INTERFACE_OPEN_URI_EX))
task = dlr_task_open_uri_ex_new(invocation, object, parameters);
+ else if (!strcmp(method, DLR_INTERFACE_OPEN_NEXT_URI))
+ task = dlr_task_open_next_uri_new(invocation, object,
+ parameters);
+ else if (!strcmp(method, DLR_INTERFACE_SET_URI))
+ task = dlr_task_set_uri_new(invocation, object, parameters);
else if (!strcmp(method, DLR_INTERFACE_SEEK))
task = dlr_task_seek_new(invocation, object, parameters);
+ else if (!strcmp(method, DLR_INTERFACE_BYTE_SEEK))
+ task = dlr_task_byte_seek_new(invocation, object, parameters);
else if (!strcmp(method, DLR_INTERFACE_SET_POSITION))
task = dlr_task_set_position_new(invocation, object,
parameters);
+ else if (!strcmp(method, DLR_INTERFACE_SET_BYTE_POSITION))
+ task = dlr_task_set_byte_position_new(invocation, object,
+ parameters);
else if (!strcmp(method, DLR_INTERFACE_GOTO_TRACK))
task = dlr_task_goto_track_new(invocation, object, parameters);
else
DLEYNA_SERVER_OBJECT,
DLEYNA_SERVER_INTERFACE_MANAGER,
DLR_INTERFACE_FOUND_RENDERER,
- g_variant_new("(s)", path),
+ g_variant_new("(o)", path),
NULL);
}
DLEYNA_SERVER_OBJECT,
DLEYNA_SERVER_INTERFACE_MANAGER,
DLR_INTERFACE_LOST_RENDERER,
- g_variant_new("(s)", path),
+ g_variant_new("(o)", path),
NULL);
dleyna_task_processor_remove_queues_for_sink(g_context.processor, path);
dleyna_connector_id_t connection)
{
gboolean retval = TRUE;
+ uint i;
g_context.connection = connection;
- g_context.dlr_id = g_context.connector->publish_object(
- connection,
- DLEYNA_SERVER_OBJECT,
- TRUE,
- 0,
- g_root_vtables);
+ for (i = 0; i < DLR_MANAGER_INTERFACE_INFO_MAX; i++)
+ g_context.dlr_id[i] = g_context.connector->publish_object(
+ connection,
+ DLEYNA_SERVER_OBJECT,
+ TRUE,
+ g_manager_interfaces[i],
+ g_root_vtables + i);
- if (!g_context.dlr_id) {
- retval = FALSE;
- goto out;
- } else {
+ if (g_context.dlr_id[DLR_MANAGER_INTERFACE_MANAGER]) {
g_context.upnp = dlr_upnp_new(connection,
g_server_vtables,
prv_found_media_server,
prv_lost_media_server);
+
+ g_context.manager = dlr_manager_new(connection,
+ dlr_upnp_get_context_manager(g_context.upnp));
+ } else {
+ retval = FALSE;
}
-out:
+ dleyna_settings_init_white_list(g_context.settings);
return retval;
}
{
return &g_control_point;
}
-
const dleyna_connector_t *dlr_renderer_get_connector(void);
+const gchar *dlr_renderer_get_interface_name(guint index);
+
#endif /* DLR_SERVER_H__ */
#include "async.h"
#include "server.h"
+#define DLR_TASK_SET_URI_OPERATION "SetAVTransportURI"
+#define DLR_TASK_SET_URI_TYPE "CurrentURI"
+#define DLR_TASK_SET_URI_META_DATA "CurrentURIMetaData"
+
+#define DLR_TASK_SET_NEXT_URI_OPERATION "SetNextAVTransportURI"
+#define DLR_TASK_SET_NEXT_URI_TYPE "NextURI"
+#define DLR_TASK_SET_NEXT_URI_META_DATA "NextURIMetaData"
+
dlr_task_t *dlr_task_rescan_new(dleyna_connector_msg_id_t invocation)
{
dlr_task_t *task = g_new0(dlr_task_t, 1);
task->type = DLR_TASK_GET_VERSION;
task->invocation = invocation;
task->result_format = "(@s)";
- task->result = g_variant_ref_sink(g_variant_new_string(VERSION));
task->synchronous = TRUE;
return task;
task->type = DLR_TASK_GET_SERVERS;
task->invocation = invocation;
- task->result_format = "(@as)";
+ task->result_format = "(@ao)";
task->synchronous = TRUE;
return task;
dlr_async_task_delete((dlr_async_task_t *)task);
switch (task->type) {
+ case DLR_TASK_MANAGER_GET_ALL_PROPS:
case DLR_TASK_GET_ALL_PROPS:
g_free(task->ut.get_props.interface_name);
break;
+ case DLR_TASK_MANAGER_GET_PROP:
case DLR_TASK_GET_PROP:
g_free(task->ut.get_prop.interface_name);
g_free(task->ut.get_prop.prop_name);
g_variant_unref(task->ut.set_prop.params);
break;
case DLR_TASK_OPEN_URI:
+ case DLR_TASK_OPEN_NEXT_URI:
+ case DLR_TASK_SET_URI:
g_free(task->ut.open_uri.uri);
g_free(task->ut.open_uri.metadata);
break;
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;
}
return task;
}
+dlr_task_t *dlr_task_byte_seek_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path, GVariant *parameters)
+{
+ dlr_task_t *task = prv_device_task_new(DLR_TASK_BYTE_SEEK, invocation,
+ path, NULL);
+
+ g_variant_get(parameters, "(x)", &task->ut.seek.counter_position);
+
+ return task;
+}
+
dlr_task_t *dlr_task_set_position_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters)
{
return task;
}
+dlr_task_t *dlr_task_set_byte_position_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path,
+ GVariant *parameters)
+{
+ gchar *track_id;
+
+ dlr_task_t *task = prv_device_task_new(DLR_TASK_SET_BYTE_POSITION,
+ invocation, path, NULL);
+
+ g_variant_get(parameters, "(&ox)", &track_id,
+ &task->ut.seek.counter_position);
+
+ return task;
+}
+
dlr_task_t *dlr_task_goto_track_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters)
{
g_variant_get(parameters, "(s)", &task->ut.open_uri.uri);
g_strstrip(task->ut.open_uri.uri);
- task->ut.open_uri.metadata = NULL;
+ task->ut.open_uri.operation = DLR_TASK_SET_URI_OPERATION;
+ task->ut.open_uri.uri_type = DLR_TASK_SET_URI_TYPE;
+ task->ut.open_uri.metadata_type = DLR_TASK_SET_URI_META_DATA;
+
+ return task;
+}
+
+static dlr_task_t *prv_open_uri_ex_generic(dlr_task_t *task,
+ GVariant *parameters,
+ const gchar *operation,
+ const gchar *uri_type,
+ const gchar *metadata_type)
+{
+ g_variant_get(parameters, "(ss)", &task->ut.open_uri.uri,
+ &task->ut.open_uri.metadata);
+ g_strstrip(task->ut.open_uri.uri);
+ g_strstrip(task->ut.open_uri.metadata);
+ task->ut.open_uri.operation = operation;
+ task->ut.open_uri.uri_type = uri_type;
+ task->ut.open_uri.metadata_type = metadata_type;
return task;
}
task = prv_device_task_new(DLR_TASK_OPEN_URI, invocation, path,
NULL);
- g_variant_get(parameters, "(ss)",
- &task->ut.open_uri.uri, &task->ut.open_uri.metadata);
- g_strstrip(task->ut.open_uri.uri);
- g_strstrip(task->ut.open_uri.metadata);
+ return prv_open_uri_ex_generic(task,
+ parameters,
+ DLR_TASK_SET_URI_OPERATION,
+ DLR_TASK_SET_URI_TYPE,
+ DLR_TASK_SET_URI_META_DATA);
+}
- return task;
+dlr_task_t *dlr_task_open_next_uri_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path, GVariant *parameters)
+{
+ dlr_task_t *task;
+
+ task = prv_device_task_new(DLR_TASK_OPEN_NEXT_URI, invocation, path,
+ NULL);
+
+ return prv_open_uri_ex_generic(task,
+ parameters,
+ DLR_TASK_SET_NEXT_URI_OPERATION,
+ DLR_TASK_SET_NEXT_URI_TYPE,
+ DLR_TASK_SET_NEXT_URI_META_DATA);
+}
+
+dlr_task_t *dlr_task_set_uri_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path, GVariant *parameters)
+{
+ dlr_task_t *task;
+
+ task = prv_device_task_new(DLR_TASK_SET_URI, invocation, path,
+ NULL);
+
+ return prv_open_uri_ex_generic(task,
+ parameters,
+ DLR_TASK_SET_URI_OPERATION,
+ DLR_TASK_SET_URI_TYPE,
+ DLR_TASK_SET_URI_META_DATA);
}
dlr_task_t *dlr_task_host_uri_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);
+
+ 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;
+}
+
+dlr_task_t *dlr_task_manager_get_props_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);
+
+ 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));
+
+ task->type = DLR_TASK_MANAGER_GET_ALL_PROPS;
+ task->invocation = invocation;
+ task->result_format = "(@a{sv})";
+
+ return task;
+}
+
void dlr_task_complete(dlr_task_t *task)
{
GVariant *result;
DLR_TASK_NEXT,
DLR_TASK_PREVIOUS,
DLR_TASK_OPEN_URI,
+ DLR_TASK_OPEN_NEXT_URI,
+ DLR_TASK_SET_URI,
DLR_TASK_SEEK,
+ DLR_TASK_BYTE_SEEK,
DLR_TASK_SET_POSITION,
+ DLR_TASK_SET_BYTE_POSITION,
DLR_TASK_GOTO_TRACK,
DLR_TASK_HOST_URI,
DLR_TASK_REMOVE_URI,
- DLR_TASK_GET_ICON
+ 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
};
typedef enum dlr_task_type_t_ dlr_task_type_t;
struct dlr_task_open_uri_t_ {
gchar *uri;
gchar *metadata;
+ const gchar *operation;
+ const gchar *uri_type;
+ const gchar *metadata_type;
};
typedef struct dlr_task_seek_t_ dlr_task_seek_t;
struct dlr_task_seek_t_ {
+ guint64 counter_position;
gint64 position;
guint32 track_number;
};
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 */
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;
};
dlr_task_t *dlr_task_seek_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters);
+dlr_task_t *dlr_task_byte_seek_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path, GVariant *parameters);
+
dlr_task_t *dlr_task_set_position_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters);
+dlr_task_t *dlr_task_set_byte_position_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path,
+ GVariant *parameters);
+
dlr_task_t *dlr_task_goto_track_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters);
dlr_task_t *dlr_task_open_uri_ex_new(dleyna_connector_msg_id_t invocation,
const gchar *path, GVariant *parameters);
+dlr_task_t *dlr_task_open_next_uri_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path, GVariant *parameters);
+
+dlr_task_t *dlr_task_set_uri_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path, GVariant *parameters);
+
dlr_task_t *dlr_task_host_uri_new(dleyna_connector_msg_id_t invocation,
const gchar *path, const gchar *sender,
GVariant *parameters);
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,
+ GError **error);
+
+dlr_task_t *dlr_task_manager_get_props_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);
udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
- if (!udn)
- goto on_error;
-
ip_address = gupnp_context_get_host_ip(
gupnp_control_point_get_context(cp));
+ if (!udn || !ip_address)
+ goto on_error;
+
DLEYNA_LOG_DEBUG("UDN %s", udn);
DLEYNA_LOG_DEBUG("IP Address %s", ip_address);
udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
- if (!udn)
- goto on_error;
-
ip_address = gupnp_context_get_host_ip(
gupnp_control_point_get_context(cp));
+ if (!udn || !ip_address)
+ goto on_error;
+
DLEYNA_LOG_DEBUG("UDN %s", udn);
DLEYNA_LOG_DEBUG("IP Address %s", ip_address);
DLEYNA_LOG_DEBUG("Enter");
- g_variant_builder_init(&vb, G_VARIANT_TYPE("as"));
+ g_variant_builder_init(&vb, G_VARIANT_TYPE("ao"));
g_hash_table_iter_init(&iter, upnp->server_udn_map);
while (g_hash_table_iter_next(&iter, NULL, &value)) {
device = value;
- g_variant_builder_add(&vb, "s", device->path);
+ g_variant_builder_add(&vb, "o", device->path);
}
DLEYNA_LOG_DEBUG("Exit");
gupnp_context_manager_rescan_control_points(upnp->context_manager);
}
+
+GUPnPContextManager *dlr_upnp_get_context_manager(dlr_upnp_t *upnp)
+{
+ return upnp->context_manager;
+}
#ifndef DLR_UPNP_H__
#define DLR_UPNP_H__
+#include <libgupnp/gupnp-context-manager.h>
#include <libdleyna/core/connector.h>
#include "server.h"
void dlr_upnp_rescan(dlr_upnp_t *upnp);
+GUPnPContextManager *dlr_upnp_get_context_manager(dlr_upnp_t *upnp);
+
#endif /* DLR_UPNP_H__ */
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
;;
esac
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- gnu*)
- ;;
-
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
+version 0.2.1
+ - Various build optimizations
+ - Fix a crash case when the server stops
+ - Added the new TypeEx property and fixed Type
+ - Some documentation fixes
+ - Code cleanup
+ - Add a sample upload sync controller app
+ - Add network filtering support
+
version 0.1.0
- Prepare for first stable branch
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1
# automake: $automake_version
# autoconf: $autoconf_version
#
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
+VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1"
TIMESTAMP=""
package_revision=1.3337
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dleyna-server 0.2.0.
+# Generated by GNU Autoconf 2.69 for dleyna-server 0.2.1.
#
# Report bugs to <https://github.com/01org/dleyna-server/issues/new>.
#
# Identity of this package.
PACKAGE_NAME='dleyna-server'
PACKAGE_TARNAME='dleyna-server'
-PACKAGE_VERSION='0.2.0'
-PACKAGE_STRING='dleyna-server 0.2.0'
+PACKAGE_VERSION='0.2.1'
+PACKAGE_STRING='dleyna-server 0.2.1'
PACKAGE_BUGREPORT='https://github.com/01org/dleyna-server/issues/new'
PACKAGE_URL='https://01.org/dleyna/'
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dleyna-server 0.2.0 to adapt to many kinds of systems.
+\`configure' configures dleyna-server 0.2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dleyna-server 0.2.0:";;
+ short | recursive ) echo "Configuration of dleyna-server 0.2.1:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dleyna-server configure 0.2.0
+dleyna-server configure 0.2.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dleyna-server $as_me 0.2.0, which was
+It was created by dleyna-server $as_me 0.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='dleyna-server'
- VERSION='0.2.0'
+ VERSION='0.2.1'
cat >>confdefs.h <<_ACEOF
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
pkg_cv_DLEYNA_CORE_CFLAGS="$DLEYNA_CORE_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.2.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.2.2") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_DLEYNA_CORE_CFLAGS=`$PKG_CONFIG --cflags "dleyna-core-1.0 >= 0.0.1" 2>/dev/null`
+ pkg_cv_DLEYNA_CORE_CFLAGS=`$PKG_CONFIG --cflags "dleyna-core-1.0 >= 0.2.2" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
pkg_cv_DLEYNA_CORE_LIBS="$DLEYNA_CORE_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dleyna-core-1.0 >= 0.2.2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "dleyna-core-1.0 >= 0.2.2") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_DLEYNA_CORE_LIBS=`$PKG_CONFIG --libs "dleyna-core-1.0 >= 0.0.1" 2>/dev/null`
+ pkg_cv_DLEYNA_CORE_LIBS=`$PKG_CONFIG --libs "dleyna-core-1.0 >= 0.2.2" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dleyna-core-1.0 >= 0.0.1" 2>&1`
+ DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dleyna-core-1.0 >= 0.2.2" 2>&1`
else
- DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dleyna-core-1.0 >= 0.0.1" 2>&1`
+ DLEYNA_CORE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dleyna-core-1.0 >= 0.2.2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$DLEYNA_CORE_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (dleyna-core-1.0 >= 0.0.1) were not met:
+ as_fn_error $? "Package requirements (dleyna-core-1.0 >= 0.2.2) were not met:
$DLEYNA_CORE_PKG_ERRORS
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dleyna-server $as_me 0.2.0, which was
+This file was extended by dleyna-server $as_me 0.2.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dleyna-server config.status 0.2.0
+dleyna-server config.status 0.2.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
- enable-werror : ${enable_werror}
- enable-debug : ${enable_debug}
- enable-never-quit : ${enable_never_quit}
- - with_connector-name : ${with_connector_name}
+ - with-connector-name : ${with_connector_name}
- disable-optimization : ${disable_optimization}
- with-log-level : ${with_log_level}
- with-log-type : ${with_log_type}
AC_PREREQ([2.66])
AC_INIT([dleyna-server],
- [0.2.0],
+ [0.2.1],
[https://github.com/01org/dleyna-server/issues/new],
,
[https://01.org/dleyna/])
[master_build=no])
AS_IF([test "x$master_build" = "xno"],
- [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.0.1])],
+ [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.2.2])],
[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"
- enable-werror : ${enable_werror}
- enable-debug : ${enable_debug}
- enable-never-quit : ${enable_never_quit}
- - with_connector-name : ${with_connector_name}
+ - with-connector-name : ${with_connector_name}
- disable-optimization : ${disable_optimization}
- with-log-level : ${with_log_level}
- with-log-type : ${with_log_type}
libdleyna_serverincdir = $(includedir)/dleyna-1.0/libdleyna/server
-DLEYNA_SERVER_VERSION = 1:2:0
+DLEYNA_SERVER_VERSION = 1:3:0
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-lib_LTLIBRARIES = libdleyna-server-1.0.la
+pkglib_LTLIBRARIES = libdleyna-server-1.0.la
libdleyna_serverinc_HEADERS = control-point-server.h
server.c \
async.c \
device.c \
+ manager.c \
path.c \
props.c \
search.c \
client.h \
device.h \
interface.h \
+ manager.h \
path.h \
props.h \
search.h \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
+am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(sysconfdir)" \
"$(DESTDIR)$(libdleyna_serverincdir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
am__DEPENDENCIES_1 =
libdleyna_server_1_0_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am__objects_1 =
am_libdleyna_server_1_0_la_OBJECTS = $(am__objects_1) server.lo \
- async.lo device.lo path.lo props.lo search.lo sort.lo task.lo \
- upnp.lo
+ async.lo device.lo manager.lo path.lo props.lo search.lo \
+ sort.lo task.lo upnp.lo
libdleyna_server_1_0_la_OBJECTS = \
$(am_libdleyna_server_1_0_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
with_log_level = @with_log_level@
with_log_type = @with_log_type@
libdleyna_serverincdir = $(includedir)/dleyna-1.0/libdleyna/server
-DLEYNA_SERVER_VERSION = 1:2:0
+DLEYNA_SERVER_VERSION = 1:3:0
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DLEYNA_CORE_CFLAGS) \
-include config.h
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-lib_LTLIBRARIES = libdleyna-server-1.0.la
+pkglib_LTLIBRARIES = libdleyna-server-1.0.la
libdleyna_serverinc_HEADERS = control-point-server.h
libdleyna_server_1_0_la_LDFLAGS = -version-info $(DLEYNA_SERVER_VERSION) \
-no-undefined
server.c \
async.c \
device.c \
+ manager.c \
path.c \
props.c \
search.c \
client.h \
device.h \
interface.h \
+ manager.h \
path.h \
props.h \
search.h \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
dleyna-server-service.conf: $(top_builddir)/config.status $(srcdir)/dleyna-server-service.conf.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
}
-uninstall-libLTLIBRARIES:
+uninstall-pkglibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
done
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libdleyna-server-1.0.la: $(libdleyna_server_1_0_la_OBJECTS) $(libdleyna_server_1_0_la_DEPENDENCIES) $(EXTRA_libdleyna_server_1_0_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdleyna_server_1_0_la_LINK) -rpath $(libdir) $(libdleyna_server_1_0_la_OBJECTS) $(libdleyna_server_1_0_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libdleyna_server_1_0_la_LINK) -rpath $(pkglibdir) $(libdleyna_server_1_0_la_OBJECTS) $(libdleyna_server_1_0_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/async.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/props.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Plo@am__quote@
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(libdleyna_serverincdir)"; do \
+ for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(libdleyna_serverincdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
install-dvi-am:
-install-exec-am: install-libLTLIBRARIES install-sysconfDATA
+install-exec-am: install-pkglibLTLIBRARIES install-sysconfDATA
install-html: install-html-am
ps-am:
-uninstall-am: uninstall-libLTLIBRARIES \
- uninstall-libdleyna_serverincHEADERS uninstall-pkgconfigDATA \
+uninstall-am: uninstall-libdleyna_serverincHEADERS \
+ uninstall-pkgconfigDATA uninstall-pkglibLTLIBRARIES \
uninstall-sysconfDATA
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags distclean \
+ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am \
- install-libLTLIBRARIES install-libdleyna_serverincHEADERS \
- install-man install-pdf install-pdf-am install-pkgconfigDATA \
+ install-libdleyna_serverincHEADERS install-man install-pdf \
+ install-pdf-am install-pkgconfigDATA install-pkglibLTLIBRARIES \
install-ps install-ps-am install-strip install-sysconfDATA \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic maintainer-clean-local mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-libLTLIBRARIES uninstall-libdleyna_serverincHEADERS \
- uninstall-pkgconfigDATA uninstall-sysconfDATA
+ uninstall-libdleyna_serverincHEADERS uninstall-pkgconfigDATA \
+ uninstall-pkglibLTLIBRARIES uninstall-sysconfDATA
maintainer-clean-local:
if (cb_data->ut.bas.vbs)
g_ptr_array_unref(cb_data->ut.bas.vbs);
break;
+ case DLS_TASK_MANAGER_GET_ALL_PROPS:
case DLS_TASK_GET_ALL_PROPS:
case DLS_TASK_GET_RESOURCE:
if (cb_data->ut.get_all.vb)
if (!mclass)
goto on_error;
- media_class = dls_props_upnp_class_to_media_spec(mclass);
+ media_class = dls_props_upnp_class_to_media_spec_ex(mclass);
if (!media_class)
goto on_error;
while (caps && *caps) {
prop_name = g_hash_table_lookup(property_map, *caps);
- if (prop_name)
+ if (prop_name) {
g_variant_builder_add(&caps_vb, "s", prop_name);
+ /* TODO: Okay this is not very nice. A better
+ way to fix this would be to change the p_map
+ to be many : many. */
+
+ if (!strcmp(*caps, "upnp:class"))
+ g_variant_builder_add(
+ &caps_vb, "s",
+ DLS_INTERFACE_PROP_TYPE_EX);
+ }
+
caps++;
}
device_type = gupnp_device_info_get_device_type((GUPnPDeviceInfo *)
context->device_proxy);
- if (!g_str_has_prefix(device_type, DLS_DMS_DEVICE_TYPE))
+ if (!device_type || !g_str_has_prefix(device_type, DLS_DMS_DEVICE_TYPE))
goto on_error;
version = device_type + sizeof(DLS_DMS_DEVICE_TYPE) - 1;
GUPnPDIDLLiteContainer *container;
GVariantIter iter;
GVariant *child_type;
- const gchar *actual_type;
+ gchar *actual_type;
GUPnPOCMFlags flags;
gchar *retval = NULL;
- actual_type = dls_props_media_spec_to_upnp_class(
+ actual_type = dls_props_media_spec_ex_to_upnp_class(
task->ut.create_container.type);
if (!actual_type)
goto on_error;
task->ut.create_container.display_name);
gupnp_didl_lite_object_set_parent_id(item, parent_id);
gupnp_didl_lite_object_set_upnp_class(item, actual_type);
+ g_free(actual_type);
gupnp_didl_lite_object_set_restricted(item, FALSE);
flags = GUPNP_OCM_FLAGS_UPLOAD |
g_variant_iter_init(&iter, task->ut.create_container.child_types);
while ((child_type = g_variant_iter_next_value(&iter))) {
- actual_type = dls_props_media_spec_to_upnp_class(
+ actual_type = dls_props_media_spec_ex_to_upnp_class(
g_variant_get_string(child_type, NULL));
- if (actual_type != NULL)
+ if (actual_type != NULL) {
gupnp_didl_lite_container_add_create_class(container,
actual_type);
+ g_free(actual_type);
+ }
g_variant_unref(child_type);
}
retval = gupnp_didl_lite_object_get_album_xml_string(object);
else if (mask & DLS_UPNP_MASK_PROP_DATE)
retval = gupnp_didl_lite_object_get_date_xml_string(object);
- else if (mask & DLS_UPNP_MASK_PROP_TYPE)
+ else if (mask & DLS_UPNP_MASK_PROP_TYPE_EX)
retval = gupnp_didl_lite_object_get_upnp_class_xml_string(
object);
else if (mask & DLS_UPNP_MASK_PROP_TRACK_NUMBER)
{
GUPnPDIDLLiteContributor *artist;
const gchar *artist_name;
- const gchar *upnp_class;
+ gchar *upnp_class;
GVariantIter viter;
gchar *retval = NULL;
g_variant_get_string(value, NULL));
retval = gupnp_didl_lite_object_get_date_xml_string(object);
- } else if (mask & DLS_UPNP_MASK_PROP_TYPE) {
- upnp_class = dls_props_media_spec_to_upnp_class(
- g_variant_get_string(value, NULL));
+ } else if (mask & DLS_UPNP_MASK_PROP_TYPE_EX) {
+ upnp_class = dls_props_media_spec_ex_to_upnp_class(
+ g_variant_get_string(value, NULL));
if (!upnp_class)
goto on_error;
gupnp_didl_lite_object_set_upnp_class(object, upnp_class);
+ g_free(upnp_class);
retval = gupnp_didl_lite_object_get_upnp_class_xml_string(
object);
exec_prefix=@exec_prefix@
libexecdir=@libexecdir@
includedir=${prefix}/include
-libdir=@libdir@
+libdir=@libdir@/@PACKAGE@
Name: @PACKAGE@
Description: UPnP & DLNA server library
# IPC connector name
connector-name=dbus
+
# Log configuration options
[log]
# You can't enable levels disabled at compile time
# level=8 means all level flags defined at compile time.
log-level=7
+
+
+# Network filtering
+[netf]
+
+# true: Enable the network filtering.
+# false: Disable the network filtering.
+netf-enabled=false
+
+# Comma-separated list of interface name, SSID or IP address.
+# If netf is enabled but the list is empty, it behaves as disabled.
+netf-list=
# IPC connector name
connector-name=@with_connector_name@
+
# Log configuration options
[log]
# You can't enable levels disabled at compile time
# level=8 means all level flags defined at compile time.
log-level=@with_log_level@
+
+
+# Network filtering
+[netf]
+
+# true: Enable the network filtering.
+# false: Disable the network filtering.
+netf-enabled=false
+
+# Comma-separated list of interface name, SSID or IP address.
+# If netf is enabled but the list is empty, it behaves as disabled.
+netf-list=
#ifndef DLEYNA_SERVER_INTERFACE_H__
#define DLEYNA_SERVER_INTERFACE_H__
+enum dls_manager_interface_type_ {
+ DLS_MANAGER_INTERFACE_MANAGER,
+ DLS_MANAGER_INTERFACE_INFO_PROPERTIES,
+ DLS_MANAGER_INTERFACE_INFO_MAX
+};
+
enum dls_interface_type_ {
DLS_INTERFACE_INFO_PROPERTIES,
DLS_INTERFACE_INFO_OBJECT,
#define DLS_INTERFACE_MEDIA_OBJECT "org.gnome.UPnP.MediaObject2"
#define DLS_INTERFACE_MEDIA_ITEM "org.gnome.UPnP.MediaItem2"
+/* Manager Properties */
+#define DLS_INTERFACE_PROP_WHITE_LIST_ENTRIES "WhiteListEntries"
+#define DLS_INTERFACE_PROP_WHITE_LIST_ENABLED "WhiteListEnabled"
+
/* Object Properties */
#define DLS_INTERFACE_PROP_PATH "Path"
#define DLS_INTERFACE_PROP_PARENT "Parent"
#define DLS_INTERFACE_PROP_RESTRICTED "Restricted"
#define DLS_INTERFACE_PROP_DISPLAY_NAME "DisplayName"
#define DLS_INTERFACE_PROP_TYPE "Type"
+#define DLS_INTERFACE_PROP_TYPE_EX "TypeEx"
#define DLS_INTERFACE_PROP_CREATOR "Creator"
#define DLS_INTERFACE_PROP_DLNA_MANAGED "DLNAManaged"
#define DLS_INTERFACE_PROP_OBJECT_UPDATE_ID "ObjectUpdateID"
#define DLS_INTERFACE_SET_PROTOCOL_INFO "SetProtocolInfo"
#define DLS_INTERFACE_PREFER_LOCAL_ADDRESSES "PreferLocalAddresses"
+#define DLS_INTERFACE_WHITE_LIST_ENABLE "WhiteListEnable"
+#define DLS_INTERFACE_WHITE_LIST_ADD_ENTRIES "WhiteListAddEntries"
+#define DLS_INTERFACE_WHITE_LIST_REMOVE_ENTRIES "WhiteListRemoveEntries"
+#define DLS_INTERFACE_WHITE_LIST_CLEAR "WhiteListClear"
+
#define DLS_INTERFACE_FOUND_SERVER "FoundServer"
#define DLS_INTERFACE_LOST_SERVER "LostServer"
#define DLS_INTERFACE_CREATE_REFERENCE "CreateReference"
#define DLS_INTERFACE_REFPATH "RefPath"
+#define DLS_INTERFACE_ENTRY_LIST "EntryList"
+#define DLS_INTERFACE_IS_ENABLED "IsEnabled"
+
#endif /* DLEYNA_SERVER_INTERFACE_H__ */
--- /dev/null
+/*
+ * dLeyna
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
+ *
+ */
+
+#include <glib.h>
+#include <string.h>
+
+#include <libdleyna/core/error.h>
+#include <libdleyna/core/log.h>
+#include <libdleyna/core/service-task.h>
+#include <libdleyna/core/white-list.h>
+
+#include "interface.h"
+#include "manager.h"
+#include "props.h"
+
+struct dls_manager_t_ {
+ dleyna_connector_id_t connection;
+ GUPnPContextManager *cm;
+};
+
+static void prv_wl_notify_prop(dls_manager_t *manager, const gchar *prop_name)
+{
+ GVariant *prop_val;
+ GVariant *val;
+ GVariantBuilder array;
+
+ prop_val = dls_props_get_manager_prop(manager->cm, prop_name);
+
+ g_variant_builder_init(&array, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&array, "{sv}", prop_name, prop_val);
+
+ val = g_variant_new("(s@a{sv}as)", DLEYNA_SERVER_INTERFACE_MANAGER,
+ g_variant_builder_end(&array),
+ NULL);
+
+ (void) dls_server_get_connector()->notify(manager->connection,
+ DLEYNA_SERVER_OBJECT,
+ DLS_INTERFACE_PROPERTIES,
+ DLS_INTERFACE_PROPERTIES_CHANGED,
+ val,
+ NULL);
+ g_variant_unref(prop_val);
+}
+
+static void prv_wl_notify_enabled_prop(gpointer user_data)
+{
+ prv_wl_notify_prop((dls_manager_t *)user_data,
+ DLS_INTERFACE_PROP_WHITE_LIST_ENABLED);
+}
+
+static void prv_wl_notify_entries_prop(gpointer user_data)
+{
+ prv_wl_notify_prop((dls_manager_t *)user_data,
+ DLS_INTERFACE_PROP_WHITE_LIST_ENTRIES);
+}
+
+dls_manager_t *dls_manager_new(dleyna_connector_id_t connection,
+ GUPnPContextManager *connection_manager)
+{
+ dls_manager_t *manager = g_new0(dls_manager_t, 1);
+ dleyna_white_list_t wl_info;
+
+ manager->connection = connection;
+ manager->cm = connection_manager;
+
+ wl_info.wl = gupnp_context_manager_get_white_list(manager->cm);
+ wl_info.cb_enabled = prv_wl_notify_enabled_prop;
+ wl_info.cb_entries = prv_wl_notify_entries_prop;
+ wl_info.user_data = manager;
+
+ dleyna_white_list_set_info(&wl_info);
+
+ return manager;
+}
+
+void dls_manager_delete(dls_manager_t *manager)
+{
+ if (manager != NULL) {
+ dleyna_white_list_set_info(NULL);
+ g_free(manager);
+ }
+}
+
+void dls_manager_wl_enable(dls_task_t *task)
+{
+ dleyna_white_list_enable(task->ut.white_list.enabled, TRUE);
+}
+
+void dls_manager_wl_add_entries(dls_task_t *task)
+{
+ dleyna_white_list_add_entries(task->ut.white_list.entries, TRUE);
+}
+
+void dls_manager_wl_remove_entries(dls_task_t *task)
+{
+ dleyna_white_list_remove_entries(task->ut.white_list.entries, TRUE);
+}
+
+void dls_manager_wl_clear(dls_task_t *task)
+{
+ dleyna_white_list_clear(TRUE);
+}
+
+void dls_manager_get_all_props(dls_manager_t *manager,
+ dls_task_t *task,
+ dls_manager_task_complete_t cb)
+{
+ dls_async_task_t *cb_data = (dls_async_task_t *)task;
+ dls_async_get_all_t *cb_task_data;
+ dls_task_get_props_t *task_data = &task->ut.get_props;
+
+ DLEYNA_LOG_DEBUG("Enter");
+ DLEYNA_LOG_DEBUG("Path: %s", task->target.path);
+ DLEYNA_LOG_DEBUG("Interface %s", task->ut.get_prop.interface_name);
+
+ cb_data->cb = cb;
+
+ cb_task_data = &cb_data->ut.get_all;
+ cb_task_data->vb = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
+
+ if (!strcmp(task_data->interface_name,
+ DLEYNA_SERVER_INTERFACE_MANAGER) ||
+ !strcmp(task_data->interface_name, "")) {
+ cb_data->cancel_id = g_cancellable_connect(
+ cb_data->cancellable,
+ G_CALLBACK(dls_async_task_cancelled_cb),
+ cb_data, NULL);
+
+ dls_props_add_manager(manager->cm, cb_task_data->vb);
+
+ cb_data->task.result = g_variant_ref_sink(
+ g_variant_builder_end(
+ cb_task_data->vb));
+ } else {
+ DLEYNA_LOG_WARNING("Interface is unknown.");
+
+ cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_UNKNOWN_INTERFACE,
+ "Interface is unknown.");
+ }
+
+ (void) g_idle_add(dls_async_task_complete, cb_data);
+ g_cancellable_disconnect(cb_data->cancellable, cb_data->cancel_id);
+
+ DLEYNA_LOG_DEBUG("Exit");
+}
+
+void dls_manager_get_prop(dls_manager_t *manager,
+ dls_task_t *task,
+ dls_manager_task_complete_t cb)
+{
+ dls_async_task_t *cb_data = (dls_async_task_t *)task;
+ dls_task_get_prop_t *task_data = &task->ut.get_prop;
+
+ DLEYNA_LOG_DEBUG("Enter");
+ DLEYNA_LOG_DEBUG("Path: %s", task->target.path);
+ DLEYNA_LOG_DEBUG("Interface %s", task->ut.get_prop.interface_name);
+ DLEYNA_LOG_DEBUG("Prop.%s", task->ut.get_prop.prop_name);
+
+ cb_data->cb = cb;
+
+ if (!strcmp(task_data->interface_name,
+ DLEYNA_SERVER_INTERFACE_MANAGER) ||
+ !strcmp(task_data->interface_name, "")) {
+ cb_data->cancel_id = g_cancellable_connect(
+ cb_data->cancellable,
+ G_CALLBACK(dls_async_task_cancelled_cb),
+ cb_data, NULL);
+
+ cb_data->task.result = dls_props_get_manager_prop(
+ manager->cm,
+ task_data->prop_name);
+
+ if (!cb_data->task.result)
+ cb_data->error = g_error_new(
+ DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_UNKNOWN_PROPERTY,
+ "Unknown property");
+ } else {
+ DLEYNA_LOG_WARNING("Interface is unknown.");
+
+ cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
+ DLEYNA_ERROR_UNKNOWN_INTERFACE,
+ "Interface is unknown.");
+ }
+
+ (void) g_idle_add(dls_async_task_complete, cb_data);
+ g_cancellable_disconnect(cb_data->cancellable, cb_data->cancel_id);
+
+ DLEYNA_LOG_DEBUG("Exit");
+}
--- /dev/null
+/*
+ * dLeyna
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU Lesser General Public License,
+ * version 2.1, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Ludovic Ferrandis <ludovic.ferrandis@intel.com>
+ *
+ */
+
+#ifndef DLS_MANAGER_H__
+#define DLS_MANAGER_H__
+
+#include <libdleyna/core/connector.h>
+#include <libgupnp/gupnp-context-manager.h>
+
+#include "task.h"
+
+typedef struct dls_manager_t_ dls_manager_t;
+typedef void (*dls_manager_task_complete_t)(dls_task_t *task, GError *error);
+
+dls_manager_t *dls_manager_new(dleyna_connector_id_t connection,
+ GUPnPContextManager *connection_manager);
+
+void dls_manager_delete(dls_manager_t *manager);
+
+void dls_manager_wl_enable(dls_task_t *task);
+
+void dls_manager_wl_add_entries(dls_task_t *task);
+
+void dls_manager_wl_remove_entries(dls_task_t *task);
+
+void dls_manager_wl_clear(dls_task_t *task);
+
+void dls_manager_get_all_props(dls_manager_t *manager,
+ dls_task_t *task,
+ dls_manager_task_complete_t cb);
+
+void dls_manager_get_prop(dls_manager_t *manager,
+ dls_task_t *task,
+ dls_manager_task_complete_t cb);
+
+#endif /* DLS_MANAGER_H__ */
#include "path.h"
#include "props.h"
+static const gchar gUPnPObject[] = "object";
static const gchar gUPnPContainer[] = "object.container";
-static const gchar gUPnPAlbum[] = "object.container.album";
-static const gchar gUPnPPerson[] = "object.container.person";
-static const gchar gUPnPGenre[] = "object.container.genre";
-static const gchar gUPnPPlaylist[] = "object.container.playlistContainer";
-static const gchar gUPnPStorage[] = "object.container.storageFolder";
static const gchar gUPnPAudioItem[] = "object.item.audioItem";
static const gchar gUPnPVideoItem[] = "object.item.videoItem";
static const gchar gUPnPImageItem[] = "object.item.imageItem";
-static const gchar gUPnPPlaylistItem[] = "object.item.playlistItem";
static const gchar gUPnPItem[] = "object.item";
+static const unsigned int gUPnPObjectLen =
+ (sizeof(gUPnPObject) / sizeof(gchar)) - 1;
static const unsigned int gUPnPContainerLen =
(sizeof(gUPnPContainer) / sizeof(gchar)) - 1;
-static const unsigned int gUPnPAlbumLen =
- (sizeof(gUPnPAlbum) / sizeof(gchar)) - 1;
-static const unsigned int gUPnPPersonLen =
- (sizeof(gUPnPPerson) / sizeof(gchar)) - 1;
-static const unsigned int gUPnPGenreLen =
- (sizeof(gUPnPGenre) / sizeof(gchar)) - 1;
-static const unsigned int gUPnPPlaylistLen =
- (sizeof(gUPnPPlaylist) / sizeof(gchar)) - 1;
-static const unsigned int gUPnPStorageLen =
- (sizeof(gUPnPStorage) / sizeof(gchar)) - 1;
static const unsigned int gUPnPAudioItemLen =
(sizeof(gUPnPAudioItem) / sizeof(gchar)) - 1;
static const unsigned int gUPnPVideoItemLen =
(sizeof(gUPnPVideoItem) / sizeof(gchar)) - 1;
static const unsigned int gUPnPImageItemLen =
(sizeof(gUPnPImageItem) / sizeof(gchar)) - 1;
-static const unsigned int gUPnPPlaylistItemLen =
- (sizeof(gUPnPPlaylistItem) / sizeof(gchar)) - 1;
static const unsigned int gUPnPItemLen =
(sizeof(gUPnPItem) / sizeof(gchar)) - 1;
-static const gchar gUPnPPhotoAlbum[] = "object.container.album.photoAlbum";
-static const gchar gUPnPMusicAlbum[] = "object.container.album.musicAlbum";
-static const gchar gUPnPMusicArtist[] = "object.container.person.musicArtist";
-static const gchar gUPnPMovieGenre[] = "object.container.genre.movieGenre";
-static const gchar gUPnPMusicGenre[] = "object.container.genre.musicGenre";
static const gchar gUPnPMusicTrack[] = "object.item.audioItem.musicTrack";
-static const gchar gUPnPAudioBroadcast[] =
- "object.item.audioItem.audioBroadcast";
-static const gchar gUPnPAudioBook[] = "object.item.audioItem.audioBook";
static const gchar gUPnPMovie[] = "object.item.videoItem.movie";
-static const gchar gUPnPMusicVideoClip[] =
- "object.item.videoItem.musicVideoClip";
-static const gchar gUPnPVideoBroadcast[] =
- "object.item.videoItem.videoBroadcast";
static const gchar gUPnPPhoto[] = "object.item.imageItem.photo";
static const gchar gMediaSpec2Container[] = "container";
-static const gchar gMediaSpec2Album[] = "album";
-static const gchar gMediaSpec2AlbumPhoto[] = "album.photo";
-static const gchar gMediaSpec2AlbumMusic[] = "album.music";
-static const gchar gMediaSpec2Person[] = "person";
-static const gchar gMediaSpec2PersonMusicArtist[] = "person.musicartist";
-static const gchar gMediaSpec2Genre[] = "genre";
-static const gchar gMediaSpec2GenreMovie[] = "genre.movie";
-static const gchar gMediaSpec2GenreMusic[] = "genre.music";
-static const gchar gMediaSpec2AudioMusic[] = "audio.music";
-static const gchar gMediaSpec2AudioBroadcast[] = "audio.broadcast";
+static const gchar gMediaSpec2AudioMusic[] = "music";
static const gchar gMediaSpec2Audio[] = "audio";
-static const gchar gMediaSpec2AudioBook[] = "audio.book";
static const gchar gMediaSpec2Video[] = "video";
static const gchar gMediaSpec2VideoMovie[] = "video.movie";
-static const gchar gMediaSpec2VideoMusicClip[] = "video.musicclip";
-static const gchar gMediaSpec2VideoBroadcast[] = "video.broadcast";
static const gchar gMediaSpec2Image[] = "image";
static const gchar gMediaSpec2ImagePhoto[] = "image.photo";
-static const gchar gMediaSpec2Playlist[] = "playlist";
-static const gchar gMediaSpec2PlaylistItem[] = "item.playlist";
-static const gchar gMediaSpec2Item[] = "item";
-static const gchar gMediaSpec2Storage[] = "storage";
+static const gchar gMediaSpec2ItemUnclassified[] = "item.unclassified";
+
+static const gchar gMediaSpec2ExItem[] = "item";
+
+static const unsigned int gMediaSpec2ExItemLen =
+ (sizeof(gMediaSpec2ExItem) / sizeof(gchar)) - 1;
+
+static const unsigned int gMediaSpec2ContainerLen =
+ (sizeof(gMediaSpec2Container) / sizeof(gchar)) - 1;
typedef struct dls_prop_dlna_t_ dls_prop_dlna_t;
struct dls_prop_dlna_t_ {
/* upnp:class */
prop_t = prv_prop_map_new("upnp:class",
DLS_UPNP_MASK_PROP_TYPE,
- FALSE, TRUE, TRUE);
+ FALSE, TRUE, FALSE);
g_hash_table_insert(f_map, DLS_INTERFACE_PROP_TYPE, prop_t);
g_hash_table_insert(p_map, "upnp:class", DLS_INTERFACE_PROP_TYPE);
+ prop_t = prv_prop_map_new("upnp:class",
+ DLS_UPNP_MASK_PROP_TYPE_EX,
+ FALSE, TRUE, TRUE);
+ g_hash_table_insert(f_map, DLS_INTERFACE_PROP_TYPE_EX, prop_t);
+
/* upnp:containerUpdateID */
prop_t = prv_prop_map_new("upnp:containerUpdateID",
DLS_UPNP_MASK_PROP_CONTAINER_UPDATE_ID,
create_class = ptr->data;
content = gupnp_didl_lite_create_class_get_content(
create_class);
- ms2_class = dls_props_upnp_class_to_media_spec(content);
+ ms2_class = dls_props_upnp_class_to_media_spec_ex(content);
inc_derived = gupnp_didl_lite_create_class_get_include_derived(
create_class);
g_variant_builder_add(&create_classes_vb,
return g_variant_builder_end(&create_classes_vb);
}
-const gchar *dls_props_media_spec_to_upnp_class(const gchar *m2spec_class)
+static const gchar *prv_media_spec_to_upnp_class(const gchar *m2spec_class)
{
const gchar *retval = NULL;
- if (!m2spec_class)
- goto on_error;
-
- if (!strcmp(m2spec_class, gMediaSpec2AlbumPhoto))
- retval = gUPnPPhotoAlbum;
- else if (!strcmp(m2spec_class, gMediaSpec2AlbumMusic))
- retval = gUPnPMusicAlbum;
- else if (!strcmp(m2spec_class, gMediaSpec2Album))
- retval = gUPnPAlbum;
- else if (!strcmp(m2spec_class, gMediaSpec2PersonMusicArtist))
- retval = gUPnPMusicArtist;
- else if (!strcmp(m2spec_class, gMediaSpec2Person))
- retval = gUPnPPerson;
- else if (!strcmp(m2spec_class, gMediaSpec2GenreMovie))
- retval = gUPnPMovieGenre;
- else if (!strcmp(m2spec_class, gMediaSpec2GenreMusic))
- retval = gUPnPMusicGenre;
- else if (!strcmp(m2spec_class, gMediaSpec2Genre))
- retval = gUPnPGenre;
- else if (!strcmp(m2spec_class, gMediaSpec2Container))
+ if (!strcmp(m2spec_class, gMediaSpec2Container))
retval = gUPnPContainer;
else if (!strcmp(m2spec_class, gMediaSpec2AudioMusic))
retval = gUPnPMusicTrack;
- else if (!strcmp(m2spec_class, gMediaSpec2AudioBroadcast))
- retval = gUPnPAudioBroadcast;
- else if (!strcmp(m2spec_class, gMediaSpec2AudioBook))
- retval = gUPnPAudioBook;
else if (!strcmp(m2spec_class, gMediaSpec2Audio))
retval = gUPnPAudioItem;
else if (!strcmp(m2spec_class, gMediaSpec2VideoMovie))
retval = gUPnPMovie;
- else if (!strcmp(m2spec_class, gMediaSpec2VideoMusicClip))
- retval = gUPnPMusicVideoClip;
- else if (!strcmp(m2spec_class, gMediaSpec2VideoBroadcast))
- retval = gUPnPVideoBroadcast;
else if (!strcmp(m2spec_class, gMediaSpec2Video))
retval = gUPnPVideoItem;
else if (!strcmp(m2spec_class, gMediaSpec2ImagePhoto))
retval = gUPnPPhoto;
else if (!strcmp(m2spec_class, gMediaSpec2Image))
retval = gUPnPImageItem;
- else if (!strcmp(m2spec_class, gMediaSpec2Playlist))
- retval = gUPnPPlaylist;
- else if (!strcmp(m2spec_class, gMediaSpec2PlaylistItem))
- retval = gUPnPPlaylistItem;
- else if (!strcmp(m2spec_class, gMediaSpec2Item))
+
+ return retval;
+}
+
+const gchar *dls_props_media_spec_to_upnp_class(const gchar *m2spec_class)
+{
+ const gchar *retval = NULL;
+
+ if (!m2spec_class)
+ goto on_error;
+
+ retval = prv_media_spec_to_upnp_class(m2spec_class);
+
+ if (!retval && !strcmp(m2spec_class, gMediaSpec2ItemUnclassified))
retval = gUPnPItem;
- else if (!strcmp(m2spec_class, gMediaSpec2Storage))
- retval = gUPnPStorage;
on_error:
return retval;
}
-const gchar *dls_props_upnp_class_to_media_spec(const gchar *upnp_class)
+gchar *dls_props_media_spec_ex_to_upnp_class(const gchar *m2spec_class)
+{
+ gchar *retval = NULL;
+ const gchar *basic_type;
+ const gchar *ptr = NULL;
+
+ if (!m2spec_class)
+ goto on_error;
+
+ basic_type = prv_media_spec_to_upnp_class(m2spec_class);
+ if (basic_type) {
+ retval = g_strdup(basic_type);
+ } else {
+ if (!strncmp(m2spec_class, gMediaSpec2ExItem,
+ gMediaSpec2ExItemLen))
+ ptr = m2spec_class + gMediaSpec2ExItemLen;
+ else if (!strncmp(m2spec_class, gMediaSpec2Container,
+ gMediaSpec2ContainerLen))
+ ptr = m2spec_class + gMediaSpec2ContainerLen;
+ if (ptr && (!*ptr || *ptr == '.'))
+ retval = g_strdup_printf("object.%s", m2spec_class);
+ }
+
+on_error:
+
+ return retval;
+}
+
+static const gchar *prv_upnp_class_to_media_spec(const gchar *upnp_class,
+ gboolean *exact)
{
const gchar *retval = NULL;
const gchar *ptr;
if (!upnp_class)
goto on_error;
- if (!strncmp(upnp_class, gUPnPAlbum, gUPnPAlbumLen)) {
- ptr = upnp_class + gUPnPAlbumLen;
- if (!strcmp(ptr, ".photoAlbum"))
- retval = gMediaSpec2AlbumPhoto;
- else if (!strcmp(ptr, ".musicAlbum"))
- retval = gMediaSpec2AlbumMusic;
- else
- retval = gMediaSpec2Album;
- } else if (!strncmp(upnp_class, gUPnPPerson, gUPnPPersonLen)) {
- ptr = upnp_class + gUPnPPersonLen;
- if (!strcmp(ptr, ".musicArtist"))
- retval = gMediaSpec2PersonMusicArtist;
- else
- retval = gMediaSpec2Person;
- } else if (!strncmp(upnp_class, gUPnPGenre, gUPnPGenreLen)) {
- ptr = upnp_class + gUPnPGenreLen;
- if (!strcmp(ptr, ".movieGenre"))
- retval = gMediaSpec2GenreMovie;
- else if (!strcmp(ptr, ".musicGenre"))
- retval = gMediaSpec2GenreMusic;
- else
- retval = gMediaSpec2Genre;
- } else if (!strncmp(upnp_class, gUPnPContainer, gUPnPContainerLen)) {
+ if (!strncmp(upnp_class, gUPnPContainer, gUPnPContainerLen)) {
ptr = upnp_class + gUPnPContainerLen;
- if (!*ptr || *ptr == '.')
+ if (!*ptr || *ptr == '.') {
retval = gMediaSpec2Container;
+ *exact = *ptr == 0;
+ }
} else if (!strncmp(upnp_class, gUPnPAudioItem, gUPnPAudioItemLen)) {
ptr = upnp_class + gUPnPAudioItemLen;
- if (!strcmp(ptr, ".musicTrack"))
+ if (!strcmp(ptr, ".musicTrack")) {
retval = gMediaSpec2AudioMusic;
- else if (!strcmp(ptr, ".audioBroadcast"))
- retval = gMediaSpec2AudioBroadcast;
- else if (!strcmp(ptr, ".audioBook"))
- retval = gMediaSpec2AudioBook;
- else
+ *exact = TRUE;
+ } else if (!*ptr || *ptr == '.') {
retval = gMediaSpec2Audio;
+ *exact = *ptr == 0;
+ }
} else if (!strncmp(upnp_class, gUPnPVideoItem, gUPnPVideoItemLen)) {
ptr = upnp_class + gUPnPVideoItemLen;
- if (!strcmp(ptr, ".movie"))
+ if (!strcmp(ptr, ".movie")) {
retval = gMediaSpec2VideoMovie;
- else if (!strcmp(ptr, ".musicVideoClip"))
- retval = gMediaSpec2VideoMusicClip;
- else if (!strcmp(ptr, ".videoBroadcast"))
- retval = gMediaSpec2VideoBroadcast;
- else
+ *exact = TRUE;
+ } else if (!*ptr || *ptr == '.') {
retval = gMediaSpec2Video;
+ *exact = *ptr == 0;
+ }
} else if (!strncmp(upnp_class, gUPnPImageItem, gUPnPImageItemLen)) {
ptr = upnp_class + gUPnPImageItemLen;
- if (!strcmp(ptr, ".photo"))
+ if (!strcmp(ptr, ".photo")) {
retval = gMediaSpec2ImagePhoto;
- else
+ *exact = TRUE;
+ } else if (!*ptr || *ptr == '.') {
retval = gMediaSpec2Image;
- } else if (!strncmp(upnp_class, gUPnPPlaylist,
- gUPnPPlaylistLen)) {
- retval = gMediaSpec2Playlist;
- } else if (!strncmp(upnp_class, gUPnPPlaylistItem,
- gUPnPPlaylistItemLen)) {
- retval = gMediaSpec2PlaylistItem;
+ *exact = *ptr == 0;
+ }
} else if (!strncmp(upnp_class, gUPnPItem, gUPnPItemLen)) {
ptr = upnp_class + gUPnPItemLen;
- if (!*ptr || *ptr == '.')
- retval = gMediaSpec2Item;
- } else if (!strncmp(upnp_class, gUPnPStorage,
- gUPnPStorageLen)) {
- retval = gMediaSpec2Storage;
+ if (!*ptr || *ptr == '.') {
+ retval = gMediaSpec2ItemUnclassified;
+ *exact = *ptr == 0;
+ }
+ }
+
+on_error:
+
+ return retval;
+}
+
+const gchar *dls_props_upnp_class_to_media_spec(const gchar *upnp_class)
+{
+ gboolean exact;
+
+ return prv_upnp_class_to_media_spec(upnp_class, &exact);
+}
+
+const gchar *dls_props_upnp_class_to_media_spec_ex(const gchar *upnp_class)
+{
+ const gchar *retval;
+ gboolean exact;
+
+ retval = prv_upnp_class_to_media_spec(upnp_class, &exact);
+ if (!retval)
+ goto on_error;
+
+ if (exact) {
+ if (retval == gMediaSpec2ItemUnclassified)
+ retval = gMediaSpec2ExItem;
+ } else {
+ retval = upnp_class + gUPnPObjectLen + 1;
}
on_error:
const char *creator;
const char *upnp_class;
const char *media_spec_type;
+ const char *media_spec_type_ex;
gboolean retval = FALSE;
gboolean rest;
GUPnPOCMFlags flags;
if (!media_spec_type)
goto on_error;
+ media_spec_type_ex = dls_props_upnp_class_to_media_spec_ex(upnp_class);
+
title = gupnp_didl_lite_object_get_title(object);
creator = gupnp_didl_lite_object_get_creator(object);
rest = gupnp_didl_lite_object_get_restricted(object);
prv_add_string_prop(item_vb, DLS_INTERFACE_PROP_TYPE,
media_spec_type);
+ if (filter_mask & DLS_UPNP_MASK_PROP_TYPE_EX)
+ prv_add_string_prop(item_vb, DLS_INTERFACE_PROP_TYPE_EX,
+ media_spec_type_ex);
+
if (filter_mask & DLS_UPNP_MASK_PROP_RESTRICTED)
prv_add_bool_prop(item_vb, DLS_INTERFACE_PROP_RESTRICTED, rest);
retval = g_variant_ref_sink(g_variant_new_string(
media_spec_type));
+ } else if (!strcmp(prop, DLS_INTERFACE_PROP_TYPE_EX)) {
+ upnp_class = gupnp_didl_lite_object_get_upnp_class(object);
+ media_spec_type =
+ dls_props_upnp_class_to_media_spec_ex(upnp_class);
+ if (!media_spec_type)
+ goto on_error;
+
+ DLEYNA_LOG_DEBUG("Prop %s = %s", prop, media_spec_type);
+
+ retval = g_variant_ref_sink(g_variant_new_string(
+ media_spec_type));
} else if (!strcmp(prop, DLS_INTERFACE_PROP_DISPLAY_NAME)) {
title = gupnp_didl_lite_object_get_title(object);
if (!title)
return retval;
}
+
+static void prv_add_list_wl_entries(gpointer data, gpointer user_data)
+{
+ GVariantBuilder *vb = (GVariantBuilder *)user_data;
+ gchar *entry = (gchar *)data;
+
+ g_variant_builder_add(vb, "s", entry);
+}
+
+void dls_props_add_manager(GUPnPContextManager *manager, GVariantBuilder *vb)
+{
+ GUPnPWhiteList *wl;
+ GList *list;
+ GVariantBuilder vb2;
+
+ wl = gupnp_context_manager_get_white_list(manager);
+ list = gupnp_white_list_get_entries(wl);
+
+ prv_add_bool_prop(vb, DLS_INTERFACE_PROP_WHITE_LIST_ENABLED,
+ gupnp_white_list_get_enabled(wl));
+
+ g_variant_builder_init(&vb2, G_VARIANT_TYPE("as"));
+ g_list_foreach(list, prv_add_list_wl_entries, &vb2);
+
+ g_variant_builder_add(vb, "{sv}", DLS_INTERFACE_PROP_WHITE_LIST_ENTRIES,
+ g_variant_builder_end(&vb2));
+}
+
+GVariant *dls_props_get_manager_prop(GUPnPContextManager *manager,
+ const gchar *prop)
+{
+ GVariant *retval = NULL;
+ GUPnPWhiteList *wl;
+ GVariantBuilder vb;
+ GList *list;
+ gboolean b_value;
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ gchar *prop_str;
+#endif
+
+ wl = gupnp_context_manager_get_white_list(manager);
+
+ if (!strcmp(prop, DLS_INTERFACE_PROP_WHITE_LIST_ENABLED)) {
+ b_value = gupnp_white_list_get_enabled(wl);
+ retval = g_variant_ref_sink(g_variant_new_boolean(b_value));
+
+ } else if (!strcmp(prop, DLS_INTERFACE_PROP_WHITE_LIST_ENTRIES)) {
+ list = gupnp_white_list_get_entries(wl);
+
+ g_variant_builder_init(&vb, G_VARIANT_TYPE("as"));
+ g_list_foreach(list, prv_add_list_wl_entries, &vb);
+ retval = g_variant_ref_sink(g_variant_builder_end(&vb));
+ }
+
+#if DLEYNA_LOG_LEVEL & DLEYNA_LOG_LEVEL_DEBUG
+ if (retval) {
+ prop_str = g_variant_print(retval, FALSE);
+ DLEYNA_LOG_DEBUG("Prop %s = %s", prop, prop_str);
+ g_free(prop_str);
+ }
+#endif
+
+ return retval;
+}
#ifndef DLS_PROPS_H__
#define DLS_PROPS_H__
+#include <libgupnp/gupnp.h>
#include <libgupnp-av/gupnp-av.h>
#include "async.h"
#define DLS_UPNP_MASK_PROP_WIDTH (1LL << 19)
#define DLS_UPNP_MASK_PROP_HEIGHT (1LL << 20)
#define DLS_UPNP_MASK_PROP_COLOR_DEPTH (1LL << 21)
-#define DLS_UPNP_MASK_PROP_ALBUM_ART_URL (1LL << 22)
+#define DLS_UPNP_MASK_PROP_ALBUM_ART_URL (1LL << 22)
#define DLS_UPNP_MASK_PROP_RESOURCES (1LL << 23)
#define DLS_UPNP_MASK_PROP_URL (1LL << 24)
#define DLS_UPNP_MASK_PROP_REFPATH (1LL << 25)
#define DLS_UPNP_MASK_PROP_DLNA_CONVERSION (1LL << 35)
#define DLS_UPNP_MASK_PROP_DLNA_OPERATION (1LL << 36)
#define DLS_UPNP_MASK_PROP_DLNA_FLAGS (1LL << 37)
+#define DLS_UPNP_MASK_PROP_TYPE_EX (1LL << 38)
#define DLS_UPNP_MASK_ALL_PROPS 0xffffffffffffffff
const gchar *dls_props_media_spec_to_upnp_class(const gchar *m2spec_class);
+gchar *dls_props_media_spec_ex_to_upnp_class(const gchar *m2spec_class);
+
const gchar *dls_props_upnp_class_to_media_spec(const gchar *upnp_class);
+const gchar *dls_props_upnp_class_to_media_spec_ex(const gchar *upnp_class);
+
+void dls_props_add_manager(GUPnPContextManager *manager, GVariantBuilder *vb);
+
+GVariant *dls_props_get_manager_prop(GUPnPContextManager *manager,
+ const gchar *prop);
+
#endif /* DLS_PROPS_H__ */
gchar *op = NULL;
gchar *value = NULL;
const gchar *translated_value;
+ gchar *translated_type_ex;
dls_prop_map_t *prop_map;
GString *str;
gint start_pos;
goto on_error;
g_free(value);
value = g_strdup_printf("\"%s\"", translated_value);
+ } else if (!strcmp(prop, DLS_INTERFACE_PROP_TYPE_EX)) {
+ /* Skip the quotes */
+
+ value[strlen(value) - 1] = 0;
+ translated_type_ex =
+ dls_props_media_spec_ex_to_upnp_class(
+ value + 1);
+ if (!translated_type_ex)
+ goto on_error;
+ g_free(value);
+ value = g_strdup_printf("\"%s\"", translated_type_ex);
+ g_free(translated_type_ex);
} else if (!strcmp(prop, DLS_INTERFACE_PROP_PARENT) ||
!strcmp(prop, DLS_INTERFACE_PROP_PATH)) {
value[strlen(value) - 1] = 0;
#include "control-point-server.h"
#include "device.h"
#include "interface.h"
+#include "manager.h"
#include "path.h"
#include "server.h"
#include "upnp.h"
dleyna_task_processor_t *processor;
const dleyna_connector_t *connector;
dleyna_settings_t *settings;
- guint dls_id;
+ guint dls_id[DLS_MANAGER_INTERFACE_INFO_MAX];
GHashTable *watchers;
dls_upnp_t *upnp;
+ dls_manager_t *manager;
};
static dls_server_context_t g_context;
" <arg type='b' name='"DLS_INTERFACE_PREFER"'"
" direction='in'/>"
" </method>"
+ " <method name='"DLS_INTERFACE_WHITE_LIST_ENABLE"'>"
+ " <arg type='b' name='"DLS_INTERFACE_IS_ENABLED"'"
+ " direction='in'/>"
+ " </method>"
+ " <method name='"DLS_INTERFACE_WHITE_LIST_ADD_ENTRIES"'>"
+ " <arg type='as' name='"DLS_INTERFACE_ENTRY_LIST"'"
+ " direction='in'/>"
+ " </method>"
+ " <method name='"DLS_INTERFACE_WHITE_LIST_REMOVE_ENTRIES"'>"
+ " <arg type='as' name='"DLS_INTERFACE_ENTRY_LIST"'"
+ " direction='in'/>"
+ " </method>"
+ " <method name='"DLS_INTERFACE_WHITE_LIST_CLEAR"'>"
+ " </method>"
" <signal name='"DLS_INTERFACE_FOUND_SERVER"'>"
" <arg type='o' name='"DLS_INTERFACE_PATH"'/>"
" </signal>"
" <signal name='"DLS_INTERFACE_LOST_SERVER"'>"
" <arg type='o' name='"DLS_INTERFACE_PATH"'/>"
" </signal>"
+ " <property type='as' name='"DLS_INTERFACE_PROP_WHITE_LIST_ENTRIES"'"
+ " access='read'/>"
+ " <property type='b' name='"DLS_INTERFACE_PROP_WHITE_LIST_ENABLED"'"
+ " access='read'/>"
+ " </interface>"
+ " <interface name='"DLS_INTERFACE_PROPERTIES"'>"
+ " <method name='"DLS_INTERFACE_GET"'>"
+ " <arg type='s' name='"DLS_INTERFACE_INTERFACE_NAME"'"
+ " direction='in'/>"
+ " <arg type='s' name='"DLS_INTERFACE_PROPERTY_NAME"'"
+ " direction='in'/>"
+ " <arg type='v' name='"DLS_INTERFACE_VALUE"'"
+ " direction='out'/>"
+ " </method>"
+ " <method name='"DLS_INTERFACE_GET_ALL"'>"
+ " <arg type='s' name='"DLS_INTERFACE_INTERFACE_NAME"'"
+ " direction='in'/>"
+ " <arg type='a{sv}' name='"DLS_INTERFACE_PROPERTIES_VALUE"'"
+ " direction='out'/>"
+ " </method>"
+ " <signal name='"DLS_INTERFACE_PROPERTIES_CHANGED"'>"
+ " <arg type='s' name='"DLS_INTERFACE_INTERFACE_NAME"'/>"
+ " <arg type='a{sv}' name='"DLS_INTERFACE_CHANGED_PROPERTIES"'/>"
+ " <arg type='as' name='"
+ DLS_INTERFACE_INVALIDATED_PROPERTIES"'/>"
+ " </signal>"
" </interface>"
"</node>";
" access='read'/>"
" <property type='s' name='"DLS_INTERFACE_PROP_TYPE"'"
" access='read'/>"
+ " <property type='s' name='"DLS_INTERFACE_PROP_TYPE_EX"'"
+ " access='read'/>"
" <property type='o' name='"DLS_INTERFACE_PROP_PATH"'"
" access='read'/>"
" <property type='s' name='"DLS_INTERFACE_PROP_DISPLAY_NAME"'"
" </interface>"
"</node>";
+static const gchar *g_manager_interfaces[DLS_MANAGER_INTERFACE_INFO_MAX] = {
+ /* MUST be in the exact same order as g_root_introspection */
+ DLEYNA_SERVER_INTERFACE_MANAGER,
+ DLS_INTERFACE_PROPERTIES
+};
+
const dleyna_connector_t *dls_server_get_connector(void)
{
return g_context.connector;
return g_context.processor;
}
-static void prv_sync_task_complete(dls_task_t *task)
-{
- dls_task_complete(task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
-}
-
static void prv_process_sync_task(dls_task_t *task)
{
dls_client_t *client;
switch (task->type) {
case DLS_TASK_GET_VERSION:
- prv_sync_task_complete(task);
+ task->result = g_variant_ref_sink(g_variant_new_string(
+ VERSION));
+ dls_task_complete(task);
break;
case DLS_TASK_GET_SERVERS:
task->result = dls_upnp_get_server_ids(g_context.upnp);
- prv_sync_task_complete(task);
+ dls_task_complete(task);
break;
case DLS_TASK_RESCAN:
dls_upnp_rescan(g_context.upnp);
- prv_sync_task_complete(task);
+ dls_task_complete(task);
break;
case DLS_TASK_SET_PROTOCOL_INFO:
client_name = dleyna_task_queue_get_source(task->atom.queue_id);
client->protocol_info = NULL;
}
}
- prv_sync_task_complete(task);
+ dls_task_complete(task);
break;
case DLS_TASK_SET_PREFER_LOCAL_ADDRESSES:
client_name = dleyna_task_queue_get_source(task->atom.queue_id);
client->prefer_local_addresses =
task->ut.prefer_local_addresses.prefer;
}
- prv_sync_task_complete(task);
+ dls_task_complete(task);
break;
case DLS_TASK_GET_UPLOAD_STATUS:
dls_upnp_get_upload_status(g_context.upnp, task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
break;
case DLS_TASK_GET_UPLOAD_IDS:
dls_upnp_get_upload_ids(g_context.upnp, task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
break;
case DLS_TASK_CANCEL_UPLOAD:
dls_upnp_cancel_upload(g_context.upnp, task);
- dleyna_task_queue_task_completed(task->atom.queue_id);
+ break;
+ case DLS_TASK_WHITE_LIST_ENABLE:
+ dls_manager_wl_enable(task);
+ dls_task_complete(task);
+ break;
+ case DLS_TASK_WHITE_LIST_ADD_ENTRIES:
+ dls_manager_wl_add_entries(task);
+ dls_task_complete(task);
+ break;
+ case DLS_TASK_WHITE_LIST_REMOVE_ENTRIES:
+ dls_manager_wl_remove_entries(task);
+ dls_task_complete(task);
+ break;
+ case DLS_TASK_WHITE_LIST_CLEAR:
+ dls_manager_wl_clear(task);
+ dls_task_complete(task);
break;
default:
+ goto finished;
break;
}
+
+ dleyna_task_queue_task_completed(task->atom.queue_id);
+
+finished:
+ return;
}
static void prv_async_task_complete(dls_task_t *task, GError *error)
{
DLEYNA_LOG_DEBUG("Enter");
- if (error) {
+ if (!error) {
+ dls_task_complete(task);
+ } else {
dls_task_fail(task, error);
g_error_free(error);
- } else {
- dls_task_complete(task);
}
dleyna_task_queue_task_completed(task->atom.queue_id);
client = g_hash_table_lookup(g_context.watchers, client_name);
switch (task->type) {
+ case DLS_TASK_MANAGER_GET_PROP:
+ dls_manager_get_prop(g_context.manager, task,
+ prv_async_task_complete);
+ break;
+ case DLS_TASK_MANAGER_GET_ALL_PROPS:
+ dls_manager_get_all_props(g_context.manager, task,
+ prv_async_task_complete);
+ break;
case DLS_TASK_GET_CHILDREN:
dls_upnp_get_children(g_context.upnp, client, task,
prv_async_task_complete);
dls_task_delete((dls_task_t *)task);
}
-static void prv_method_call(dleyna_connector_id_t conn,
- const gchar *sender,
- const gchar *object,
- const gchar *interface,
- const gchar *method,
- GVariant *parameters,
- dleyna_connector_msg_id_t invocation);
+static void prv_manager_root_method_call(dleyna_connector_id_t conn,
+ const gchar *sender,
+ const gchar *object,
+ const gchar *interface,
+ const gchar *method,
+ GVariant *parameters,
+ dleyna_connector_msg_id_t invocation);
+
+static void prv_manager_props_method_call(dleyna_connector_id_t conn,
+ const gchar *sender,
+ const gchar *object,
+ const gchar *interface,
+ const gchar *method,
+ GVariant *parameters,
+ dleyna_connector_msg_id_t invocation);
static void prv_object_method_call(dleyna_connector_id_t conn,
const gchar *sender,
GVariant *parameters,
dleyna_connector_msg_id_t invocation);
-static const dleyna_connector_dispatch_cb_t g_root_vtables[1] = {
- prv_method_call
+static const dleyna_connector_dispatch_cb_t
+ g_root_vtables[DLS_MANAGER_INTERFACE_INFO_MAX] = {
+ /* MUST be in the exact same order as g_root_introspection */
+ prv_manager_root_method_call,
+ prv_manager_props_method_call
};
static const dleyna_connector_dispatch_cb_t
g_server_vtables[DLS_INTERFACE_INFO_MAX] = {
- /* MUST be in the exact same order as g_dls_server_introspection */
+ /* MUST be in the exact same order as g_server_introspection */
prv_props_method_call,
prv_object_method_call,
prv_con_method_call,
dleyna_task_queue_add_task(queue_id, &task->atom);
}
-static void prv_method_call(dleyna_connector_id_t conn,
+static void prv_manager_root_method_call(
+ dleyna_connector_id_t conn,
const gchar *sender, const gchar *object,
const gchar *interface,
const gchar *method, GVariant *parameters,
if (!strcmp(method, DLS_INTERFACE_RELEASE)) {
prv_remove_client(sender);
g_context.connector->return_response(invocation, NULL);
+ goto finished;
} else if (!strcmp(method, DLS_INTERFACE_RESCAN)) {
task = dls_task_rescan_new(invocation);
- prv_add_task(task, sender, DLS_SERVER_SINK);
} else if (!strcmp(method, DLS_INTERFACE_GET_VERSION)) {
task = dls_task_get_version_new(invocation);
- prv_add_task(task, sender, DLS_SERVER_SINK);
} else if (!strcmp(method, DLS_INTERFACE_GET_SERVERS)) {
task = dls_task_get_servers_new(invocation);
- prv_add_task(task, sender, DLS_SERVER_SINK);
} else if (!strcmp(method, DLS_INTERFACE_SET_PROTOCOL_INFO)) {
task = dls_task_set_protocol_info_new(invocation,
parameters);
- prv_add_task(task, sender, DLS_SERVER_SINK);
} else if (!strcmp(method, DLS_INTERFACE_PREFER_LOCAL_ADDRESSES)) {
task = dls_task_prefer_local_addresses_new(invocation,
parameters);
- prv_add_task(task, sender, DLS_SERVER_SINK);
+ } else if (!strcmp(method, DLS_INTERFACE_WHITE_LIST_ENABLE)) {
+ task = dls_task_wl_enable_new(invocation, parameters);
+ } else if (!strcmp(method, DLS_INTERFACE_WHITE_LIST_ADD_ENTRIES)) {
+ task = dls_task_wl_add_entries_new(invocation, parameters);
+ } else if (!strcmp(method, DLS_INTERFACE_WHITE_LIST_REMOVE_ENTRIES)) {
+ task = dls_task_wl_remove_entries_new(invocation, parameters);
+ } else if (!strcmp(method, DLS_INTERFACE_WHITE_LIST_CLEAR)) {
+ task = dls_task_wl_clear_new(invocation);
+ } else {
+ goto finished;
}
+
+ prv_add_task(task, sender, DLS_SERVER_SINK);
+
+finished:
+
+ return;
+}
+
+static void prv_manager_props_method_call(dleyna_connector_id_t conn,
+ const gchar *sender,
+ const gchar *object,
+ const gchar *interface,
+ const gchar *method,
+ GVariant *parameters,
+ dleyna_connector_msg_id_t invocation)
+{
+ dls_task_t *task;
+ GError *error = NULL;
+
+ if (!strcmp(method, DLS_INTERFACE_GET_ALL))
+ task = dls_task_manager_get_props_new(invocation, object,
+ parameters, &error);
+ else if (!strcmp(method, DLS_INTERFACE_GET))
+ task = dls_task_manager_get_prop_new(invocation, object,
+ parameters, &error);
+ else
+ goto finished;
+
+ if (!task) {
+ g_context.connector->return_error(invocation, error);
+ g_error_free(error);
+
+ goto finished;
+ }
+
+ prv_add_task(task, sender, task->target.path);
+
+finished:
+
+ return;
}
gboolean dls_server_get_object_info(const gchar *object_path,
dleyna_connector_id_t connection)
{
gboolean retval = TRUE;
+ uint i;
g_context.connection = connection;
- g_context.dls_id = g_context.connector->publish_object(
- connection,
- DLEYNA_SERVER_OBJECT,
- TRUE,
- 0,
- g_root_vtables);
+ for (i = 0; i < DLS_MANAGER_INTERFACE_INFO_MAX; i++)
+ g_context.dls_id[i] = g_context.connector->publish_object(
+ connection,
+ DLEYNA_SERVER_OBJECT,
+ TRUE,
+ g_manager_interfaces[i],
+ g_root_vtables + i);
- if (!g_context.dls_id) {
- retval = FALSE;
- goto out;
- } else {
+ if (g_context.dls_id[DLS_MANAGER_INTERFACE_MANAGER]) {
g_context.upnp = dls_upnp_new(connection,
g_server_vtables,
prv_found_media_server,
prv_lost_media_server,
NULL);
+
+ g_context.manager = dls_manager_new(connection,
+ dls_upnp_get_context_manager(g_context.upnp));
+ } else {
+ retval = FALSE;
}
-out:
+ dleyna_settings_init_white_list(g_context.settings);
return retval;
}
static void prv_control_point_stop_service(void)
{
+ uint i;
+
+ if (g_context.manager)
+ dls_manager_delete(g_context.manager);
+
if (g_context.upnp) {
dls_upnp_unsubscribe(g_context.upnp);
dls_upnp_delete(g_context.upnp);
}
if (g_context.connection) {
- if (g_context.dls_id)
- g_context.connector->unpublish_object(
+ for (i = 0; i < DLS_MANAGER_INTERFACE_INFO_MAX; i++)
+ if (g_context.dls_id[i])
+ g_context.connector->unpublish_object(
g_context.connection,
- g_context.dls_id);
+ g_context.dls_id[i]);
}
}
*/
#include <libdleyna/core/error.h>
+#include <libdleyna/core/log.h>
#include "async.h"
-
-dls_task_t *dls_task_rescan_new(dleyna_connector_msg_id_t invocation)
-{
- dls_task_t *task = g_new0(dls_task_t, 1);
-
- task->type = DLS_TASK_RESCAN;
- task->invocation = invocation;
- task->synchronous = TRUE;
-
- return task;
-}
-
-dls_task_t *dls_task_get_version_new(dleyna_connector_msg_id_t invocation)
-{
- dls_task_t *task = g_new0(dls_task_t, 1);
-
- task->type = DLS_TASK_GET_VERSION;
- task->invocation = invocation;
- task->result_format = "(@s)";
- task->result = g_variant_ref_sink(g_variant_new_string(VERSION));
- task->synchronous = TRUE;
-
- return task;
-}
-
-dls_task_t *dls_task_get_servers_new(dleyna_connector_msg_id_t invocation)
-{
- dls_task_t *task = g_new0(dls_task_t, 1);
-
- task->type = DLS_TASK_GET_SERVERS;
- task->invocation = invocation;
- task->result_format = "(@ao)";
- task->synchronous = TRUE;
-
- return task;
-}
+#include "path.h"
static void prv_delete(dls_task_t *task)
{
g_variant_unref(task->ut.get_children.filter);
g_free(task->ut.get_children.sort_by);
break;
+ case DLS_TASK_MANAGER_GET_ALL_PROPS:
case DLS_TASK_GET_ALL_PROPS:
g_free(task->ut.get_props.interface_name);
break;
+ case DLS_TASK_MANAGER_GET_PROP:
case DLS_TASK_GET_PROP:
g_free(task->ut.get_prop.interface_name);
g_free(task->ut.get_prop.prop_name);
g_free(task->ut.get_icon.resolution);
g_free(task->ut.get_icon.mime_type);
break;
+ case DLS_TASK_WHITE_LIST_ADD_ENTRIES:
+ case DLS_TASK_WHITE_LIST_REMOVE_ENTRIES:
+ if (task->ut.white_list.entries)
+ g_variant_unref(task->ut.white_list.entries);
+ break;
default:
break;
}
g_free(task);
}
+dls_task_t *dls_task_rescan_new(dleyna_connector_msg_id_t invocation)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_RESCAN;
+ task->invocation = invocation;
+ task->synchronous = TRUE;
+
+ return task;
+}
+
+dls_task_t *dls_task_get_version_new(dleyna_connector_msg_id_t invocation)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_GET_VERSION;
+ task->invocation = invocation;
+ task->result_format = "(@s)";
+ task->synchronous = TRUE;
+
+ return task;
+}
+
+dls_task_t *dls_task_get_servers_new(dleyna_connector_msg_id_t invocation)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_GET_SERVERS;
+ task->invocation = invocation;
+ task->result_format = "(@ao)";
+ task->synchronous = TRUE;
+
+ return task;
+}
+
+dls_task_t *dls_task_wl_enable_new(dleyna_connector_msg_id_t invocation,
+ GVariant *parameters)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_WHITE_LIST_ENABLE;
+ task->invocation = invocation;
+ task->synchronous = TRUE;
+ g_variant_get(parameters, "(b)",
+ &task->ut.white_list.enabled);
+
+ return task;
+}
+
+dls_task_t *dls_task_wl_clear_new(dleyna_connector_msg_id_t invocation)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_WHITE_LIST_CLEAR;
+ task->invocation = invocation;
+ task->synchronous = TRUE;
+
+ return task;
+}
+
+dls_task_t *dls_task_wl_add_entries_new(dleyna_connector_msg_id_t invocation,
+ GVariant *parameters)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_WHITE_LIST_ADD_ENTRIES;
+ task->invocation = invocation;
+ task->synchronous = TRUE;
+ g_variant_get(parameters, "(@as)", &task->ut.white_list.entries);
+
+ return task;
+}
+
+dls_task_t *dls_task_wl_remove_entries_new(dleyna_connector_msg_id_t invocation,
+ GVariant *parameters)
+{
+ dls_task_t *task = g_new0(dls_task_t, 1);
+
+ task->type = DLS_TASK_WHITE_LIST_REMOVE_ENTRIES;
+ task->invocation = invocation;
+ task->synchronous = TRUE;
+ g_variant_get(parameters, "(@as)", &task->ut.white_list.entries);
+
+ return task;
+}
+
+dls_task_t *dls_task_manager_get_prop_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path,
+ GVariant *parameters,
+ GError **error)
+{
+ dls_task_t *task = (dls_task_t *)g_new0(dls_async_task_t, 1);
+
+ 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->target.path = g_strstrip(g_strdup(path));
+
+ task->type = DLS_TASK_MANAGER_GET_PROP;
+ task->invocation = invocation;
+ task->result_format = "(v)";
+
+ return task;
+}
+
+dls_task_t *dls_task_manager_get_props_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path,
+ GVariant *parameters,
+ GError **error)
+{
+ dls_task_t *task = (dls_task_t *)g_new0(dls_async_task_t, 1);
+
+ g_variant_get(parameters, "(s)", &task->ut.get_props.interface_name);
+ g_strstrip(task->ut.get_props.interface_name);
+
+ task->target.path = g_strstrip(g_strdup(path));
+
+ task->type = DLS_TASK_MANAGER_GET_ALL_PROPS;
+ task->invocation = invocation;
+ task->result_format = "(@a{sv})";
+
+ return task;
+}
+
static gboolean prv_set_task_target_info(dls_task_t *task, const gchar *path,
GError **error)
{
DLS_TASK_UPDATE_OBJECT,
DLS_TASK_GET_OBJECT_METADATA,
DLS_TASK_CREATE_REFERENCE,
- DLS_TASK_GET_ICON
+ DLS_TASK_GET_ICON,
+ DLS_TASK_WHITE_LIST_ENABLE,
+ DLS_TASK_WHITE_LIST_ADD_ENTRIES,
+ DLS_TASK_WHITE_LIST_REMOVE_ENTRIES,
+ DLS_TASK_WHITE_LIST_CLEAR,
+ DLS_TASK_MANAGER_GET_ALL_PROPS,
+ DLS_TASK_MANAGER_GET_PROP
};
typedef enum dls_task_type_t_ dls_task_type_t;
gchar *resolution;
};
+typedef struct dls_task_white_list_t_ dls_task_white_list_t;
+struct dls_task_white_list_t_ {
+ gboolean enabled;
+ GVariant *entries;
+};
+
typedef struct dls_task_t_ dls_task_t;
struct dls_task_t_ {
dleyna_task_atom_t atom; /* pseudo inheritance - MUST be first field */
dls_task_update_t update;
dls_task_create_reference_t create_reference;
dls_task_get_icon_t get_icon;
+ dls_task_white_list_t white_list;
} ut;
};
const gchar *path, GVariant *parameters,
GError **error);
+
+dls_task_t *dls_task_wl_enable_new(dleyna_connector_msg_id_t invocation,
+ GVariant *parameters);
+
+dls_task_t *dls_task_wl_clear_new(dleyna_connector_msg_id_t invocation);
+
+dls_task_t *dls_task_wl_add_entries_new(dleyna_connector_msg_id_t invocation,
+ GVariant *parameters);
+
+dls_task_t *dls_task_wl_remove_entries_new(dleyna_connector_msg_id_t invocation,
+ GVariant *parameters);
+
+dls_task_t *dls_task_manager_get_prop_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path,
+ GVariant *parameters,
+ GError **error);
+
+dls_task_t *dls_task_manager_get_props_new(dleyna_connector_msg_id_t invocation,
+ const gchar *path,
+ GVariant *parameters,
+ GError **error);
+
void dls_task_cancel(dls_task_t *task);
void dls_task_complete(dls_task_t *task);
prv_device_new_ct_t *priv_t;
udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
- if (!udn)
- goto on_error;
ip_address = gupnp_context_get_host_ip(
gupnp_control_point_get_context(cp));
+ if (!udn || !ip_address)
+ goto on_error;
+
DLEYNA_LOG_DEBUG("UDN %s", udn);
DLEYNA_LOG_DEBUG("IP Address %s", ip_address);
DLEYNA_LOG_DEBUG("Enter");
udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
- if (!udn)
- goto on_error;
ip_address = gupnp_context_get_host_ip(
gupnp_control_point_get_context(cp));
+ if (!udn || !ip_address)
+ goto on_error;
+
DLEYNA_LOG_DEBUG("UDN %s", udn);
DLEYNA_LOG_DEBUG("IP Address %s", ip_address);
dls_device_delete);
upnp->server_uc_map = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_free, NULL);
+ g_free, NULL);
dls_prop_maps_new(&upnp->property_map, &upnp->filter_map);
gupnp_context_manager_rescan_control_points(upnp->context_manager);
}
+
+GUPnPContextManager *dls_upnp_get_context_manager(dls_upnp_t *upnp)
+{
+ return upnp->context_manager;
+}
void dls_upnp_rescan(dls_upnp_t *upnp);
+GUPnPContextManager *dls_upnp_get_context_manager(dls_upnp_t *upnp);
+
#endif /* DLS_UPNP_H__ */
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
esac
;;
-gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
fi
;;
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
;;
esac
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# KAI C++ Compiler
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- gnu*)
- ;;
-
haiku*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
+* Thu Aug 22 2013 Regis Merlino <regis.merlino@intel.com>
+- Update dleyna to 0.2.1 (5af1b9e)
+
* Mon Jul 15 23:56:26 UTC 2013 - tracy.graydon@intel.com
- Stripped out the old yaml cruft from spec file
Name: dleyna
Summary: dLeyna hosts a number of DLNA middleware components
-Version: 0.2.0
+Version: 0.2.1
Release: 0
Group: System/Libraries
License: LGPLv2+
%{_libexecdir}/dleyna-server-service
%{_libexecdir}/dleyna-renderer-service
%{_libdir}/libdleyna-core-1.0.so.*
-%{_libdir}/libdleyna-server-1.0.so.*
-%{_libdir}/libdleyna-renderer-1.0.so.*
+%{_libdir}/dleyna-server/libdleyna-server-1.0.so.*
+%{_libdir}/dleyna-renderer/libdleyna-renderer-1.0.so.*
%{_libdir}/dleyna-1.0/connectors/libdleyna-connector-dbus.so
%{_sysconfdir}/dleyna-server-service.conf
%{_sysconfdir}/dleyna-renderer-service.conf
%defattr(-,root,root,-)
%{_includedir}/dleyna-1.0/libdleyna
%{_libdir}/libdleyna-core-1.0.so
-%{_libdir}/libdleyna-server-1.0.so
-%{_libdir}/libdleyna-renderer-1.0.so
+%{_libdir}/dleyna-server/libdleyna-server-1.0.so
+%{_libdir}/dleyna-renderer/libdleyna-renderer-1.0.so
%{_libdir}/pkgconfig/dleyna-connector-dbus-1.0.pc
%{_libdir}/pkgconfig/dleyna-core-1.0.pc
%{_libdir}/pkgconfig/dleyna-server-1.0.pc