summaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-10-09 18:15:23 +0200
committerLennart Poettering <lennart@poettering.net>2008-10-09 18:15:23 +0200
commit181e9c6d5d11cb1e5d36a2777eeb233ad8ed00e5 (patch)
tree7c280968ce3fded5b325b1480d7f2440ddf93207 /src/common.h
parent30a4b516c8d591c11f05df38531f46452d930d2b (diff)
big pile of updates to match more what happened with libcanberra
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h80
1 files changed, 55 insertions, 25 deletions
diff --git a/src/common.h b/src/common.h
index 9d01c44..a89c55f 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,12 +1,32 @@
#ifndef foosydneycommonh
#define foosydneycommonh
+/***
+ This file is part of libsydney.
+
+ Copyright 2007-2008 Lennart Poettering
+
+ libsydney is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 2.1 of the
+ License, or (at your option) any later version.
+
+ libsydney 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libsydney. If not, see
+ <http://www.gnu.org/licenses/>.
+***/
+
+#include <stdarg.h>
+
#include "sydney.h"
#include "mutex.h"
#include "macro.h"
-#define _META_NAMES_MAX 9
-
typedef struct sa_pcm_attrs {
sa_pcm_format_t format;
unsigned rate;
@@ -15,18 +35,24 @@ typedef struct sa_pcm_attrs {
} pcm_attrs_t;
struct sa_stream {
- sa_mode_t mode;
+ sa_mutex *mutex;
+
+ sa_mode_t mode; /* immutable -- this means accessing this doesn't require locking */
- pcm_attrs_t pcm_attrs;
- size_t pcm_sample_size;
- size_t pcm_frame_size;
+ pcm_attrs_t pcm_attrs; /* immutable, except for .rate */
+ size_t pcm_sample_size; /* immutable */
+ size_t pcm_frame_size; /* immutable */
- char *codec;
+ char *codec; /* immutable */
+
+ sa_state_t state;
-/* size_t read_lower_watermark; */
-/* size_t read_upper_watermark; */
-/* size_t write_lower_watermark; */
-/* size_t write_upper_watermark; */
+ sa_proplist *props;
+
+ size_t read_latency;
+ size_t read_process_time;
+ size_t write_latency;
+ size_t write_process_time;
sa_xrun_mode_t xrun_mode;
sa_bool_t ni_enabled;
@@ -34,35 +60,39 @@ struct sa_stream {
sa_event_callback_t event_callback;
- char *device;
char *driver;
+ char *device;
int32_t *read_volume;
int32_t *write_volume;
+ sa_event_callback_t callback;
void *user_data;
- sa_state_t state;
-
sa_adjust_t adjust_rate;
sa_adjust_t adjust_nchannels;
sa_adjust_t adjust_pcm_format;
-/* sa_adjust_t adjust_watermarks; */
- sa_error_t error;
- sa_notify_t notify;
+ /* Current event data */
sa_event_t event;
+ int error;
+ sa_notify_t notify;
+ void *notify_data;
+ size_t notify_data_nbytes;
- void *driver_data; /* driver specific data */
-
- void *meta_data[_META_NAMES_MAX];
- size_t meta_data_size[_META_NAMES_MAX];
-
- sa_mutex *mutex;
-
- sa_event_callback_t callback;
+ void *private; /* driver specific data */
+#ifdef HAVE_DSO
+ void *private_dso;
+#endif
};
size_t sa_get_pcm_sample_size(sa_pcm_format_t f);
+float volume_to_dB(int32_t v);
+float volume_to_linear(int32_t v);
+int32_t volume_from_dB(float dB);
+int32_t volume_from_linear(float f);
+
+sa_bool_t sa_stream_frame_aligned(sa_stream *s, int64_t nbytes);
+
#endif