Commit c90a8680 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove recursion into modules/control/dbus/ and clean up D-Bus rules

modules/control/dbus/dbus.h is removed as it conflicted with the global
libdbus header and was included only once.
parent c6935785
......@@ -11,7 +11,9 @@ SUFFIXES = .rc.in .rc
AM_CPPFLAGS = $(CPPFLAGS_vlc)
AM_CFLAGS = $(CFLAGS_vlc)
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
endif
if !HAVE_WIN32
bin_PROGRAMS += vlc-wrapper
......
......@@ -619,7 +619,7 @@ AC_CHECK_FUNC(getopt_long,, [
AC_SUBST(GNUGETOPT_LIBS)
AC_CHECK_LIB(m,cos,[
VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mpc dmo mp4 quicktime qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex opus mono colorthres extract ball access_imem hotkeys mosaic gaussianblur dbus x26410b hqdn3d anaglyph oldrc ncurses],[-lm])
VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mpc dmo mp4 quicktime qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex opus mono colorthres extract ball access_imem hotkeys mosaic gaussianblur x26410b hqdn3d anaglyph oldrc ncurses],[-lm])
LIBM="-lm"
], [
LIBM=""
......@@ -771,35 +771,19 @@ dnl Check for dbus
AC_ARG_ENABLE(dbus,
[AS_HELP_STRING([--enable-dbus],
[compile D-Bus message bus support (default enabled)])])
case "${SYS}" in
linux*|*bsd*)
if test "${enable_dbus}" != "no" -a "${SYS}" != "mingw32"
then
dnl api stable dbus
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0],
[ AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] )
VLC_ADD_LIBS([libvlccore],[$DBUS_LIBS])
VLC_ADD_CFLAGS([libvlccore],[$DBUS_CFLAGS])
dnl Check for dbus control interface
AC_ARG_ENABLE(dbus-control,
[AS_HELP_STRING([--disable-dbus-control],
[D-Bus control interface (default enabled)])])
if test "${enable_dbus_control}" != "no"
then
VLC_ADD_PLUGIN([dbus])
VLC_ADD_LIBS([dbus],[$DBUS_LIBS])
VLC_ADD_CFLAGS([dbus],[$DBUS_CFLAGS])
fi
dnl Power Management Inhibiter
VLC_ADD_PLUGIN([inhibit])
VLC_ADD_LIBS([inhibit],[$DBUS_LIBS])
VLC_ADD_CFLAGS([inhibit],[$DBUS_CFLAGS])
],
[AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])]
)
fi
;;
esac
have_dbus="no"
AS_IF([test "${enable_dbus}" != "no"], [
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0], [
have_dbus="yes"
], [
AS_IF([test -n "${enable_dbus}"], [
AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
], [
AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
])
])
])
AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
dnl Check for ntohl, etc.
VLC_SAVE_FLAGS
......@@ -4090,7 +4074,6 @@ AC_CONFIG_FILES([
modules/codec/spudec/Makefile
modules/codec/wmafixed/Makefile
modules/control/Makefile
modules/control/dbus/Makefile
modules/demux/Makefile
modules/demux/asf/Makefile
modules/demux/avformat/Makefile
......
SUBDIRS = dbus
SOURCES_dummy = dummy.c
SOURCES_gestures = gestures.c
SOURCES_netsync = netsync.c
......@@ -22,6 +21,19 @@ libvlc_LTLIBRARIES += \
libnetsync_plugin.la \
libhotkeys_plugin.la \
liboldrc_plugin.la
libdbus_plugin_la_SOURCES = \
dbus/dbus_introspect.h dbus/dbus_common.h \
dbus/dbus_root.c dbus/dbus_root.h \
dbus/dbus_player.c dbus/dbus/player.h \
dbus/dbus_tracklist.c dbus/dbus/tracklist.h \
dbus/dbus.c
libdbus_plugin_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libdbus_plugin_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS) $(LIBM)
if HAVE_DBUS
libvlc_LTLIBRARIES += libdbus_plugin.la
endif
if !HAVE_WIN32
libglobalhotkeys_plugin_la_SOURCES = globalhotkeys/xcb.c
libglobalhotkeys_plugin_la_CFLAGS = $(AM_CFLAGS) $(XCB_KEYSYMS_CFLAGS) $(XCB_CFLAGS)
......
SOURCES_dbus = \
dbus.c \
dbus.h \
dbus_introspect.h \
dbus_common.h \
dbus_root.h \
dbus_root.c \
dbus_player.h \
dbus_player.c \
dbus_tracklist.h \
dbus_tracklist.c \
$(NULL)
......@@ -45,7 +45,6 @@
#endif
#include <dbus/dbus.h>
#include "dbus.h"
#include "dbus_common.h"
#include "dbus_root.h"
#include "dbus_player.h"
......@@ -67,10 +66,23 @@
#include <errno.h>
#include <unistd.h>
#define DBUS_MPRIS_BUS_NAME "org.mpris.MediaPlayer2.vlc"
#define DBUS_INSTANCE_ID_PREFIX "instance"
#define SEEK_THRESHOLD 1000 /* µsec */
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static DBusHandlerResult
MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this );
static const DBusObjectPathVTable dbus_mpris_vtable = {
NULL, MPRISEntryPoint, /* handler function */
NULL, NULL, NULL, NULL
};
typedef struct
{
int signal;
......
/*****************************************************************************
* dbus.h : D-Bus control interface
*****************************************************************************
* Copyright © 2006-2008 Rafaël Carré
* Copyright © 2007-2012 Mirsal Ennaime
* Copyright © 2009-2012 The VideoLAN team
* $Id$
*
* Authors: Rafaël Carré <funman at videolanorg>
* Mirsal Ennaime <mirsal at mirsal fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _VLC_DBUS_H
#define _VLC_DBUS_H
#define DBUS_MPRIS_BUS_NAME "org.mpris.MediaPlayer2.vlc"
#define DBUS_INSTANCE_ID_PREFIX "instance"
static DBusHandlerResult
MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this );
static const DBusObjectPathVTable dbus_mpris_vtable = {
NULL, MPRISEntryPoint, /* handler function */
NULL, NULL, NULL, NULL
};
#define SEEK_THRESHOLD 1000 /* µsec */
#endif //dbus.h
......@@ -618,16 +618,20 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
ui.updatesDays->hide();
#endif
/* ONE INSTANCE options */
#if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__)
#if !defined( WIN32 ) && !defined(__APPLE__)
if( !module_exists( "dbus" ) )
ui.OneInterfaceBox->hide();
else
#endif
{
CONFIG_BOOL( "one-instance", OneInterfaceMode );
CONFIG_BOOL( "playlist-enqueue",
EnqueueOneInterfaceMode );
ui.EnqueueOneInterfaceMode->setEnabled( ui.OneInterfaceMode->isChecked() );
CONFIG_BOOL( "playlist-enqueue", EnqueueOneInterfaceMode );
ui.EnqueueOneInterfaceMode->setEnabled(
ui.OneInterfaceMode->isChecked() );
CONNECT( ui.OneInterfaceMode, toggled( bool ),
ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
#else
ui.OneInterfaceBox->hide();
#endif
}
/* RECENTLY PLAYED options */
CONNECT( ui.saveRecentlyPlayed, toggled( bool ),
ui.recentlyPlayedFilters, setEnabled( bool ) );
......
......@@ -5,7 +5,6 @@ DIST_SUBDIRS = $(BASE_SUBDIRS)
SOURCES_vod_rtsp = rtsp.c
SOURCES_audioscrobbler = audioscrobbler.c
SOURCES_inhibit = inhibit.c
SOURCES_sqlite = sqlite.c
SOURCES_xml = xml/libxml.c
......@@ -18,6 +17,13 @@ endif
EXTRA_LTLIBRARIES += libgnutls_plugin.la
libvlc_LTLIBRARIES += $(LTLIBgnutls)
libinhibit_plugin_la_SOURCES = inhibit.c
libinhibit_plugin_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
libinhibit_plugin_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS)
if HAVE_DBUS
libvlc_LTLIBRARIES += libinhibit_plugin.la
endif
libxdg_screensaver_plugin_la_SOURCES = inhibit/xdg.c
libxdg_screensaver_plugin_la_CFLAGS = $(AM_CFLAGS)
libxdg_screensaver_plugin_la_LIBADD = $(AM_LIBADD)
......
......@@ -174,6 +174,10 @@ AM_CFLAGS = $(CFLAGS_libvlccore)
if HAVE_DYNAMIC_PLUGINS
AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS
endif
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
AM_CFLAGS += $(DBUS_CFLAGS)
endif
libvlccore_la_SOURCES = $(SOURCES_libvlc)
libvlccore_la_LDFLAGS = \
......@@ -191,6 +195,9 @@ if HAVE_WIN32
libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version
endif
if HAVE_DBUS
libvlccore_la_LIBADD += $(DBUS_LIBS)
endif
libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
$(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment