aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2016-09-22 01:40:55 +1200
committerMatthew Gregan <[email protected]>2016-10-12 17:06:10 +1300
commit0aea9e0438cabfe6703d587547c3a74e11380489 (patch)
treee676269f45f44b69176207df0e1c918fcac119b1 /src
parent22557d466eceb6ff6ba70ae30d2dcd87648cde0b (diff)
downloadcubeb-0aea9e0438cabfe6703d587547c3a74e11380489.tar.gz
cubeb-0aea9e0438cabfe6703d587547c3a74e11380489.zip
Replace autotools build system with CMake.
Diffstat (limited to 'src')
-rw-r--r--src/cubeb.c8
-rw-r--r--src/cubeb_alsa.c4
-rw-r--r--src/cubeb_log.h8
-rw-r--r--src/cubeb_pulse.c46
-rw-r--r--src/cubeb_resampler.cpp4
-rw-r--r--src/cubeb_wasapi.cpp3
6 files changed, 38 insertions, 35 deletions
diff --git a/src/cubeb.c b/src/cubeb.c
index 17ad84e..e6b6624 100644
--- a/src/cubeb.c
+++ b/src/cubeb.c
@@ -8,9 +8,6 @@
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
#include "cubeb/cubeb.h"
#include "cubeb-internal.h"
@@ -59,7 +56,7 @@ int kai_init(cubeb ** context, char const * context_name);
#endif
-int
+static int
validate_stream_params(cubeb_stream_params * input_stream_params,
cubeb_stream_params * output_stream_params)
{
@@ -101,7 +98,7 @@ validate_stream_params(cubeb_stream_params * input_stream_params,
-int
+static int
validate_latency(int latency)
{
if (latency < 1 || latency > 96000) {
@@ -473,4 +470,3 @@ cubeb_crash()
*((volatile int *) NULL) = 0;
}
-
diff --git a/src/cubeb_alsa.c b/src/cubeb_alsa.c
index ec203e0..42675e5 100644
--- a/src/cubeb_alsa.c
+++ b/src/cubeb_alsa.c
@@ -1090,7 +1090,7 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position)
return CUBEB_OK;
}
-int
+static int
alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
{
snd_pcm_sframes_t delay;
@@ -1105,7 +1105,7 @@ alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
return CUBEB_OK;
}
-int
+static int
alsa_stream_set_volume(cubeb_stream * stm, float volume)
{
/* setting the volume using an API call does not seem very stable/supported */
diff --git a/src/cubeb_log.h b/src/cubeb_log.h
index 42ea202..d38327e 100644
--- a/src/cubeb_log.h
+++ b/src/cubeb_log.h
@@ -10,9 +10,17 @@
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern cubeb_log_level g_log_level;
extern cubeb_log_callback g_log_callback;
+#ifdef __cplusplus
+}
+#endif
+
#define LOGV(...) do { \
LOG_INTERNAL(CUBEB_LOG_VERBOSE, __VA_ARGS__); \
} while(0)
diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c
index ec89d68..5576c4c 100644
--- a/src/cubeb_pulse.c
+++ b/src/cubeb_pulse.c
@@ -116,7 +116,7 @@ struct cubeb_stream {
cubeb_state state;
};
-const float PULSE_NO_GAIN = -1.0;
+static const float PULSE_NO_GAIN = -1.0;
enum cork_state {
UNCORK = 0,
@@ -636,8 +636,8 @@ pulse_destroy(cubeb * ctx)
static void pulse_stream_destroy(cubeb_stream * stm);
-pa_sample_format_t
-cubeb_to_pulse_format(cubeb_sample_format format)
+static pa_sample_format_t
+to_pulse_format(cubeb_sample_format format)
{
switch (format) {
case CUBEB_SAMPLE_S16LE:
@@ -662,7 +662,7 @@ create_pa_stream(cubeb_stream * stm,
assert(stm && stream_params);
*pa_stm = NULL;
pa_sample_spec ss;
- ss.format = cubeb_to_pulse_format(stream_params->format);
+ ss.format = to_pulse_format(stream_params->format);
if (ss.format == PA_SAMPLE_INVALID)
return CUBEB_ERROR_INVALID_FORMAT;
ss.rate = stream_params->rate;
@@ -835,7 +835,7 @@ pulse_stream_destroy(cubeb_stream * stm)
free(stm);
}
-void
+static void
pulse_defer_event_cb(pa_mainloop_api * a, void * userdata)
{
cubeb_stream * stm = userdata;
@@ -908,7 +908,7 @@ pulse_stream_get_position(cubeb_stream * stm, uint64_t * position)
return CUBEB_OK;
}
-int
+static int
pulse_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
{
pa_usec_t r_usec;
@@ -928,14 +928,15 @@ pulse_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
return CUBEB_OK;
}
-void volume_success(pa_context *c, int success, void *userdata)
+static void
+volume_success(pa_context *c, int success, void *userdata)
{
cubeb_stream * stream = userdata;
assert(success);
WRAP(pa_threaded_mainloop_signal)(stream->context->mainloop, 0);
}
-int
+static int
pulse_stream_set_volume(cubeb_stream * stm, float volume)
{
uint32_t index;
@@ -980,7 +981,7 @@ pulse_stream_set_volume(cubeb_stream * stm, float volume)
return CUBEB_OK;
}
-int
+static int
pulse_stream_set_panning(cubeb_stream * stream, float panning)
{
const pa_channel_map * map;
@@ -1222,7 +1223,8 @@ pulse_enumerate_devices(cubeb * context, cubeb_device_type type,
return CUBEB_OK;
}
-int pulse_stream_get_current_device(cubeb_stream * stm, cubeb_device ** const device)
+static int
+pulse_stream_get_current_device(cubeb_stream * stm, cubeb_device ** const device)
{
#if PA_CHECK_VERSION(0, 9, 8)
*device = calloc(1, sizeof(cubeb_device));
@@ -1245,8 +1247,9 @@ int pulse_stream_get_current_device(cubeb_stream * stm, cubeb_device ** const de
#endif
}
-int pulse_stream_device_destroy(cubeb_stream * stream,
- cubeb_device * device)
+static int
+pulse_stream_device_destroy(cubeb_stream * stream,
+ cubeb_device * device)
{
free(device->input_name);
free(device->output_name);
@@ -1254,9 +1257,10 @@ int pulse_stream_device_destroy(cubeb_stream * stream,
return CUBEB_OK;
}
-void pulse_subscribe_callback(pa_context * ctx,
- pa_subscription_event_type_t t,
- uint32_t index, void * userdata)
+static void
+pulse_subscribe_callback(pa_context * ctx,
+ pa_subscription_event_type_t t,
+ uint32_t index, void * userdata)
{
cubeb * context = userdata;
@@ -1289,17 +1293,19 @@ void pulse_subscribe_callback(pa_context * ctx,
}
}
-void subscribe_success(pa_context *c, int success, void *userdata)
+static void
+subscribe_success(pa_context *c, int success, void *userdata)
{
cubeb * context = userdata;
assert(success);
WRAP(pa_threaded_mainloop_signal)(context->mainloop, 0);
}
-int pulse_register_device_collection_changed(cubeb * context,
- cubeb_device_type devtype,
- cubeb_device_collection_changed_callback collection_changed_callback,
- void * user_ptr)
+static int
+pulse_register_device_collection_changed(cubeb * context,
+ cubeb_device_type devtype,
+ cubeb_device_collection_changed_callback collection_changed_callback,
+ void * user_ptr)
{
context->collection_changed_callback = collection_changed_callback;
context->collection_changed_user_ptr = user_ptr;
diff --git a/src/cubeb_resampler.cpp b/src/cubeb_resampler.cpp
index 7b9326e..f667694 100644
--- a/src/cubeb_resampler.cpp
+++ b/src/cubeb_resampler.cpp
@@ -4,7 +4,6 @@
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
*/
-
#ifndef NOMINMAX
#define NOMINMAX
#endif // NOMINMAX
@@ -15,9 +14,6 @@
#include <cstring>
#include <cstddef>
#include <cstdio>
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
#include "cubeb_resampler.h"
#include "cubeb-speex-resampler.h"
#include "cubeb_resampler_internal.h"
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp
index d960dfc..2cbad36 100644
--- a/src/cubeb_wasapi.cpp
+++ b/src/cubeb_wasapi.cpp
@@ -6,9 +6,6 @@
*/
#define NOMINMAX
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
#include <initguid.h>
#include <windows.h>
#include <mmdeviceapi.h>