Commit 9e05256f authored by Regis Merlino's avatar Regis Merlino Committed by Mark Ryan

[Init] Add initial source code

Signed-off-by: default avatarRegis Merlino <regis.merlino@intel.com>
parent cba359ce
*.o
*.lo
*~
*.la
*.pc
*.tgz
*.gz
.dirstamp
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
.deps/
.libs/
stamp-h1
INSTALL
lib/dleyna-renderer.conf
lib/dleyna-renderer-1.0.pc
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
server/com.intel.dleyna-renderer.service
server/dleyna-renderer-service
This diff is collapsed.
version 0.0.1
- Initial version of dleyna-renderer
SUBDIRS = lib
if BUILD_SERVER
SUBDIRS += server
endif
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 \
configure \
config.h.in \
config.h.in~ \
build-aux/depcomp \
build-aux/compile \
build-aux/missing \
build-aux/install-sh
maintainer-clean-local:
rm -rf build-aux
Introduction:
-------------
TODO
Compilation
------------
TODO
Working with the source code repository
---------------------------------------
dleyna-server can be downloaded, compiled and installed as
follows:
Clone repository
# git clone git://github.com/01org/dleyna-server.git
# cd dleyna-server
Configure and build
# ./autoreconf -i
# ./configure
# make
Final installation
# sudo make install
These instructions are suitable for users who simply want to install
and run dleyna-renderer. However, developers wishing to contribute
to the project should follow a separate "Configure and build" step.
Configure and build
# ./bootstrap-configure
# make
The script "bootstrap-configure" cleans the repository, calls
autreconf and then invokes configure with proper settings for
development. These settings include the enabling of
maintainer mode and debugging.
Developers can remove autogenerated files with the following command
# make maintainer-clean
Configure Options:
------------------
--enable-werror
This option is disabled by default. To enable use --enable-werror.
When enabled, all warnings are treated as errors during compilation.
Should be enabled during development to ensure that errors do not
creep into the code base. This option is enabled by
bootstrap-configure.
--enable-debug
This option is disabled by default. To enable use
--enable-debug. When enabled, the make files produce debug builds.
This option is enabled by bootstrap-configure.
--enable-optimization
This option is enabled by default. To disable use
--disable-optimization. When enabled it turns on compiler
optimizations. Disable = -O0, enable = -O2.
--enable-never-quit
This option is disabled by default. To enable use --enable-never-quit.
When enabled, media-service-upnp doesn't quit when the last client disconnects.
--with-log-type
See logging.txt for more information about logging.
--with-log-level
See logging.txt for more information about logging.
--with_connector-name
Set the IPC mechanism to be used.
--enable-lib-only
This option is disabled by default. To enable use --enable-lib-only.
When enabled, only the libdleyna-renderer library is built.
#!/bin/sh
if [ -f config.status ]; then
make maintainer-clean
fi
autoreconf -if && \
./configure --enable-maintainer-mode \
--enable-silent-rules \
--disable-optimization \
--enable-debug \
--with-log-level=8 $*
AC_PREREQ([2.66])
AC_INIT([dleyna-renderer],
[0.0.1],
[https://github.com/01org/dleyna-renderer/issues/new],
,
[https://01.org/dleyna/])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([lib/server.c])
AC_PREFIX_DEFAULT(/usr/local)
AM_INIT_AUTOMAKE([subdir-objects])
AM_MAINTAINER_MODE
AM_SILENT_RULES([yes])
DLEYNA_SERVER_COMPILER_FLAGS
# Checks for languages.
AC_LANG_C
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_MKDIR_P
# Initialize libtool
# Disable generation of static libraries
LT_PREREQ([2.2.6])
LT_INIT([dlopen disable-static])
LT_LANG([C])
# Checks for libraries.
PKG_PROG_PKG_CONFIG(0.16)
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.28])
PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.0.1])
PKG_CHECK_MODULES([GSSDP], [gssdp-1.0 >= 0.13.2])
PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.19.1])
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])
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h syslog.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT8_T
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset strchr strrchr strstr])
# Define Log Level values
LOG_LEVEL_0=0x00
LOG_LEVEL_1=0x01
LOG_LEVEL_2=0x02
LOG_LEVEL_3=0x04
LOG_LEVEL_4=0x08
LOG_LEVEL_5=0x10
LOG_LEVEL_6=0x20
LOG_LEVEL_7=0x13
LOG_LEVEL_8=0x3F
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_DISABLED], [${LOG_LEVEL_0}], [Log level flag for disabled messages])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_ERROR], [${LOG_LEVEL_1}], [Log level flag for errors])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_CRITICAL], [${LOG_LEVEL_2}], [Log level flag for critical messages])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_WARNING], [${LOG_LEVEL_3}], [Log level flag for warnings])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_MESSAGE], [${LOG_LEVEL_4}], [Log level flag for messages])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_INFO], [${LOG_LEVEL_5}], [Log level flag for informational messages])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_DEBUG], [${LOG_LEVEL_6}], [Log level flag for debug messages])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_DEFAULT], [${LOG_LEVEL_7}], [Log level flag to display default level messages])
AC_DEFINE_UNQUOTED([DLEYNA_LOG_LEVEL_ALL], [${LOG_LEVEL_8}], [Log level flag for all messages])
AC_ARG_ENABLE(debug,
AS_HELP_STRING(
[--enable-debug],
[enable compiling with debugging information]),
[],
[enable_debug=no])
AS_CASE("${enable_debug}",
[yes], [CFLAGS="$CFLAGS -g";
AC_DEFINE_UNQUOTED([DLEYNA_DEBUG_ENABLED],[1], [Compiling with debugging information enabled])
],
[no], [],
[AC_MSG_ERROR([bad value ${enable_debug} for --enable-debug])])
AC_ARG_ENABLE(werror,
AS_HELP_STRING(
[--enable-werror],
[warnings are treated as errors]),
[],
[enable_werror=no])
AS_CASE("${enable_werror}",
[yes], [CFLAGS="$CFLAGS -Werror"],
[no], [],
[AC_MSG_ERROR([bad value ${enable_werror} for --enable-werror])])
AC_ARG_ENABLE(optimization,
AS_HELP_STRING(
[--disable-optimization],
[disable code optimization through compiler]),
[],
[enable_optimization=yes])
AS_CASE("${enable_optimization}",
[yes], [disable_optimization=no],
[no], [CFLAGS="$CFLAGS -O0"; disable_optimization=yes],
[AC_MSG_ERROR([bad value ${enable_optimization} for --enable-werror])])
AC_ARG_ENABLE(never-quit,
AS_HELP_STRING(
[--enable-never-quit],
[Service doesn't quit when last client disconnects]),
[],
[enable_never_quit=no])
AS_CASE("${enable_never_quit}",
[yes], [never_quit=true],
[no], [never_quit=false],
[AC_MSG_ERROR([bad value ${enable_never_quit} for --enable-never-quit])])
AC_ARG_WITH(connector-name,
AS_HELP_STRING(
[--with-connector-name],
[IPC connector name]),
[],
[with_connector_name=dbus])
AC_ARG_WITH(log-level,
AS_HELP_STRING(
[--with-log-level],
[enable logging information (0,1..6,7,8)\
0=disabled \
7=default (=1,2,5) \
8=all (=1,2,3,4,5,6) \
1,..,6=a comma separated list of log level\
]),
[],
[with_log_level=7])
DLEYNA_LOG_LEVEL_CHECK([${with_log_level}])
AC_ARG_WITH(log-type,
AS_HELP_STRING(
[--with-log-type],
[Select log output technology \
0=syslog 1=GLib \
]),
[],
[with_log_type=0])
DLEYNA_LOG_TYPE_CHECK([${with_log_type}])
AC_ARG_ENABLE(lib-only,
AS_HELP_STRING(
[--enable-lib-only],
[compile only the libdleyna-renderer library]),
[],
[enable_lib_only=no])
AS_IF([test "x$[]enable_lib_only" = "xno"],
[PKG_CHECK_MODULES([DBUS], [dbus-1],
[DBUS_SESSION_DIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`;
AC_SUBST(DBUS_SESSION_DIR)
],
[enable_lib_only=yes])
])
AM_CONDITIONAL([BUILD_SERVER], [test "x$[]enable_lib_only" = "xno"])
AC_DEFINE([DLEYNA_SERVER_OBJECT], "/com/intel/dLeynaRenderer", [Name of object exposed by dleyna-renderer])
AC_DEFINE([DLEYNA_SERVER_PATH], "/com/intel/dLeynaRenderer/server", [Path of server objects])
DLEYNA_SERVER_NAME=com.intel.dleyna-renderer
AC_SUBST(DLEYNA_SERVER_NAME)
AC_DEFINE([DLEYNA_SERVER_NAME], "com.intel.dleyna-renderer",
[d-Bus Name of dleyna-renderer])
DLEYNA_SERVER_INTERFACE_MANAGER=com.intel.dLeynaRenderer.Manager
AC_SUBST(DLEYNA_SERVER_INTERFACE_MANAGER)
AC_DEFINE([DLEYNA_SERVER_INTERFACE_MANAGER], "com.intel.dLeynaRenderer.Manager",
[d-Bus Name of dleyna-renderer main interface])
DLEYNA_SERVER_INTERFACE_RENDERER_DEVICE=com.intel.dLeynaRenderer.RendererDevice
AC_SUBST(DLEYNA_SERVER_INTERFACE_RENDERER_DEVICE)
AC_DEFINE([DLEYNA_SERVER_INTERFACE_RENDERER_DEVICE], "com.intel.dLeynaRenderer.RendererDevice",
[d-Bus Name of dleyna-renderer device interface])
DLEYNA_INTERFACE_PUSH_HOST=com.intel.dLeynaRenderer.PushHost
AC_SUBST(DLEYNA_INTERFACE_PUSH_HOST)
AC_DEFINE([DLEYNA_INTERFACE_PUSH_HOST], "com.intel.dLeynaRenderer.PushHost",
[d-Bus Name of dleyna-renderer push host interface])
AC_SUBST([never_quit])
AC_SUBST([with_connector_name])
AC_SUBST([with_log_level])
AC_SUBST([with_log_type])
AC_CONFIG_FILES([Makefile \
lib/Makefile \
lib/dleyna-renderer-1.0.pc \
lib/dleyna-renderer.conf \
server/com.intel.dleyna-renderer.service \
server/dleyna-renderer-service-1.0.pc \
server/Makefile
])
AC_OUTPUT
AS_ECHO(["-------------------------------------------------
${PACKAGE_NAME} Version ${PACKAGE_VERSION}
Prefix : '${prefix}'
Compiler : '${CC}'
CFLAGS : '${CFLAGS}'
-Package features:
- enable-werror : ${enable_werror}
- enable-debug : ${enable_debug}
- enable-never-quit : ${enable_never_quit}
- with_connector-name : ${with_connector_name}
- disable-optimization: ${disable_optimization}
- with-log-level : ${with_log_level}
- with-log-type : ${with_log_type}
- enable-lib-only : ${enable_lib_only}
--------------------------------------------------"])
libdleyna_rendererincdir = $(includedir)/dleyna-1.0/libdleyna/renderer
DLEYNA_RENDERER_VERSION = 1:0:0
AM_CFLAGS = $(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DLEYNA_CORE_CFLAGS) \
$(GSSDP_CFLAGS) \
$(GUPNP_CFLAGS) \
$(GUPNPAV_CFLAGS) \
$(GUPNPDLNA_CFLAGS) \
$(SOUP_CFLAGS) \
-include config.h
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
lib_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
libdleyna_renderer_1_0_la_SOURCES = $(libdleyna_rendererinc_HEADERS) \
async.c \
device.c \
host-service.c \
server.c \
task.c \
upnp.c
libdleyna_renderer_1_0_la_LIBADD = $(GLIB_LIBS) \
$(GIO_LIBS) \
$(DLEYNA_CORE_LIBS) \
$(GSSDP_LIBS) \
$(GUPNP_LIBS) \
$(GUPNPAV_LIBS) \
$(GUPNPDLNA_LIBS) \
$(SOUP_LIBS)
MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 \
configure \
config.h.in \
config.h.in~ \
build-aux/depcomp \
build-aux/compile \
build-aux/missing \
build-aux/install-sh
sysconf_DATA = dleyna-renderer.conf
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dleyna-renderer-1.0.pc
EXTRA_DIST = $(sysconf_DATA)
CLEANFILES = $(pkgconfig_DATA) dleyna-renderer.conf
DISTCLEANFILES = $(pkgconfig_DATA) dleyna-renderer.conf
maintainer-clean-local:
rm -rf build-aux
/*
* dleyna
*
* Copyright (C) 2012-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.
*
* Mark Ryan <mark.d.ryan@intel.com>
*
*/
#include <libdleyna/core/error.h>
#include <libdleyna/core/log.h>
#include "async.h"
void rsu_async_task_delete(rsu_async_task_t *task)
{
if (task->free_private)
task->free_private(task->private);
if (task->cancellable)
g_object_unref(task->cancellable);
}
gboolean rsu_async_task_complete(gpointer user_data)
{
rsu_async_task_t *cb_data = user_data;
DLEYNA_LOG_DEBUG("Enter. Error %p", (void *)cb_data->error);
DLEYNA_LOG_DEBUG_NL();
cb_data->device->current_task = NULL;
if (cb_data->proxy != NULL)
g_object_remove_weak_pointer((G_OBJECT(cb_data->proxy)),
(gpointer *)&cb_data->proxy);
cb_data->cb(&cb_data->task, cb_data->error);
return FALSE;
}
void rsu_async_task_cancelled(GCancellable *cancellable, gpointer user_data)
{
rsu_async_task_t *cb_data = user_data;
cb_data->device->current_task = NULL;
gupnp_service_proxy_cancel_action(cb_data->proxy, cb_data->action);
if (!cb_data->error)
cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
DLEYNA_ERROR_CANCELLED,
"Operation cancelled.");
(void) g_idle_add(rsu_async_task_complete, cb_data);
}
void rsu_async_task_lost_object(gpointer user_data)
{
rsu_async_task_t *cb_data = user_data;
if (!cb_data->error)
cb_data->error = g_error_new(DLEYNA_SERVER_ERROR,
DLEYNA_ERROR_LOST_OBJECT,
"Renderer died before command "
"could be completed.");
(void) g_idle_add(rsu_async_task_complete, cb_data);
}
void rsu_async_task_cancel(rsu_async_task_t *task)
{
if (task->cancellable)
g_cancellable_cancel(task->cancellable);
}
/*
* dleyna
*
* Copyright (C) 2012-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.
*
* Mark Ryan <mark.d.ryan@intel.com>
*
*/
#ifndef RSU_ASYNC_H__
#define RSU_ASYNC_H__
#include <libgupnp/gupnp-control-point.h>
#include "device.h"
#include "task.h"
#include "upnp.h"
typedef struct rsu_async_task_t_ rsu_async_task_t;
struct rsu_async_task_t_ {
rsu_task_t task; /* pseudo inheritance - MUST be first field */
rsu_upnp_task_complete_t cb;
GError *error;
GUPnPServiceProxyAction *action;
GUPnPServiceProxy *proxy;
GCancellable *cancellable;
gulong cancel_id;
gpointer private;
GDestroyNotify free_private;
rsu_device_t *device;
};
gboolean rsu_async_task_complete(gpointer user_data);
void rsu_async_task_cancelled(GCancellable *cancellable, gpointer user_data);
void rsu_async_task_delete(rsu_async_task_t *task);
void rsu_async_task_lost_object(gpointer user_data);
void rsu_async_task_cancel(rsu_async_task_t *task);
#endif
/*
* 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.
*
* Regis Merlino <regis.merlino@intel.com>
*
*/
#ifndef CONTROL_POINT_RENDERER_H__
#define CONTROL_POINT_RENDERER_H__
#include <libdleyna/core/control-point.h>
const dleyna_control_point_t *dleyna_control_point_get_renderer(void);
#endif /* CONTROL_POINT_RENDERER_H__ */
This diff is collapsed.
/*
* dleyna
*
* Copyright (C) 2012-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.
*
* Mark Ryan <mark.d.ryan@intel.com>
*
*/
#ifndef RSU_DEVICE_H__
#define RSU_DEVICE_H__
#include <gio/gio.h>
#include <glib.h>
#include <libgupnp/gupnp-service-proxy.h>
#include <libgupnp/gupnp-device-proxy.h>
#include <libdleyna/core/connector.h>
#include "host-service.h"
#include "upnp.h"
typedef struct rsu_device_t_ rsu_device_t;
typedef struct rsu_service_proxies_t_ rsu_service_proxies_t;
struct rsu_service_proxies_t_ {
GUPnPServiceProxy *cm_proxy;
GUPnPServiceProxy *av_proxy;
GUPnPServiceProxy *rc_proxy;
};
typedef struct rsu_device_context_t_ rsu_device_context_t;
struct rsu_device_context_t_ {
gchar *ip_address;
GUPnPDeviceProxy *device_proxy;
rsu_service_proxies_t service_proxies;
rsu_device_t *device;
gboolean subscribed_av;
gboolean subscribed_cm;
gboolean subscribed_rc;
guint timeout_id_av;
guint timeout_id_cm;
guint timeout_id_rc;
};
typedef struct rsu_props_t_ rsu_props_t;
struct rsu_props_t_ {
GHashTable *root_props;
GHashTable *player_props;
GHashTable *device_props;
gboolean synced;
};