Separate out metadata hub, dacp client, mpris and dbus interfaces a bit. Probably not finished.
This commit is contained in:
+6
-2
@@ -87,8 +87,12 @@ dbus-interface.c: org.gnome.ShairportSync.xml
|
||||
gdbus-codegen --interface-prefix org.gnome --generate-c-code dbus-interface org.gnome.ShairportSync.xml
|
||||
endif
|
||||
|
||||
if USE_DBUS_CORE_AND_DACP
|
||||
shairport_sync_SOURCES += dacp.c metadata_hub.c tinyhttp/chunk.c tinyhttp/header.c tinyhttp/http.c
|
||||
if USE_METADATA_HUB
|
||||
shairport_sync_SOURCES += metadata_hub.c
|
||||
endif
|
||||
|
||||
if USE_DACP_CLIENT
|
||||
shairport_sync_SOURCES += dacp.c tinyhttp/chunk.c tinyhttp/header.c tinyhttp/http.c
|
||||
endif
|
||||
|
||||
if USE_MPRIS
|
||||
|
||||
+17
-5
@@ -266,7 +266,7 @@ AC_ARG_WITH(dns_sd, [ --with-dns_sd = choose dns_sd mDNS support], [
|
||||
AM_CONDITIONAL([USE_DNS_SD], [test "x$HAS_DNS_SD" = "x1"])
|
||||
|
||||
# Look for dbus flag
|
||||
AC_ARG_WITH(dbus, [ --with-dbus = choose dbus support], [
|
||||
AC_ARG_WITH(dbus, [ --with-dbus-interface = include support for a native Shairport Sync D-Bus interface], [
|
||||
AC_MSG_RESULT(>>Including dbus support)
|
||||
HAS_DBUS=1
|
||||
AC_DEFINE([HAVE_DBUS], 1, [Needed by the compiler.])
|
||||
@@ -279,14 +279,14 @@ AC_ARG_WITH(dbus-test-client, [ --with-dbus-test-client = compile dbus test cli
|
||||
AC_MSG_RESULT(>>Including dbus test client)
|
||||
HAS_DBUS_CLIENT=1
|
||||
AC_DEFINE([HAVE_DBUS_CLIENT], 1, [Needed by the compiler.])
|
||||
AC_DEFINE([CONFIG_DACP], 1, [Needed by the compiler.])
|
||||
# AC_DEFINE([CONFIG_DACP], 1, [Needed by the compiler.])
|
||||
PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.30.0],[CFLAGS="${GIO_UNIX_CFLAGS} ${CFLAGS}" LIBS="${GIO_UNIX_LIBS} ${LIBS}"],[AC_MSG_ERROR(dbus client support requires the glib 2.0 library -- libglib2.0-dev suggested!)])
|
||||
], )
|
||||
AM_CONDITIONAL([USE_DBUS_CLIENT], [test "x$HAS_DBUS_CLIENT" = "x1"])
|
||||
|
||||
# Look for mpris flag
|
||||
AC_ARG_WITH(mpris, [ --with-mpris = choose mpris support], [
|
||||
AC_MSG_RESULT(>>Including mpris support)
|
||||
AC_ARG_WITH(mpris, [ --with-mpris-interface = include support for a Shairport Sync D-Bus interface conforming to the MPRIS standard], [
|
||||
AC_MSG_RESULT(>>Including the MPRIS D-Bus Interface)
|
||||
HAS_MPRIS=1
|
||||
AC_DEFINE([HAVE_MPRIS], 1, [Needed by the compiler.])
|
||||
AC_DEFINE([CONFIG_DACP], 1, [Needed by the compiler.])
|
||||
@@ -303,7 +303,19 @@ AC_ARG_WITH(mpris-test-client, [ --with-mpris-test-client = compile mpris test
|
||||
], )
|
||||
AM_CONDITIONAL([USE_MPRIS_CLIENT], [test "x$HAS_MPRIS_CLIENT" = "x1"])
|
||||
|
||||
AM_CONDITIONAL([USE_DBUS_CORE_AND_DACP], [test "x$HAS_MPRIS" = "x1" -o "x$HAS_DBUS" = "x1"])
|
||||
#AM_CONDITIONAL([USE_DBUS_CORE_AND_DACP], [test "x$HAS_MPRIS" = "x1" -o "x$HAS_DBUS" = "x1"])
|
||||
|
||||
if test "x$HAS_MPRIS" = "x1" -o "x$HAS_DBUS" = "x1" ; then
|
||||
AC_MSG_RESULT(>>Including the metadata hub)
|
||||
HAS_METADATA_HUB=1
|
||||
AC_DEFINE([HAVE_METADATA_HUB], 1, [Needed by the compiler.])
|
||||
AC_MSG_RESULT(>>Including the DACP client)
|
||||
HAS_DACP_CLIENT=1
|
||||
AC_DEFINE([HAVE_DACP_CLIENT], 1, [Needed by the compiler.])
|
||||
fi
|
||||
AM_CONDITIONAL([USE_METADATA_HUB], [test "x$HAS_METADATA_HUB" = "x1"])
|
||||
AM_CONDITIONAL([USE_DACP_CLIENT], [test "x$HAS_DACP_CLIENT" = "x1"])
|
||||
|
||||
|
||||
if test "x${with_systemd}" = xyes ; then
|
||||
# Find systemd unit dir
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@
|
||||
#include "common.h"
|
||||
#include "mdns.h"
|
||||
#include "rtsp.h"
|
||||
#ifdef CONFIG_DACP
|
||||
#ifdef HAVE_DACP_CLIENT
|
||||
#include "dacp.h"
|
||||
#endif
|
||||
#include <string.h>
|
||||
@@ -89,7 +89,7 @@ static void resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIn
|
||||
if (conn->dacp_port != port) {
|
||||
debug(1, "Client's DACP port: %u.", port);
|
||||
conn->dacp_port = port;
|
||||
#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
|
||||
#ifdef HAVE_DACP_CLIENT
|
||||
set_dacp_server_information(conn);
|
||||
#endif
|
||||
#ifdef CONFIG_METADATA
|
||||
@@ -141,7 +141,7 @@ static void browse_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, Avah
|
||||
if (conn->dacp_id != 0) {
|
||||
debug(1, "Client's DACP status withdrawn.");
|
||||
conn->dacp_port = 0;
|
||||
#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
|
||||
#ifdef HAVE_DACP_CLIENT
|
||||
set_dacp_server_information(conn); // this will have the effect of telling the scanner
|
||||
// that the DACP server is no longer working
|
||||
#endif
|
||||
|
||||
+6
-1
@@ -58,7 +58,12 @@ typedef struct metadata_bundle {
|
||||
|
||||
unsigned char
|
||||
item_composite_id[16]; // seems to be nowplaying 4 ids: dbid, plid, playlistItem, itemid
|
||||
|
||||
|
||||
//
|
||||
|
||||
enum play_status_type player_state; // this is the state of the actual player itself, which can be a bit noisy.
|
||||
|
||||
|
||||
metadata_watcher watchers[number_of_watchers]; // functions to call if the metadata is changed.
|
||||
void *watchers_data[number_of_watchers]; // their individual data
|
||||
|
||||
|
||||
@@ -68,7 +68,11 @@
|
||||
#include <FFTConvolver/convolver.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
|
||||
#ifdef HAVE_METADATA_HUB
|
||||
#include "metadata_hub.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DACP_CLIENT
|
||||
#include "dacp.h"
|
||||
#include <glib.h>
|
||||
#endif
|
||||
@@ -817,11 +821,12 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) {
|
||||
// frames...",curframe->timestamp,seq_diff(ab_read, ab_write));
|
||||
|
||||
// say we have started playing here
|
||||
#if defined(HAVE_MPRIS)
|
||||
#ifdef HAVE_METADATA_HUB
|
||||
if ((conn->play_state != SST_stopped) && (conn->play_state != SST_playing)) {
|
||||
conn->play_state = SST_playing;
|
||||
debug(1, "MPRIS Playing");
|
||||
media_player2_player_set_playback_status(mprisPlayerPlayerSkeleton, "Playing");
|
||||
debug(1, "Player State: Playing");
|
||||
metadata_store.player_state = PS_PLAYING;
|
||||
// media_player2_player_set_playback_status(mprisPlayerPlayerSkeleton, "Playing");
|
||||
}
|
||||
#endif
|
||||
if (reference_timestamp) { // if we have a reference time
|
||||
|
||||
+7
-3
@@ -58,8 +58,12 @@
|
||||
#include <glib.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
|
||||
#if defined(HAVE_DACP_CLIENT)
|
||||
#include "dacp.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_METADATA_HUB)
|
||||
#include "metadata_hub.h"
|
||||
#endif
|
||||
|
||||
@@ -1541,12 +1545,12 @@ int main(int argc, char **argv) {
|
||||
metadata_init(); // create the metadata pipe if necessary
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
|
||||
#ifdef HAVE_METADATA_HUB
|
||||
debug(1, "Initialising metadata hub");
|
||||
metadata_hub_init();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
|
||||
#ifdef HAVE_DACP_CLIENT
|
||||
debug(1, "Requesting DACP Monitor");
|
||||
dacp_monitor_start();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user