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 ...@@ -11,7 +11,9 @@ SUFFIXES = .rc.in .rc
AM_CPPFLAGS = $(CPPFLAGS_vlc) AM_CPPFLAGS = $(CPPFLAGS_vlc)
AM_CFLAGS = $(CFLAGS_vlc) AM_CFLAGS = $(CFLAGS_vlc)
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
endif
if !HAVE_WIN32 if !HAVE_WIN32
bin_PROGRAMS += vlc-wrapper bin_PROGRAMS += vlc-wrapper
......
...@@ -619,7 +619,7 @@ AC_CHECK_FUNC(getopt_long,, [ ...@@ -619,7 +619,7 @@ AC_CHECK_FUNC(getopt_long,, [
AC_SUBST(GNUGETOPT_LIBS) AC_SUBST(GNUGETOPT_LIBS)
AC_CHECK_LIB(m,cos,[ 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="-lm"
], [ ], [
LIBM="" LIBM=""
...@@ -771,35 +771,19 @@ dnl Check for dbus ...@@ -771,35 +771,19 @@ dnl Check for dbus
AC_ARG_ENABLE(dbus, AC_ARG_ENABLE(dbus,
[AS_HELP_STRING([--enable-dbus], [AS_HELP_STRING([--enable-dbus],
[compile D-Bus message bus support (default enabled)])]) [compile D-Bus message bus support (default enabled)])])
case "${SYS}" in have_dbus="no"
linux*|*bsd*) AS_IF([test "${enable_dbus}" != "no"], [
if test "${enable_dbus}" != "no" -a "${SYS}" != "mingw32" PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0], [
then have_dbus="yes"
dnl api stable dbus ], [
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0.0], AS_IF([test -n "${enable_dbus}"], [
[ AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] ) AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])
VLC_ADD_LIBS([libvlccore],[$DBUS_LIBS]) ], [
VLC_ADD_CFLAGS([libvlccore],[$DBUS_CFLAGS]) AC_MSG_WARN([${DBUS_PKG_ERRORS}.])
dnl Check for dbus control interface ])
AC_ARG_ENABLE(dbus-control, ])
[AS_HELP_STRING([--disable-dbus-control], ])
[D-Bus control interface (default enabled)])]) AM_CONDITIONAL([HAVE_DBUS], [test "${have_dbus}" = "yes"])
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
dnl Check for ntohl, etc. dnl Check for ntohl, etc.
VLC_SAVE_FLAGS VLC_SAVE_FLAGS
...@@ -4090,7 +4074,6 @@ AC_CONFIG_FILES([ ...@@ -4090,7 +4074,6 @@ AC_CONFIG_FILES([
modules/codec/spudec/Makefile modules/codec/spudec/Makefile
modules/codec/wmafixed/Makefile modules/codec/wmafixed/Makefile
modules/control/Makefile modules/control/Makefile
modules/control/dbus/Makefile
modules/demux/Makefile modules/demux/Makefile
modules/demux/asf/Makefile modules/demux/asf/Makefile
modules/demux/avformat/Makefile modules/demux/avformat/Makefile
......
SUBDIRS = dbus
SOURCES_dummy = dummy.c SOURCES_dummy = dummy.c
SOURCES_gestures = gestures.c SOURCES_gestures = gestures.c
SOURCES_netsync = netsync.c SOURCES_netsync = netsync.c
...@@ -22,6 +21,19 @@ libvlc_LTLIBRARIES += \ ...@@ -22,6 +21,19 @@ libvlc_LTLIBRARIES += \
libnetsync_plugin.la \ libnetsync_plugin.la \
libhotkeys_plugin.la \ libhotkeys_plugin.la \
liboldrc_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 if !HAVE_WIN32
libglobalhotkeys_plugin_la_SOURCES = globalhotkeys/xcb.c libglobalhotkeys_plugin_la_SOURCES = globalhotkeys/xcb.c
libglobalhotkeys_plugin_la_CFLAGS = $(AM_CFLAGS) $(XCB_KEYSYMS_CFLAGS) $(XCB_CFLAGS) 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 @@ ...@@ -45,7 +45,6 @@
#endif #endif
#include <dbus/dbus.h> #include <dbus/dbus.h>
#include "dbus.h"
#include "dbus_common.h" #include "dbus_common.h"
#include "dbus_root.h" #include "dbus_root.h"
#include "dbus_player.h" #include "dbus_player.h"
...@@ -67,10 +66,23 @@ ...@@ -67,10 +66,23 @@
#include <errno.h> #include <errno.h>
#include <unistd.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. * 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 typedef struct
{ {
int signal; 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, ...@@ -618,16 +618,20 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
ui.updatesDays->hide(); ui.updatesDays->hide();
#endif #endif
/* ONE INSTANCE options */ /* ONE INSTANCE options */
#if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__) #if !defined( WIN32 ) && !defined(__APPLE__)
CONFIG_BOOL( "one-instance", OneInterfaceMode ); if( !module_exists( "dbus" ) )
CONFIG_BOOL( "playlist-enqueue", ui.OneInterfaceBox->hide();
EnqueueOneInterfaceMode ); else
ui.EnqueueOneInterfaceMode->setEnabled( ui.OneInterfaceMode->isChecked() );
CONNECT( ui.OneInterfaceMode, toggled( bool ),
ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
#else
ui.OneInterfaceBox->hide();
#endif #endif
{
CONFIG_BOOL( "one-instance", OneInterfaceMode );
CONFIG_BOOL( "playlist-enqueue", EnqueueOneInterfaceMode );
ui.EnqueueOneInterfaceMode->setEnabled(
ui.OneInterfaceMode->isChecked() );
CONNECT( ui.OneInterfaceMode, toggled( bool ),
ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
}
/* RECENTLY PLAYED options */ /* RECENTLY PLAYED options */
CONNECT( ui.saveRecentlyPlayed, toggled( bool ), CONNECT( ui.saveRecentlyPlayed, toggled( bool ),
ui.recentlyPlayedFilters, setEnabled( bool ) ); ui.recentlyPlayedFilters, setEnabled( bool ) );
......
...@@ -5,7 +5,6 @@ DIST_SUBDIRS = $(BASE_SUBDIRS) ...@@ -5,7 +5,6 @@ DIST_SUBDIRS = $(BASE_SUBDIRS)
SOURCES_vod_rtsp = rtsp.c SOURCES_vod_rtsp = rtsp.c
SOURCES_audioscrobbler = audioscrobbler.c SOURCES_audioscrobbler = audioscrobbler.c
SOURCES_inhibit = inhibit.c
SOURCES_sqlite = sqlite.c SOURCES_sqlite = sqlite.c
SOURCES_xml = xml/libxml.c SOURCES_xml = xml/libxml.c
...@@ -18,6 +17,13 @@ endif ...@@ -18,6 +17,13 @@ endif
EXTRA_LTLIBRARIES += libgnutls_plugin.la EXTRA_LTLIBRARIES += libgnutls_plugin.la
libvlc_LTLIBRARIES += $(LTLIBgnutls) 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_SOURCES = inhibit/xdg.c
libxdg_screensaver_plugin_la_CFLAGS = $(AM_CFLAGS) libxdg_screensaver_plugin_la_CFLAGS = $(AM_CFLAGS)
libxdg_screensaver_plugin_la_LIBADD = $(AM_LIBADD) libxdg_screensaver_plugin_la_LIBADD = $(AM_LIBADD)
......
...@@ -174,6 +174,10 @@ AM_CFLAGS = $(CFLAGS_libvlccore) ...@@ -174,6 +174,10 @@ AM_CFLAGS = $(CFLAGS_libvlccore)
if HAVE_DYNAMIC_PLUGINS if HAVE_DYNAMIC_PLUGINS
AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS AM_CPPFLAGS += -DHAVE_DYNAMIC_PLUGINS
endif endif
if HAVE_DBUS
AM_CPPFLAGS += -DHAVE_DBUS
AM_CFLAGS += $(DBUS_CFLAGS)
endif
libvlccore_la_SOURCES = $(SOURCES_libvlc) libvlccore_la_SOURCES = $(SOURCES_libvlc)
libvlccore_la_LDFLAGS = \ libvlccore_la_LDFLAGS = \
...@@ -191,6 +195,9 @@ if HAVE_WIN32 ...@@ -191,6 +195,9 @@ if HAVE_WIN32
libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT) libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version libvlccore_la_LDFLAGS += -Wl,libvlc_win32_rc.$(OBJEXT) -avoid-version
endif endif
if HAVE_DBUS
libvlccore_la_LIBADD += $(DBUS_LIBS)
endif
libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
$(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@ $(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