endif
endif
-if USE_ALAC
+if USE_APPLE_ALAC
shairport_sync_SOURCES += apple_alac.cpp
endif
CLEANFILES += $(BUILT_SOURCES)
dbus-interface.h dbus-interface.c: org.gnome.ShairportSync.xml
- gdbus-codegen --interface-prefix org.gnome --generate-c-code dbus-interface org.gnome.ShairportSync.xml
+ gdbus-codegen --interface-prefix org.gnome --c-generate-autocleanup all --generate-c-code dbus-interface org.gnome.ShairportSync.xml
endif
if USE_MPRIS
CLEANFILES += $(BUILT_SOURCES)
mpris-interface.h mpris-interface.c: org.mpris.MediaPlayer2.xml
- gdbus-codegen --interface-prefix org.mpris --generate-c-code mpris-interface org.mpris.MediaPlayer2.xml
+ gdbus-codegen --interface-prefix org.mpris --c-generate-autocleanup all --generate-c-code mpris-interface org.mpris.MediaPlayer2.xml
endif
noinst_PROGRAMS =
* Utility routines. This file is part of Shairport.
* Copyright (c) James Laird 2013
* The volume to attenuation function vol2attn copyright (c) Mike Brady 2014
+ * Further changes (c) Mike Brady 2014 -- 2018
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
#include <mach/mach_time.h>
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
#include "polarssl/ctr_drbg.h"
#include "polarssl/entropy.h"
#include <polarssl/base64.h>
#endif
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/entropy.h"
#include <mbedtls/base64.h>
return (status);
}
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
char *base64_enc(uint8_t *input, int length) {
char *buf = NULL;
size_t dlen = 0;
}
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
char *base64_enc(uint8_t *input, int length) {
char *buf = NULL;
size_t dlen = 0;
}
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
char *base64_enc(uint8_t *input, int length) {
BIO *bmem, *b64;
BUF_MEM *bptr;
"2gG0N5hvJpzwwhbhXqFKA4zaaSrw622wDniAK5MlIE0tIAKKP4yxNGjoD2QYjhBGuhvkWKY=\n"
"-----END RSA PRIVATE KEY-----\0";
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
RSA *rsa = NULL;
if (!rsa) {
}
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
mbedtls_pk_context pkctx;
mbedtls_rsa_context *trsa;
}
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
uint8_t *rsa_apply(uint8_t *input, int inlen, int *outlen, int mode) {
rsa_context trsa;
const char *pers = "rsa_encrypt";
void pthread_cleanup_debug_mutex_unlock(void *arg) { pthread_mutex_unlock((pthread_mutex_t *)arg); }
char *get_version_string() {
- char *version_string = malloc(200);
+ char *version_string = malloc(1024);
if (version_string) {
strcpy(version_string, PACKAGE_VERSION);
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
strcat(version_string, "-mbedTLS");
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
strcat(version_string, "-PolarSSL");
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
strcat(version_string, "-OpenSSL");
#endif
#ifdef CONFIG_TINYSVCMDNS
#ifdef CONFIG_PIPE
strcat(version_string, "-pipe");
#endif
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
strcat(version_string, "-soxr");
#endif
#ifdef CONFIG_CONVOLUTION
#ifdef CONFIG_METADATA
strcat(version_string, "-metadata");
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
strcat(version_string, "-mqtt");
#endif
-#ifdef HAVE_DBUS
+#ifdef CONFIG_DBUS_INTERFACE
strcat(version_string, "-dbus");
#endif
-#ifdef HAVE_MPRIS
+#ifdef CONFIG_MPRIS_INTERFACE
strcat(version_string, "-mpris");
#endif
strcat(version_string, "-sysconfdir:");
#define SAFAMILY sa_family
#endif
-#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
+#if defined(CONFIG_DBUS_INTERFACE) || defined(CONFIG_MPRIS_INTERFACE)
enum dbus_session_type {
DBT_system = 0, // use the session bus
DBT_session, // use the system bus
size_t metadata_sockmsglength;
int get_coverart;
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
int mqtt_enabled;
char *mqtt_hostname;
int mqtt_port;
int loudness;
float loudness_reference_volume_db;
int alsa_use_hardware_mute;
-#if defined(HAVE_DBUS)
+#if defined(CONFIG_DBUS_INTERFACE)
enum dbus_session_type dbus_service_bus_type;
#endif
-#if defined(HAVE_MPRIS)
+#if defined(CONFIG_MPRIS_INTERFACE)
enum dbus_session_type mpris_service_bus_type;
#endif
PKG_CHECK_MODULES(
[POPT], [popt],
[CFLAGS="${POPT_CFLAGS} ${CFLAGS}"
- LIBS="${POPT_LIBS} ${LIBS}"
- AC_DEFINE([HAVE_LIBPOPT],[1],[Define to 1 if you have the popt library])])
+ LIBS="${POPT_LIBS} ${LIBS}"])
else
AC_CHECK_LIB([popt],[poptGetContext], , AC_MSG_ERROR(libpopt needed))
fi
# Look for Apple ALAC flag
AC_ARG_WITH(apple-alac, [ --with-apple-alac = include support for the Apple ALAC decoder],
[AC_MSG_RESULT(>>Including the Apple ALAC Decoder)
- REQUESTED_ALAC=1
+ AC_DEFINE([CONFIG_APPLE_ALAC], 1, [Include support for using the Apple ALAC Decoder])
+ REQUESTED_APPLE_ALAC=1
if test "x${with_pkg_config}" = xyes ; then
PKG_CHECK_MODULES(
[ALAC], [alac],
- [LIBS="${ALAC_LIBS} ${LIBS}"
- AC_DEFINE([HAVE_ALAC],[1],[Define to 1 if you are using the Apple ALAC Decoder])])
+ [LIBS="${ALAC_LIBS} ${LIBS}"])
else
AC_CHECK_LIB([alac], [BitBufferInit], , AC_MSG_ERROR(Apple ALAC Decoder support requires the alac library!))
fi ])
-AM_CONDITIONAL([USE_ALAC], [test "x$REQUESTED_ALAC" = "x1"])
+AM_CONDITIONAL([USE_APPLE_ALAC], [test "x$REQUESTED_APPLE_ALAC" = "x1"])
# Look for piddir flag
AC_ARG_WITH(piddir, [ --with-piddir=<pathname> Specify a pathname to a directory in which to write the PID file.], [
AC_MSG_ERROR(choose "openssl", "mbedtls" or "polarssl" encryption)
fi
if test "x${with_ssl}" = xopenssl ; then
+ AC_DEFINE([CONFIG_OPENSSL], 1, [Use the OpenSSL libraries for encryption and encoding and decoding])
if test "x${with_pkg_config}" = xyes ; then
PKG_CHECK_MODULES(
[SSL], [libssl,libcrypto],
- [LIBS="${SSL_LIBS} ${LIBS}"
- AC_DEFINE([HAVE_LIBCRYPTO],[1],[Define to 1 if you have libcrypto])
- AC_DEFINE([HAVE_LIBSSL],[1],[Define to 1 if you have libssl])])
+ [LIBS="${SSL_LIBS} ${LIBS}"])
else
AC_CHECK_LIB([crypto], [main], , AC_MSG_ERROR(libcrypto selected but the library cannot be found!))
AC_CHECK_LIB([ssl], [main], , AC_MSG_ERROR(libssl selected but the library cannot be found!))
fi
elif test "x${with_ssl}" = xmbedtls ; then
+ AC_DEFINE([CONFIG_MBEDTLS], 1, [Use the mbed TLS libraries for encryption and encoding and decoding])
AC_CHECK_LIB([mbedtls],[mbedtls_ssl_init],,
[AC_MSG_ERROR([mbed tls support requires the mbedtls library -- libmbedtls-dev suggested],1)])
AC_CHECK_LIB([mbedcrypto], [mbedtls_entropy_func],,
AC_CHECK_LIB([mbedx509], [mbedtls_pk_init],,
[AC_MSG_ERROR([mbed tls support requires the mbedx509 library -- libmbedx509-0 suggested],1)])
elif test "x${with_ssl}" = xpolarssl ; then
+ AC_DEFINE([CONFIG_POLARSSL], 1, [Use the PolarSSL libraries for encryption and encoding and decoding])
AC_CHECK_LIB([polarssl],[ssl_init], , AC_MSG_ERROR(PolarSSL is selected but the library cannot be found and is deprecated. Consider selecting mbed TLS instead using --with-ssl=mbedtls.))
else
AC_MSG_ERROR(unknown option "${with_ssl}"." Please choose with "openssl", "mbedtls" or "polarssl")
AC_ARG_WITH(soxr, [ --with-soxr = choose libsoxr for high-quality interpolation], [
AC_MSG_RESULT(>>Including support for soxr-based interpolation)
if test "x${with_pkg_config}" = xyes ; then
+ AC_DEFINE([CONFIG_SOXR], 1, [Include support for using the SoX Resampler library for interpolation])
PKG_CHECK_MODULES(
[SOXR], [soxr],
- [LIBS="${SOXR_LIBS} ${LIBS}"
- AC_DEFINE([HAVE_LIBSOXR],[1],[Define to 1 if you are including support for soxr interpolation])])
-
+ [LIBS="${SOXR_LIBS} ${LIBS}"])
else
AC_CHECK_LIB([avutil],[av_get_cpu_flags])
if test "x${ac_cv_lib_avutil_av_get_cpu_flags}" = xyes ; then
if test "x${with_pkg_config}" = xyes ; then
PKG_CHECK_MODULES(
[ALSA], [alsa],
- [LIBS="${ALSA_LIBS} ${LIBS}"
- AC_DEFINE([HAVE_LIBASOUND],[1],[Define to 1 if you have ALSA])])
+ [LIBS="${ALSA_LIBS} ${LIBS}"])
else
AC_CHECK_LIB([asound], [snd_pcm_open], , AC_MSG_ERROR(ALSA support requires the asound library!))
fi ])
if test "x${with_pkg_config}" = xyes ; then
PKG_CHECK_MODULES(
[JACK], [jack],
- [LIBS="${JACK_LIBS} ${LIBS}"
- AC_DEFINE([HAVE_JACK],[1],[Define to 1 if you have Jack audio])],
+ [LIBS="${JACK_LIBS} ${LIBS}"],
[AC_MSG_ERROR(Jack Audio Connection Kit support requires the jack library -- libjack-dev suggested!)])
else
AC_CHECK_LIB([jack], [jack_client_open], , AC_MSG_ERROR(Jack Audio Connection Kit support requires the jack library -- libjack-dev suggested!))
AC_ARG_WITH(dns_sd, [ --with-dns_sd = choose dns_sd mDNS support], [
AC_MSG_RESULT(>>Including dns_sd for mDNS support)
REQUESTED_DNS_SD=1
- AC_DEFINE([CONFIG_HAVE_DNS_SD_H], 1, [Needed by the compiler.])
+ AC_DEFINE([CONFIG_DNS_SD], 1, [Needed by the compiler.])
AC_SEARCH_LIBS([DNSServiceRefDeallocate], [dns_sd], , AC_MSG_ERROR(dns_sd support requires the dns_sd library!))], )
AM_CONDITIONAL([USE_DNS_SD], [test "x$REQUESTED_DNS_SD" = "x1"])
# Look for dbus flag
AC_ARG_WITH(dbus-interface, [ --with-dbus-interface = include support for the native Shairport Sync D-Bus interface], [
AC_MSG_RESULT(>>Including dbus support)
+ AC_DEFINE([CONFIG_DBUS_INTERFACE], 1, [Include support for the native Shairport Sync D-Bus interface])
REQUESTED_DBUS=1
- AC_DEFINE([HAVE_DBUS], 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 messaging support requires the glib 2.0 library -- libglib2.0-dev suggested!)])
], )
AM_CONDITIONAL([USE_DBUS], [test "x$REQUESTED_DBUS" = "x1"])
AC_ARG_WITH(dbus-test-client, [ --with-dbus-test-client = compile dbus test client], [
AC_MSG_RESULT(>>Including dbus test client)
REQUESTED_DBUS_CLIENT=1
- AC_DEFINE([HAVE_DBUS_CLIENT], 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$REQUESTED_DBUS_CLIENT" = "x1"])
# Look for mpris flag
-AC_ARG_WITH(mpris-interface, [ --with-mpris-interface = include support for a Shairport Sync D-Bus interface conforming to the MPRIS standard], [
+AC_ARG_WITH(mpris-interface, [ --with-mpris-interface = include support for a D-Bus interface conforming to the MPRIS standard], [
AC_MSG_RESULT(>>Including the MPRIS D-Bus Interface)
+ AC_DEFINE([CONFIG_MPRIS_INTERFACE], 1, [Include support for a D-Bus interface conforming to the MPRIS standard])
REQUESTED_MPRIS=1
- AC_DEFINE([HAVE_MPRIS], 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 messaging support for mpris requires the glib 2.0 library -- libglib2.0-dev suggested!)])
], )
AM_CONDITIONAL([USE_MPRIS], [test "x$REQUESTED_MPRIS" = "x1"])
AC_ARG_WITH(mpris-test-client, [ --with-mpris-test-client = compile mpris test client], [
AC_MSG_RESULT(>>Including mpris test client)
REQUESTED_MPRIS_CLIENT=1
- AC_DEFINE([HAVE_MPRIS_CLIENT], 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(mpris client support requires the glib 2.0 library -- libglib2.0-dev suggested!)])
], )
AM_CONDITIONAL([USE_MPRIS_CLIENT], [test "x$REQUESTED_MPRIS_CLIENT" = "x1"])
-#AM_CONDITIONAL([USE_DBUS_CORE_AND_DACP], [test "x$REQUESTED_MPRIS" = "x1" -o "x$REQUESTED_DBUS" = "x1"])
-
# Look for mqtt flag
-AC_ARG_WITH(mqtt-client, [ --with-mqtt-client = include support for the native Shairport Sync MQTT interface], [
+AC_ARG_WITH(mqtt-client, [ --with-mqtt-client = include a client for MQTT -- the Message Queuing Telemetry Transport protocol], [
+ AC_DEFINE([CONFIG_MQTT], 1, [Include a client for MQTT, the Message Queuing Telemetry Transport protocol])
AC_MSG_RESULT(>>Including MQTT support)
REQUESTED_MQTT=1
AC_CHECK_LIB([mosquitto], [mosquitto_lib_init], , AC_MSG_ERROR(MQTT support requires the mosquitto library -- libmosquitto-dev suggested!))
gboolean notify_alacdecoder_callback(ShairportSync *skeleton,
__attribute__((unused)) gpointer user_data) {
char *th = (char *)shairport_sync_get_alacdecoder(skeleton);
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
if (strcasecmp(th, "hammerton") == 0)
config.use_apple_decoder = 0;
else if (strcasecmp(th, "apple") == 0)
gboolean notify_interpolation_callback(ShairportSync *skeleton,
__attribute__((unused)) gpointer user_data) {
char *th = (char *)shairport_sync_get_interpolation(skeleton);
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
if (strcasecmp(th, "basic") == 0)
config.packet_stuffing = ST_basic;
else if (strcasecmp(th, "soxr") == 0)
config.loudness_reference_volume_db);
shairport_sync_set_drift_tolerance(SHAIRPORT_SYNC(shairportSyncSkeleton), config.tolerance);
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
if (config.use_apple_decoder == 0) {
shairport_sync_set_alacdecoder(SHAIRPORT_SYNC(shairportSyncSkeleton), "hammerton");
debug(1, ">> ALACDecoder set to \"hammerton\"");
#endif
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
if (config.packet_stuffing == ST_basic) {
shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "basic");
debug(1, ">> interpolation set to \"basic\" (soxr support built in)");
extern mdns_backend mdns_avahi;
extern mdns_backend mdns_external_avahi;
#endif
-#ifdef CONFIG_HAVE_DNS_SD_H
+#ifdef CONFIG_DNS_SD
extern mdns_backend mdns_dns_sd;
extern mdns_backend mdns_external_dns_sd;
#endif
&mdns_avahi,
&mdns_external_avahi,
#endif
-#ifdef CONFIG_HAVE_DNS_SD_H
+#ifdef CONFIG_DNS_SD
&mdns_dns_sd,
&mdns_external_dns_sd,
#endif
#include "dacp.h"
#include "metadata_hub.h"
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
#include <mbedtls/md5.h>
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
#include <polarssl/md5.h>
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
#include <openssl/md5.h>
#endif
uint8_t img_md5[16];
// uint8_t ap_md5[16];
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_SSL
MD5_CTX ctx;
MD5_Init(&ctx);
MD5_Update(&ctx, buf, len);
MD5_Final(img_md5, &ctx);
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
mbedtls_md5_context tctx;
mbedtls_md5_starts(&tctx);
mbedtls_md5_update(&tctx, (const unsigned char *)buf, len);
mbedtls_md5_finish(&tctx, img_md5);
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
md5_context tctx;
md5_starts(&tctx);
md5_update(&tctx, (const unsigned char *)buf, len);
#include "config.h"
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
#include <mbedtls/aes.h>
#include <mbedtls/havege.h>
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
#include <polarssl/aes.h>
#include <polarssl/havege.h>
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
#include <openssl/aes.h>
#endif
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
#include <soxr.h>
#endif
#include "alac.h"
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
#include "apple_alac.h"
#endif
unsigned char iv[16];
int aeslen = len & ~0xf;
memcpy(iv, conn->stream.aesiv, sizeof(iv));
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
mbedtls_aes_crypt_cbc(&conn->dctx, MBEDTLS_AES_DECRYPT, aeslen, iv, buf, packet);
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
aes_crypt_cbc(&conn->dctx, AES_DECRYPT, aeslen, iv, buf, packet);
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
AES_cbc_encrypt(buf, packet, aeslen, &conn->aes, iv, AES_DECRYPT);
#endif
memcpy(packet + aeslen, buf + aeslen, len - aeslen);
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
if (config.use_apple_decoder) {
if (conn->decoder_in_use != 1 << decoder_apple_alac) {
debug(2, "Apple ALAC Decoder used on encrypted audio.");
}
} else {
// not encrypted
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
if (config.use_apple_decoder) {
if (conn->decoder_in_use != 1 << decoder_apple_alac) {
debug(2, "Apple ALAC Decoder used on unencrypted audio.");
alac->setinfo_8a_rate = fmtp[11];
alac_allocate_buffers(alac); // no pthread cancellation point in here
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
apple_alac_init(fmtp); // no pthread cancellation point in here
#endif
static void terminate_decoders(rtsp_conn_info *conn) {
alac_free(conn->decoder_info);
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
apple_alac_terminate();
#endif
}
return length + tstuff;
}
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
// this takes an array of signed 32-bit integers and
// (a) uses libsoxr to
// resample the array to have one more or one less frame, as specified in
init_buffer(conn); // will need a corresponding deallocation
if (conn->stream.encrypted) {
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
memset(&conn->dctx, 0, sizeof(mbedtls_aes_context));
mbedtls_aes_setkey_dec(&conn->dctx, conn->stream.aeskey, 128);
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
memset(&conn->dctx, 0, sizeof(aes_context));
aes_setkey_dec(&conn->dctx, conn->stream.aeskey, 128);
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
AES_set_decrypt_key(conn->stream.aeskey, 128, &conn->aes);
#endif
}
stuff_buffer_basic_32((int32_t *)conn->tbuf, inbuflength, config.output_format,
conn->outbuf, amount_to_stuff, enable_dither, conn);
}
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
else if (config.packet_stuffing == ST_soxr) {
// if (amount_to_stuff) debug(1,"Soxr stuff...");
play_samples = stuff_buffer_soxr_32((int32_t *)conn->tbuf, (int32_t *)conn->sbuf,
#include "config.h"
#include "definitions.h"
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
#include <mbedtls/aes.h>
#include <mbedtls/havege.h>
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
#include <polarssl/aes.h>
#include <polarssl/havege.h>
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
#include <openssl/aes.h>
#endif
uint64_t time_of_last_audio_packet;
seq_t ab_read, ab_write;
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
mbedtls_aes_context dctx;
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
aes_context dctx;
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
AES_KEY aes;
#endif
#include "config.h"
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
#include <openssl/md5.h>
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
#include <mbedtls/md5.h>
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
#include <polarssl/md5.h>
#endif
#include "metadata_hub.h"
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
#include "mqtt.h"
#endif
#ifdef CONFIG_METADATA_HUB
metadata_hub_process_metadata(pack.type, pack.code, pack.data, pack.length);
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
if (config.mqtt_enabled) {
mqtt_process_metadata(pack.type, pack.code, pack.data, pack.length);
}
uint8_t digest_urp[16], digest_mu[16], digest_total[16];
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
MD5_CTX ctx;
MD5_Init(&ctx);
MD5_Final(digest_mu, &ctx);
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
mbedtls_md5_context tctx;
mbedtls_md5_starts(&tctx);
mbedtls_md5_update(&tctx, (const unsigned char *)username, strlen(username));
mbedtls_md5_finish(&tctx, digest_mu);
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
md5_context tctx;
md5_starts(&tctx);
md5_update(&tctx, (const unsigned char *)username, strlen(username));
for (i = 0; i < 16; i++)
snprintf((char *)buf + 2 * i, 3, "%02x", digest_urp[i]);
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
MD5_Init(&ctx);
MD5_Update(&ctx, buf, 32);
MD5_Update(&ctx, ":", 1);
MD5_Final(digest_total, &ctx);
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
mbedtls_md5_starts(&tctx);
mbedtls_md5_update(&tctx, buf, 32);
mbedtls_md5_update(&tctx, (unsigned char *)":", 1);
mbedtls_md5_finish(&tctx, digest_total);
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
md5_starts(&tctx);
md5_update(&tctx, buf, 32);
md5_update(&tctx, (unsigned char *)":", 1);
#include "config.h"
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
#include <mbedtls/md5.h>
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
#include <polarssl/md5.h>
#endif
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
#include <openssl/md5.h>
#endif
-#if defined(HAVE_DBUS)
+#if defined(CONFIG_DBUS_INTERFACE)
#include <glib.h>
#endif
#include "metadata_hub.h"
#endif
-#ifdef HAVE_DBUS
+#ifdef CONFIG_DBUS_INTERFACE
#include "dbus-service.h"
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
#include "mqtt.h"
#endif
-#ifdef HAVE_MPRIS
+#ifdef CONFIG_MPRIS_INTERFACE
#include "mpris-service.h"
#endif
if (strcasecmp(str, "basic") == 0)
config.packet_stuffing = ST_basic;
else if (strcasecmp(str, "soxr") == 0)
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
config.packet_stuffing = ST_soxr;
#else
die("The soxr option not available because this version of shairport-sync was built "
config_error_file(&config_file_stuff), config_error_text(&config_file_stuff));
}
}
-#if defined(HAVE_DBUS)
+#if defined(CONFIG_DBUS_INTERFACE)
/* Get the dbus service sbus setting. */
if (config_lookup_string(config.cfg, "general.dbus_service_bus", &str)) {
if (strcasecmp(str, "system") == 0)
}
#endif
-#if defined(HAVE_MPRIS)
+#if defined(CONFIG_MPRIS_INTERFACE)
/* Get the mpris service sbus setting. */
if (config_lookup_string(config.cfg, "general.mpris_service_bus", &str)) {
if (strcasecmp(str, "system") == 0)
}
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
int tmpval = 0;
config_set_lookup_bool(config.cfg, "mqtt.enabled", &config.mqtt_enabled);
if (config.mqtt_enabled && !config.metadata_enabled) {
if (strcmp(stuffing, "basic") == 0)
config.packet_stuffing = ST_basic;
else if (strcmp(stuffing, "soxr") == 0)
-#ifdef HAVE_LIBSOXR
+#ifdef CONFIG_SOXR
config.packet_stuffing = ST_soxr;
#else
die("The soxr option not available because this version of shairport-sync was built "
free(i3);
free(vs);
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
// mqtt topic was not set. As we have the service name just now, set it
if (config.mqtt_topic == NULL) {
int topic_length = 1 + strlen(config.service_name) + 1;
return optind + 1;
}
-#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
+#if defined(CONFIG_DBUS_INTERFACE) || defined(CONFIG_MPRIS_INTERFACE)
GMainLoop *g_main_loop;
pthread_t dbus_thread;
void main_cleanup_handler(__attribute__((unused)) void *arg) {
debug(1, "main cleanup handler called.");
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
if (config.mqtt_enabled) {
// terminate_mqtt();
}
#endif
-#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
-#ifdef HAVE_MPRIS
+#if defined(CONFIG_DBUS_INTERFACE) || defined(CONFIG_MPRIS_INTERFACE)
+#ifdef CONFIG_MPRIS_INTERFACE
// stop_mpris_service();
#endif
-#ifdef HAVE_DBUS
+#ifdef CONFIG_DBUS_INTERFACE
stop_dbus_service();
#endif
debug(1, "Stopping DBUS Loop Thread");
config.output_rate = 44100; // default
config.decoders_supported =
1 << decoder_hammerton; // David Hammerton's decoder supported by default
-#ifdef HAVE_ALAC
+#ifdef CONFIG_APPLE_ALAC
config.decoders_supported += 1 << decoder_apple_alac;
#endif
uint8_t ap_md5[16];
-#ifdef HAVE_LIBSSL
+#ifdef CONFIG_OPENSSL
MD5_CTX ctx;
MD5_Init(&ctx);
MD5_Update(&ctx, config.service_name, strlen(config.service_name));
MD5_Final(ap_md5, &ctx);
#endif
-#ifdef HAVE_LIBMBEDTLS
+#ifdef CONFIG_MBEDTLS
mbedtls_md5_context tctx;
mbedtls_md5_starts(&tctx);
mbedtls_md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name));
mbedtls_md5_finish(&tctx, ap_md5);
#endif
-#ifdef HAVE_LIBPOLARSSL
+#ifdef CONFIG_POLARSSL
md5_context tctx;
md5_starts(&tctx);
md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name));
dacp_monitor_start();
#endif
-#if defined(HAVE_DBUS) || defined(HAVE_MPRIS)
+#if defined(CONFIG_DBUS_INTERFACE) || defined(CONFIG_MPRIS_INTERFACE)
// Start up DBUS services after initial settings are all made
// debug(1, "Starting up D-Bus services");
pthread_create(&dbus_thread, NULL, &dbus_thread_func, NULL);
-#ifdef HAVE_DBUS
+#ifdef CONFIG_DBUS_INTERFACE
start_dbus_service();
#endif
-#ifdef HAVE_MPRIS
+#ifdef CONFIG_MPRIS_INTERFACE
start_mpris_service();
#endif
#endif
-#ifdef HAVE_LIBMOSQUITTO
+#ifdef CONFIG_MQTT
if (config.mqtt_enabled) {
initialise_mqtt();
}