#endif
#include "mixeng.h"
+#ifdef CONFIG_GIO
+#include <gio/gio.h>
+#endif
+
struct audio_pcm_ops;
struct audio_callback {
const char *descr;
void *(*init) (Audiodev *);
void (*fini) (void *);
+#ifdef CONFIG_GIO
+ void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *manager);
+#endif
struct audio_pcm_ops *pcm_ops;
int can_be_default;
int max_voices_out;
void (*fini_out)(HWVoiceOut *hw);
size_t (*write) (HWVoiceOut *hw, void *buf, size_t size);
void (*run_buffer_out)(HWVoiceOut *hw);
+ /*
+ * Get the free output buffer size. This is an upper limit. The size
+ * returned by function get_buffer_out may be smaller.
+ */
+ size_t (*buffer_get_free)(HWVoiceOut *hw);
/*
* get a buffer that after later can be passed to put_buffer_out; optional
* returns the buffer, and writes it's size to size (in bytes)
- * this is unrelated to the above buffer_size_out function
*/
void *(*get_buffer_out)(HWVoiceOut *hw, size_t *size);
/*
void *audio_generic_get_buffer_in(HWVoiceIn *hw, size_t *size);
void audio_generic_put_buffer_in(HWVoiceIn *hw, void *buf, size_t size);
void audio_generic_run_buffer_out(HWVoiceOut *hw);
+size_t audio_generic_buffer_get_free(HWVoiceOut *hw);
void *audio_generic_get_buffer_out(HWVoiceOut *hw, size_t *size);
size_t audio_generic_put_buffer_out(HWVoiceOut *hw, void *buf, size_t size);
size_t audio_generic_write(HWVoiceOut *hw, void *buf, size_t size);
void audio_run(AudioState *s, const char *msg);
+const char *audio_application_name(void);
+
typedef struct RateCtl {
int64_t start_ticks;
int64_t bytes_sent;
return (dst >= src) ? (dst - src) : (len - src + dst);
}
+/**
+ * audio_ring_posb() - returns new position in ringbuffer in backward
+ * direction at given distance
+ *
+ * @pos: current position in ringbuffer
+ * @dist: distance in ringbuffer to walk in reverse direction
+ * @len: size of ringbuffer
+ */
+static inline size_t audio_ring_posb(size_t pos, size_t dist, size_t len)
+{
+ return pos >= dist ? pos - dist : len - dist + pos;
+}
+
#define dolog(fmt, ...) AUD_log(AUDIO_CAP, fmt, ## __VA_ARGS__)
#ifdef DEBUG