mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse: add SPA_EXPORT
This commit is contained in:
parent
6cd1104d0c
commit
5f9200d9ee
28 changed files with 397 additions and 1 deletions
|
|
@ -159,6 +159,7 @@ const char *const pretty_table[PA_CHANNEL_POSITION_MAX] = {
|
|||
[PA_CHANNEL_POSITION_TOP_REAR_RIGHT] = N_("Top Rear Right")
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_map* pa_channel_map_init(pa_channel_map *m) {
|
||||
unsigned c;
|
||||
pa_assert(m);
|
||||
|
|
@ -171,6 +172,7 @@ pa_channel_map* pa_channel_map_init(pa_channel_map *m) {
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m) {
|
||||
pa_assert(m);
|
||||
|
||||
|
|
@ -181,6 +183,7 @@ pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m) {
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m) {
|
||||
pa_assert(m);
|
||||
|
||||
|
|
@ -192,6 +195,7 @@ pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m) {
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def) {
|
||||
pa_assert(m);
|
||||
pa_assert(pa_channels_valid(channels));
|
||||
|
|
@ -391,6 +395,7 @@ pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, p
|
|||
}
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def) {
|
||||
unsigned c;
|
||||
|
||||
|
|
@ -420,6 +425,7 @@ pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_channel_position_to_string(pa_channel_position_t pos) {
|
||||
|
||||
if (pos < 0 || pos >= PA_CHANNEL_POSITION_MAX)
|
||||
|
|
@ -428,6 +434,7 @@ const char* pa_channel_position_to_string(pa_channel_position_t pos) {
|
|||
return table[pos];
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos) {
|
||||
|
||||
if (pos < 0 || pos >= PA_CHANNEL_POSITION_MAX)
|
||||
|
|
@ -438,6 +445,7 @@ const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos) {
|
|||
return _(pretty_table[pos]);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) {
|
||||
unsigned c;
|
||||
|
||||
|
|
@ -461,6 +469,7 @@ int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map) {
|
||||
unsigned channel;
|
||||
bool first = true;
|
||||
|
|
@ -491,6 +500,7 @@ char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map) {
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_position_t pa_channel_position_from_string(const char *p) {
|
||||
pa_channel_position_t i;
|
||||
pa_assert(p);
|
||||
|
|
@ -512,6 +522,7 @@ pa_channel_position_t pa_channel_position_from_string(const char *p) {
|
|||
return PA_CHANNEL_POSITION_INVALID;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_map *pa_channel_map_parse(pa_channel_map *rmap, const char *s) {
|
||||
pa_channel_map map;
|
||||
char **tokens;
|
||||
|
|
@ -611,6 +622,7 @@ finish:
|
|||
return rmap;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_valid(const pa_channel_map *map) {
|
||||
unsigned c;
|
||||
|
||||
|
|
@ -626,6 +638,7 @@ int pa_channel_map_valid(const pa_channel_map *map) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss) {
|
||||
pa_assert(map);
|
||||
pa_assert(ss);
|
||||
|
|
@ -636,6 +649,7 @@ int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *s
|
|||
return map->channels == ss->channels;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_superset(const pa_channel_map *a, const pa_channel_map *b) {
|
||||
pa_channel_position_mask_t am, bm;
|
||||
|
||||
|
|
@ -655,6 +669,7 @@ int pa_channel_map_superset(const pa_channel_map *a, const pa_channel_map *b) {
|
|||
return (bm & am) == bm;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_can_balance(const pa_channel_map *map) {
|
||||
pa_channel_position_mask_t m;
|
||||
|
||||
|
|
@ -668,6 +683,7 @@ int pa_channel_map_can_balance(const pa_channel_map *map) {
|
|||
(PA_CHANNEL_POSITION_MASK_RIGHT & m);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_can_fade(const pa_channel_map *map) {
|
||||
pa_channel_position_mask_t m;
|
||||
|
||||
|
|
@ -681,6 +697,7 @@ int pa_channel_map_can_fade(const pa_channel_map *map) {
|
|||
(PA_CHANNEL_POSITION_MASK_REAR & m);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_can_lfe_balance(const pa_channel_map *map) {
|
||||
pa_channel_position_mask_t m;
|
||||
|
||||
|
|
@ -694,6 +711,7 @@ int pa_channel_map_can_lfe_balance(const pa_channel_map *map) {
|
|||
(PA_CHANNEL_POSITION_MASK_HFE & m);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_channel_map_to_name(const pa_channel_map *map) {
|
||||
pa_bitset_t in_map[PA_BITSET_ELEMENTS(PA_CHANNEL_POSITION_MAX)];
|
||||
unsigned c;
|
||||
|
|
@ -748,6 +766,7 @@ const char* pa_channel_map_to_name(const pa_channel_map *map) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) {
|
||||
pa_bitset_t in_map[PA_BITSET_ELEMENTS(PA_CHANNEL_POSITION_MAX)];
|
||||
unsigned c;
|
||||
|
|
@ -804,6 +823,7 @@ const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t p) {
|
||||
unsigned c;
|
||||
|
||||
|
|
@ -817,6 +837,7 @@ int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_channel_position_mask_t pa_channel_map_mask(const pa_channel_map *map) {
|
||||
unsigned c;
|
||||
pa_channel_position_mask_t r = 0;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ static void context_fail(pa_context *c, int error) {
|
|||
pa_context_set_state(c, PA_CONTEXT_FAILED);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name)
|
||||
{
|
||||
return pa_context_new_with_proplist(mainloop, name, NULL);
|
||||
|
|
@ -419,6 +420,7 @@ static const struct pw_remote_events remote_events = {
|
|||
.state_changed = remote_state_changed,
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, pa_proplist *p)
|
||||
{
|
||||
struct pw_core *core;
|
||||
|
|
@ -483,6 +485,7 @@ static void context_free(pa_context *c)
|
|||
pw_core_destroy(c->core);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_context_unref(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -492,6 +495,7 @@ void pa_context_unref(pa_context *c)
|
|||
context_free(c);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_context* pa_context_ref(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -500,6 +504,7 @@ pa_context* pa_context_ref(pa_context *c)
|
|||
return c;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -512,6 +517,7 @@ void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, voi
|
|||
c->state_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_context_set_event_callback(pa_context *c, pa_context_event_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -524,6 +530,7 @@ void pa_context_set_event_callback(pa_context *c, pa_context_event_cb_t cb, void
|
|||
c->event_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_context_errno(pa_context *c)
|
||||
{
|
||||
if (!c)
|
||||
|
|
@ -534,6 +541,7 @@ int pa_context_errno(pa_context *c)
|
|||
return c->error;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_context_is_pending(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -544,6 +552,7 @@ int pa_context_is_pending(pa_context *c)
|
|||
return !spa_list_is_empty(&c->operations);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_context_state_t pa_context_get_state(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -551,6 +560,7 @@ pa_context_state_t pa_context_get_state(pa_context *c)
|
|||
return c->state;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -573,6 +583,7 @@ int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t fla
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_context_disconnect(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -598,6 +609,7 @@ static void on_notify(pa_operation *o, void *userdata)
|
|||
d->cb(c, d->userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -627,6 +639,7 @@ static void on_success(pa_operation *o, void *userdata)
|
|||
d->cb(c, d->ret, d->userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -641,18 +654,21 @@ pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb,
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_default_sink(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_default_source(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_context_is_local(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -663,6 +679,7 @@ int pa_context_is_local(pa_context *c)
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
struct spa_dict dict;
|
||||
|
|
@ -689,6 +706,7 @@ pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_su
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_context_get_server(pa_context *c)
|
||||
{
|
||||
const struct pw_core_info *info;
|
||||
|
|
@ -702,11 +720,13 @@ const char* pa_context_get_server(pa_context *c)
|
|||
return info->name;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
uint32_t pa_context_get_protocol_version(pa_context *c)
|
||||
{
|
||||
return PA_PROTOCOL_VERSION;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
uint32_t pa_context_get_server_protocol_version(pa_context *c)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
@ -717,6 +737,7 @@ uint32_t pa_context_get_server_protocol_version(pa_context *c)
|
|||
return PA_PROTOCOL_VERSION;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, pa_proplist *p, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -739,6 +760,7 @@ pa_operation *pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, p
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[], pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -760,11 +782,13 @@ pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[]
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
uint32_t pa_context_get_index(pa_context *c)
|
||||
{
|
||||
return c->client_index;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_time_event* pa_context_rttime_new(pa_context *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
|
@ -781,6 +805,7 @@ pa_time_event* pa_context_rttime_new(pa_context *c, pa_usec_t usec, pa_time_even
|
|||
return c->mainloop->time_new(c->mainloop, &tv, cb, userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_context_rttime_restart(pa_context *c, pa_time_event *e, pa_usec_t usec)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
|
@ -797,6 +822,7 @@ void pa_context_rttime_restart(pa_context *c, pa_time_event *e, pa_usec_t usec)
|
|||
}
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_context_get_tile_size(pa_context *c, const pa_sample_spec *ss)
|
||||
{
|
||||
size_t fs, mbs;
|
||||
|
|
@ -811,6 +837,7 @@ size_t pa_context_get_tile_size(pa_context *c, const pa_sample_spec *ss)
|
|||
return PA_MAX(mbs, fs);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_context_load_cookie_from_file(pa_context *c, const char *cookie_file_path)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "internal.h"
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_sample_format(const pa_format_info *f, pa_sample_format_t *sf) {
|
||||
int r;
|
||||
char *sf_str;
|
||||
|
|
@ -51,6 +52,7 @@ int pa_format_info_get_sample_format(const pa_format_info *f, pa_sample_format_t
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_rate(const pa_format_info *f, uint32_t *rate) {
|
||||
int r;
|
||||
int rate_local;
|
||||
|
|
@ -72,6 +74,7 @@ int pa_format_info_get_rate(const pa_format_info *f, uint32_t *rate) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_channels(const pa_format_info *f, uint8_t *channels) {
|
||||
int r;
|
||||
int channels_local;
|
||||
|
|
@ -93,6 +96,7 @@ int pa_format_info_get_channels(const pa_format_info *f, uint8_t *channels) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_channel_map(const pa_format_info *f, pa_channel_map *map) {
|
||||
int r;
|
||||
char *map_str;
|
||||
|
|
@ -115,6 +119,7 @@ int pa_format_info_get_channel_map(const pa_format_info *f, pa_channel_map *map)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_format_info *pa_format_info_from_sample_spec2(const pa_sample_spec *ss, const pa_channel_map *map, bool set_format,
|
||||
bool set_rate, bool set_channels) {
|
||||
pa_format_info *format = NULL;
|
||||
|
|
@ -152,6 +157,7 @@ fail:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_to_sample_spec2(const pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map,
|
||||
const pa_sample_spec *fallback_ss, const pa_channel_map *fallback_map) {
|
||||
int r, r2;
|
||||
|
|
@ -216,6 +222,7 @@ int pa_format_info_to_sample_spec2(const pa_format_info *f, pa_sample_spec *ss,
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_to_sample_spec_fake(const pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map) {
|
||||
int rate;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,13 @@
|
|||
|
||||
#include <errno.h>
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
#include <pulse/direction.h>
|
||||
|
||||
#define pa_init_i18n()
|
||||
#define _(String) (String)
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_direction_valid(pa_direction_t direction)
|
||||
{
|
||||
if (direction != PA_DIRECTION_INPUT
|
||||
|
|
@ -33,6 +35,7 @@ int pa_direction_valid(pa_direction_t direction)
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char *pa_direction_to_string(pa_direction_t direction) {
|
||||
pa_init_i18n();
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#define _(String) (String)
|
||||
#define pa_init_i18n()
|
||||
|
||||
SPA_EXPORT
|
||||
const char*pa_strerror(int error)
|
||||
{
|
||||
static const char* const errortab[PA_ERR_MAX] = {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "internal.h"
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_test(
|
||||
pa_context *c,
|
||||
pa_ext_device_manager_test_cb_t cb,
|
||||
|
|
@ -35,6 +36,7 @@ pa_operation *pa_ext_device_manager_test(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_read(
|
||||
pa_context *c,
|
||||
pa_ext_device_manager_read_cb_t cb,
|
||||
|
|
@ -44,6 +46,7 @@ pa_operation *pa_ext_device_manager_read(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_set_device_description(
|
||||
pa_context *c,
|
||||
const char* device,
|
||||
|
|
@ -55,6 +58,7 @@ pa_operation *pa_ext_device_manager_set_device_description(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_delete(
|
||||
pa_context *c,
|
||||
const char *const s[],
|
||||
|
|
@ -65,6 +69,7 @@ pa_operation *pa_ext_device_manager_delete(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_enable_role_device_priority_routing(
|
||||
pa_context *c,
|
||||
int enable,
|
||||
|
|
@ -75,6 +80,7 @@ pa_operation *pa_ext_device_manager_enable_role_device_priority_routing(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_reorder_devices_for_role(
|
||||
pa_context *c,
|
||||
const char* role,
|
||||
|
|
@ -86,6 +92,7 @@ pa_operation *pa_ext_device_manager_reorder_devices_for_role(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_manager_subscribe(
|
||||
pa_context *c,
|
||||
int enable,
|
||||
|
|
@ -96,6 +103,7 @@ pa_operation *pa_ext_device_manager_subscribe(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_ext_device_manager_set_subscribe_cb(
|
||||
pa_context *c,
|
||||
pa_ext_device_manager_subscribe_cb_t cb,
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ static void restore_test(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_restore_test(
|
||||
pa_context *c,
|
||||
pa_ext_device_restore_test_cb_t cb,
|
||||
|
|
@ -72,6 +73,7 @@ static void on_success(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_restore_subscribe(
|
||||
pa_context *c,
|
||||
int enable,
|
||||
|
|
@ -96,6 +98,7 @@ pa_operation *pa_ext_device_restore_subscribe(
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_ext_device_restore_set_subscribe_cb(
|
||||
pa_context *c,
|
||||
pa_ext_device_restore_subscribe_cb_t cb,
|
||||
|
|
@ -112,6 +115,7 @@ static void read_formats(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_restore_read_formats_all(
|
||||
pa_context *c,
|
||||
pa_ext_device_restore_read_device_formats_cb_t cb,
|
||||
|
|
@ -135,6 +139,7 @@ pa_operation *pa_ext_device_restore_read_formats_all(
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_restore_read_formats(
|
||||
pa_context *c,
|
||||
pa_device_type_t type,
|
||||
|
|
@ -160,6 +165,7 @@ pa_operation *pa_ext_device_restore_read_formats(
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_device_restore_save_formats(
|
||||
pa_context *c,
|
||||
pa_device_type_t type,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ static void restore_test(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_stream_restore_test(
|
||||
pa_context *c,
|
||||
pa_ext_stream_restore_test_cb_t cb,
|
||||
|
|
@ -76,6 +77,7 @@ static void restore_read(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_stream_restore_read(
|
||||
pa_context *c,
|
||||
pa_ext_stream_restore_read_cb_t cb,
|
||||
|
|
@ -107,6 +109,7 @@ static void on_success(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_stream_restore_write(
|
||||
pa_context *c,
|
||||
pa_update_mode_t mode,
|
||||
|
|
@ -135,6 +138,7 @@ pa_operation *pa_ext_stream_restore_write(
|
|||
}
|
||||
|
||||
/** Delete entries from the stream database. \since 0.9.12 */
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_stream_restore_delete(
|
||||
pa_context *c,
|
||||
const char *const s[],
|
||||
|
|
@ -160,6 +164,7 @@ pa_operation *pa_ext_stream_restore_delete(
|
|||
}
|
||||
|
||||
/** Subscribe to changes in the stream database. \since 0.9.12 */
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_ext_stream_restore_subscribe(
|
||||
pa_context *c,
|
||||
int enable,
|
||||
|
|
@ -186,6 +191,7 @@ pa_operation *pa_ext_stream_restore_subscribe(
|
|||
|
||||
/** Set the subscription callback that is called when
|
||||
* pa_ext_stream_restore_subscribe() was called. \since 0.9.12 */
|
||||
SPA_EXPORT
|
||||
void pa_ext_stream_restore_set_subscribe_cb(
|
||||
pa_context *c,
|
||||
pa_ext_stream_restore_subscribe_cb_t cb,
|
||||
|
|
|
|||
28
src/format.c
28
src/format.c
|
|
@ -46,6 +46,7 @@ static const char* const _encoding_str_table[]= {
|
|||
[PA_ENCODING_ANY] = "any",
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
const char *pa_encoding_to_string(pa_encoding_t e) {
|
||||
if (e < 0 || e >= PA_ENCODING_MAX)
|
||||
return NULL;
|
||||
|
|
@ -53,6 +54,7 @@ const char *pa_encoding_to_string(pa_encoding_t e) {
|
|||
return _encoding_str_table[e];
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_encoding_t pa_encoding_from_string(const char *encoding) {
|
||||
pa_encoding_t e;
|
||||
|
||||
|
|
@ -63,6 +65,7 @@ pa_encoding_t pa_encoding_from_string(const char *encoding) {
|
|||
return PA_ENCODING_INVALID;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_format_info* pa_format_info_new(void) {
|
||||
pa_format_info *f = pa_xnew(pa_format_info, 1);
|
||||
|
||||
|
|
@ -72,6 +75,7 @@ pa_format_info* pa_format_info_new(void) {
|
|||
return f;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_format_info* pa_format_info_copy(const pa_format_info *src) {
|
||||
pa_format_info *dest;
|
||||
|
||||
|
|
@ -89,6 +93,7 @@ pa_format_info* pa_format_info_copy(const pa_format_info *src) {
|
|||
return dest;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_free(pa_format_info *f) {
|
||||
pa_assert(f);
|
||||
|
||||
|
|
@ -96,14 +101,17 @@ void pa_format_info_free(pa_format_info *f) {
|
|||
pa_xfree(f);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_valid(const pa_format_info *f) {
|
||||
return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_is_pcm(const pa_format_info *f) {
|
||||
return f->encoding == PA_ENCODING_PCM;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f) {
|
||||
char *tmp;
|
||||
|
||||
|
|
@ -127,6 +135,7 @@ char *pa_format_info_snprint(char *s, size_t l, const pa_format_info *f) {
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_format_info* pa_format_info_from_string(const char *str) {
|
||||
pa_format_info *f = pa_format_info_new();
|
||||
char *encoding = NULL, *properties = NULL;
|
||||
|
|
@ -165,6 +174,7 @@ error:
|
|||
goto out;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_is_compatible(const pa_format_info *first, const pa_format_info *second) {
|
||||
const char *key;
|
||||
void *state = NULL;
|
||||
|
|
@ -188,6 +198,7 @@ int pa_format_info_is_compatible(const pa_format_info *first, const pa_format_in
|
|||
return true;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_format_info* pa_format_info_from_sample_spec(const pa_sample_spec *ss, const pa_channel_map *map) {
|
||||
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
pa_format_info *f;
|
||||
|
|
@ -211,6 +222,7 @@ pa_format_info* pa_format_info_from_sample_spec(const pa_sample_spec *ss, const
|
|||
}
|
||||
|
||||
/* For PCM streams */
|
||||
SPA_EXPORT
|
||||
int pa_format_info_to_sample_spec(const pa_format_info *f, pa_sample_spec *ss, pa_channel_map *map) {
|
||||
pa_assert(f);
|
||||
pa_assert(ss);
|
||||
|
|
@ -230,6 +242,7 @@ int pa_format_info_to_sample_spec(const pa_format_info *f, pa_sample_spec *ss, p
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_prop_type_t pa_format_info_get_prop_type(const pa_format_info *f, const char *key) {
|
||||
const char *str;
|
||||
pa_json_object *o;
|
||||
|
|
@ -300,6 +313,7 @@ pa_prop_type_t pa_format_info_get_prop_type(const pa_format_info *f, const char
|
|||
return type;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_prop_int(const pa_format_info *f, const char *key, int *v) {
|
||||
const char *str;
|
||||
pa_json_object *o;
|
||||
|
|
@ -330,6 +344,7 @@ int pa_format_info_get_prop_int(const pa_format_info *f, const char *key, int *v
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_prop_int_range(const pa_format_info *f, const char *key, int *min, int *max) {
|
||||
const char *str;
|
||||
pa_json_object *o;
|
||||
|
|
@ -376,6 +391,7 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_prop_int_array(const pa_format_info *f, const char *key, int **values, int *n_values) {
|
||||
const char *str;
|
||||
pa_json_object *o;
|
||||
|
|
@ -423,6 +439,7 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_prop_string(const pa_format_info *f, const char *key, char **v) {
|
||||
const char *str = NULL;
|
||||
pa_json_object *o;
|
||||
|
|
@ -453,6 +470,7 @@ int pa_format_info_get_prop_string(const pa_format_info *f, const char *key, cha
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_format_info_get_prop_string_array(const pa_format_info *f, const char *key, char ***values, int *n_values) {
|
||||
const char *str;
|
||||
pa_json_object *o;
|
||||
|
|
@ -500,6 +518,7 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_free_string_array(char **values, int n_values) {
|
||||
int i;
|
||||
|
||||
|
|
@ -509,18 +528,22 @@ void pa_format_info_free_string_array(char **values, int n_values) {
|
|||
pa_xfree(values);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_sample_format(pa_format_info *f, pa_sample_format_t sf) {
|
||||
pa_format_info_set_prop_string(f, PA_PROP_FORMAT_SAMPLE_FORMAT, pa_sample_format_to_string(sf));
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_rate(pa_format_info *f, int rate) {
|
||||
pa_format_info_set_prop_int(f, PA_PROP_FORMAT_RATE, rate);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_channels(pa_format_info *f, int channels) {
|
||||
pa_format_info_set_prop_int(f, PA_PROP_FORMAT_CHANNELS, channels);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_channel_map(pa_format_info *f, const pa_channel_map *map) {
|
||||
char map_str[PA_CHANNEL_MAP_SNPRINT_MAX];
|
||||
|
||||
|
|
@ -529,6 +552,7 @@ void pa_format_info_set_channel_map(pa_format_info *f, const pa_channel_map *map
|
|||
pa_format_info_set_prop_string(f, PA_PROP_FORMAT_CHANNEL_MAP, map_str);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_prop_int(pa_format_info *f, const char *key, int value) {
|
||||
pa_assert(f);
|
||||
pa_assert(key);
|
||||
|
|
@ -536,6 +560,7 @@ void pa_format_info_set_prop_int(pa_format_info *f, const char *key, int value)
|
|||
pa_proplist_setf(f->plist, key, "%d", value);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_prop_int_array(pa_format_info *f, const char *key, const int *values, int n_values) {
|
||||
pa_strbuf *buf;
|
||||
char *str;
|
||||
|
|
@ -559,6 +584,7 @@ void pa_format_info_set_prop_int_array(pa_format_info *f, const char *key, const
|
|||
pa_xfree (str);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_prop_int_range(pa_format_info *f, const char *key, int min, int max) {
|
||||
pa_assert(f);
|
||||
pa_assert(key);
|
||||
|
|
@ -567,6 +593,7 @@ void pa_format_info_set_prop_int_range(pa_format_info *f, const char *key, int m
|
|||
min, max);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_prop_string(pa_format_info *f, const char *key, const char *value) {
|
||||
pa_assert(f);
|
||||
pa_assert(key);
|
||||
|
|
@ -574,6 +601,7 @@ void pa_format_info_set_prop_string(pa_format_info *f, const char *key, const ch
|
|||
pa_proplist_setf(f->plist, key, "\"%s\"", value);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_format_info_set_prop_string_array(pa_format_info *f, const char *key, const char **values, int n_values) {
|
||||
pa_strbuf *buf;
|
||||
char *str;
|
||||
|
|
|
|||
|
|
@ -379,6 +379,7 @@ static void sink_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name, pa_sink_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -407,6 +408,7 @@ pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name,
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t idx, pa_sink_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -453,6 +455,7 @@ static void sink_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sink_info_list(pa_context *c, pa_sink_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -507,6 +510,7 @@ static void set_node_mute(pa_context *c, struct global *g, bool mute)
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -537,6 +541,7 @@ pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, c
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -565,6 +570,7 @@ pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -594,6 +600,7 @@ pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -621,24 +628,28 @@ pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name,
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_suspend_sink_by_name(pa_context *c, const char *sink_name, int suspend, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_port_by_index(pa_context *c, uint32_t idx, const char*port, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_port_by_name(pa_context *c, const char*name, const char*port, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
|
|
@ -731,6 +742,7 @@ static void source_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name, pa_source_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -759,6 +771,7 @@ pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t idx, pa_source_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -804,6 +817,7 @@ static void source_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_source_info_list(pa_context *c, pa_source_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -826,6 +840,7 @@ pa_operation* pa_context_get_source_info_list(pa_context *c, pa_source_info_cb_t
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -856,6 +871,7 @@ pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx,
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *name, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -884,6 +900,7 @@ pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *na
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -913,6 +930,7 @@ pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, i
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name, int mute, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -940,24 +958,28 @@ pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_suspend_source_by_name(pa_context *c, const char *source_name, int suspend, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, int suspend, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_port_by_index(pa_context *c, uint32_t idx, const char*port, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_port_by_name(pa_context *c, const char*name, const char*port, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
|
|
@ -999,6 +1021,7 @@ static void server_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_server_info(pa_context *c, pa_server_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1039,6 +1062,7 @@ static void module_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1085,6 +1109,7 @@ static void module_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_module_info_list(pa_context *c, pa_module_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1107,12 +1132,14 @@ pa_operation* pa_context_get_module_info_list(pa_context *c, pa_module_info_cb_t
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_load_module(pa_context *c, const char*name, const char *argument, pa_context_index_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_unload_module(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
|
|
@ -1140,6 +1167,7 @@ static void client_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1186,6 +1214,7 @@ static void client_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_client_info_list(pa_context *c, pa_client_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1208,6 +1237,7 @@ pa_operation* pa_context_get_client_info_list(pa_context *c, pa_client_info_cb_t
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_kill_client(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
struct global *g;
|
||||
|
|
@ -1298,6 +1328,7 @@ static void card_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_card_info_by_index(pa_context *c, uint32_t idx, pa_card_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1328,6 +1359,7 @@ pa_operation* pa_context_get_card_info_by_index(pa_context *c, uint32_t idx, pa_
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_card_info_by_name(pa_context *c, const char *name, pa_card_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1372,6 +1404,7 @@ static void card_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_card_info_list(pa_context *c, pa_card_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1441,6 +1474,7 @@ done:
|
|||
free(d->profile);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_card_profile_by_index(pa_context *c, uint32_t idx, const char*profile, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1474,6 +1508,7 @@ pa_operation* pa_context_set_card_profile_by_index(pa_context *c, uint32_t idx,
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_card_profile_by_name(pa_context *c, const char*name, const char*profile, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1505,6 +1540,7 @@ pa_operation* pa_context_set_card_profile_by_name(pa_context *c, const char*name
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_port_latency_offset(pa_context *c, const char *card_name, const char *port_name, int64_t offset, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
|
|
@ -1610,6 +1646,7 @@ static void sink_input_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1657,6 +1694,7 @@ static void sink_input_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1680,18 +1718,21 @@ pa_operation* pa_context_get_sink_input_info_list(pa_context *c, pa_sink_input_i
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, const char *sink_name, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, uint32_t sink_idx, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_stream *s;
|
||||
|
|
@ -1724,6 +1765,7 @@ pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, cons
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_stream *s;
|
||||
|
|
@ -1754,6 +1796,7 @@ pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mu
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_kill_sink_input(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_stream *s;
|
||||
|
|
@ -1873,6 +1916,7 @@ static void source_output_info(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_source_output_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1919,6 +1963,7 @@ static void source_output_info_list(pa_operation *o, void *userdata)
|
|||
pa_operation_done(o);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_output_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1941,18 +1986,21 @@ pa_operation* pa_context_get_source_output_info_list(pa_context *c, pa_source_ou
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx, const char *source_name, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx, uint32_t source_idx, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_output_volume(pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_stream *s;
|
||||
|
|
@ -1985,6 +2033,7 @@ pa_operation* pa_context_set_source_output_volume(pa_context *c, uint32_t idx, c
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_set_source_output_mute(pa_context *c, uint32_t idx, int mute, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_stream *s;
|
||||
|
|
@ -2015,6 +2064,7 @@ pa_operation* pa_context_set_source_output_mute(pa_context *c, uint32_t idx, int
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_stream *s;
|
||||
|
|
@ -2044,60 +2094,70 @@ pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_cont
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_stat(pa_context *c, pa_stat_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name, pa_sample_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, pa_sample_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_sample_info_list(pa_context *c, pa_sample_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_autoload_info_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_autoload_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Deprecated: Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_autoload_info_by_index(pa_context *c, uint32_t idx, pa_autoload_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Deprecated: Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_get_autoload_info_list(pa_context *c, pa_autoload_info_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Deprecated: Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_add_autoload(pa_context *c, const char *name, pa_autoload_type_t type, const char *module, const char*argument, pa_context_index_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Deprecated: Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_remove_autoload_by_name(pa_context *c, const char *name, pa_autoload_type_t type, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Deprecated: Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, pa_context_success_cb_t cb, void* userdata)
|
||||
{
|
||||
pw_log_warn("Deprecated: Not Implemented");
|
||||
|
|
|
|||
11
src/json.c
11
src/json.c
|
|
@ -499,6 +499,7 @@ error:
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
pa_json_object* pa_json_parse(const char *str) {
|
||||
pa_json_object *obj;
|
||||
|
||||
|
|
@ -518,10 +519,12 @@ pa_json_object* pa_json_parse(const char *str) {
|
|||
return obj;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_json_type pa_json_object_get_type(const pa_json_object *obj) {
|
||||
return obj->type;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_json_object_free(pa_json_object *obj) {
|
||||
|
||||
switch (pa_json_object_get_type(obj)) {
|
||||
|
|
@ -551,26 +554,31 @@ void pa_json_object_free(pa_json_object *obj) {
|
|||
pa_xfree(obj);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_json_object_get_int(const pa_json_object *o) {
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_INT);
|
||||
return o->int_value;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
double pa_json_object_get_double(const pa_json_object *o) {
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_DOUBLE);
|
||||
return o->double_value;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
bool pa_json_object_get_bool(const pa_json_object *o) {
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_BOOL);
|
||||
return o->bool_value;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_json_object_get_string(const pa_json_object *o) {
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_STRING);
|
||||
return o->string_value;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_json_object* pa_json_object_get_object_member(const pa_json_object *o, const char *name) {
|
||||
pa_json_item *item;
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_OBJECT);
|
||||
|
|
@ -581,17 +589,20 @@ const pa_json_object* pa_json_object_get_object_member(const pa_json_object *o,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_json_object_get_array_length(const pa_json_object *o) {
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_ARRAY);
|
||||
return pw_array_get_len(&o->values, const pa_json_object*);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_json_object* pa_json_object_get_array_member(const pa_json_object *o, int index) {
|
||||
pa_assert(pa_json_object_get_type(o) == PA_JSON_TYPE_ARRAY);
|
||||
return pw_array_get_unchecked_s(&o->values, index, sizeof(pa_json_object*),
|
||||
const pa_json_object);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
bool pa_json_object_equal(const pa_json_object *o1, const pa_json_object *o2) {
|
||||
int i;
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ static GSourceFuncs source_funcs =
|
|||
NULL,
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
pa_glib_mainloop *pa_glib_mainloop_new(GMainContext *c)
|
||||
{
|
||||
|
||||
|
|
@ -102,6 +103,7 @@ pa_glib_mainloop *pa_glib_mainloop_new(GMainContext *c)
|
|||
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_glib_mainloop_free(pa_glib_mainloop* g)
|
||||
{
|
||||
g_source_destroy(&g->source->base);
|
||||
|
|
@ -109,6 +111,7 @@ void pa_glib_mainloop_free(pa_glib_mainloop* g)
|
|||
free(g);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_mainloop_api* pa_glib_mainloop_get_api(pa_glib_mainloop *g)
|
||||
{
|
||||
return pa_mainloop_get_api(g->loop);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ struct pa_signal_event {
|
|||
void *userdata;
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_signal_init(pa_mainloop_api *a)
|
||||
{
|
||||
pa_assert(a);
|
||||
|
|
@ -54,6 +55,7 @@ int pa_signal_init(pa_mainloop_api *a)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_signal_done(void)
|
||||
{
|
||||
pa_signal_event *ev, *t;
|
||||
|
|
@ -74,6 +76,7 @@ static void source_signal_func (void *data, int signal_number)
|
|||
ev->callback(api, ev, signal_number, ev->userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t callback, void *userdata)
|
||||
{
|
||||
pa_signal_event *ev;
|
||||
|
|
@ -91,6 +94,7 @@ pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t callback, void *userdata)
|
|||
return ev;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_signal_free(pa_signal_event *e)
|
||||
{
|
||||
pa_assert(e);
|
||||
|
|
@ -102,6 +106,7 @@ void pa_signal_free(pa_signal_event *e)
|
|||
free(e);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_signal_set_destroy(pa_signal_event *e, pa_signal_destroy_cb_t callback)
|
||||
{
|
||||
pa_assert(e);
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ static const pa_mainloop_api api =
|
|||
.quit = api_quit,
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
pa_mainloop *pa_mainloop_new(void)
|
||||
{
|
||||
pa_mainloop *loop;
|
||||
|
|
@ -263,12 +264,14 @@ pa_mainloop *pa_mainloop_new(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_mainloop_free(pa_mainloop* m)
|
||||
{
|
||||
pw_loop_destroy(m->loop);
|
||||
free(m);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_mainloop_prepare(pa_mainloop *m, int timeout)
|
||||
{
|
||||
if (m->quit)
|
||||
|
|
@ -279,6 +282,7 @@ int pa_mainloop_prepare(pa_mainloop *m, int timeout)
|
|||
}
|
||||
|
||||
/** Execute the previously prepared poll. Returns a negative value on error.*/
|
||||
SPA_EXPORT
|
||||
int pa_mainloop_poll(pa_mainloop *m)
|
||||
{
|
||||
if (m->quit)
|
||||
|
|
@ -287,6 +291,7 @@ int pa_mainloop_poll(pa_mainloop *m)
|
|||
return m->n_events = pw_loop_iterate(m->loop, m->timeout);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_mainloop_dispatch(pa_mainloop *m)
|
||||
{
|
||||
if (m->quit)
|
||||
|
|
@ -295,6 +300,7 @@ int pa_mainloop_dispatch(pa_mainloop *m)
|
|||
return m->n_events;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_mainloop_get_retval(pa_mainloop *m)
|
||||
{
|
||||
return m->retval;
|
||||
|
|
@ -306,6 +312,7 @@ Returns a negative value on error or exit request. If block is nonzero,
|
|||
block for events if none are queued. Optionally return the return value as
|
||||
specified with the main loop's quit() routine in the integer variable retval points
|
||||
to. On success returns the number of sources dispatched in this iteration. */
|
||||
SPA_EXPORT
|
||||
int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval)
|
||||
{
|
||||
int r;
|
||||
|
|
@ -328,6 +335,7 @@ int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval)
|
|||
return r;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_mainloop_run(pa_mainloop *m, int *retval)
|
||||
{
|
||||
int r;
|
||||
|
|
@ -342,24 +350,28 @@ int pa_mainloop_run(pa_mainloop *m, int *retval)
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
pa_mainloop_api* pa_mainloop_get_api(pa_mainloop *m)
|
||||
{
|
||||
pa_assert(m);
|
||||
return &m->api;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_mainloop_quit(pa_mainloop *m, int retval)
|
||||
{
|
||||
pa_assert(m);
|
||||
m->api.quit(&m->api, retval);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_mainloop_wakeup(pa_mainloop *m)
|
||||
{
|
||||
pa_assert(m);
|
||||
pw_loop_signal_event(m->loop, m->event);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ int pa_operation_sync(pa_operation *o)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_operation_ref(pa_operation *o)
|
||||
{
|
||||
pa_assert(o);
|
||||
|
|
@ -96,6 +97,7 @@ static void operation_unlink(pa_operation *o) {
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_operation_unref(pa_operation *o)
|
||||
{
|
||||
pa_assert(o);
|
||||
|
|
@ -126,6 +128,7 @@ static void operation_set_state(pa_operation *o, pa_operation_state_t st) {
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_operation_cancel(pa_operation *o)
|
||||
{
|
||||
pa_assert(o);
|
||||
|
|
@ -141,6 +144,7 @@ void pa_operation_done(pa_operation *o) {
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation_state_t pa_operation_get_state(pa_operation *o)
|
||||
{
|
||||
pa_assert(o);
|
||||
|
|
@ -148,6 +152,7 @@ pa_operation_state_t pa_operation_get_state(pa_operation *o)
|
|||
return o->state;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_operation_set_state_callback(pa_operation *o, pa_operation_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_assert(o);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ pa_proplist* pa_proplist_new_props(struct pw_properties *props)
|
|||
return pa_proplist_new_dict(&props->dict);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_proplist* pa_proplist_new(void)
|
||||
{
|
||||
return pa_proplist_new_dict(NULL);
|
||||
|
|
@ -60,12 +61,14 @@ int pa_proplist_update_dict(pa_proplist *p, struct spa_dict *dict)
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_proplist_free(pa_proplist* p)
|
||||
{
|
||||
pw_properties_free(p->props);
|
||||
free(p);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_key_valid(const char *key)
|
||||
{
|
||||
const char *p;
|
||||
|
|
@ -79,6 +82,7 @@ int pa_proplist_key_valid(const char *key)
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_sets(pa_proplist *p, const char *key, const char *value)
|
||||
{
|
||||
pa_assert(p);
|
||||
|
|
@ -92,6 +96,7 @@ int pa_proplist_sets(pa_proplist *p, const char *key, const char *value)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_setp(pa_proplist *p, const char *pair)
|
||||
{
|
||||
const char *t;
|
||||
|
|
@ -113,6 +118,7 @@ int pa_proplist_setp(pa_proplist *p, const char *pair)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...)
|
||||
{
|
||||
va_list varargs;
|
||||
|
|
@ -124,6 +130,7 @@ int pa_proplist_setf(pa_proplist *p, const char *key, const char *format, ...)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nbytes)
|
||||
{
|
||||
pa_assert(p);
|
||||
|
|
@ -137,11 +144,13 @@ int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nb
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char *pa_proplist_gets(pa_proplist *p, const char *key)
|
||||
{
|
||||
return pw_properties_get(p->props, key);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes)
|
||||
{
|
||||
const char *val;
|
||||
|
|
@ -156,6 +165,7 @@ int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, const pa_proplist *other)
|
||||
{
|
||||
uint32_t i;
|
||||
|
|
@ -181,6 +191,7 @@ void pa_proplist_update(pa_proplist *p, pa_update_mode_t mode, const pa_proplist
|
|||
}
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_unset(pa_proplist *p, const char *key)
|
||||
{
|
||||
spa_assert(p);
|
||||
|
|
@ -192,6 +203,7 @@ int pa_proplist_unset(pa_proplist *p, const char *key)
|
|||
return pw_properties_set(p->props, key, NULL);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_unset_many(pa_proplist *p, const char * const keys[])
|
||||
{
|
||||
const char * const * k;
|
||||
|
|
@ -210,6 +222,7 @@ int pa_proplist_unset_many(pa_proplist *p, const char * const keys[])
|
|||
return n;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char *pa_proplist_iterate(pa_proplist *p, void **state)
|
||||
{
|
||||
spa_assert(p);
|
||||
|
|
@ -217,12 +230,14 @@ const char *pa_proplist_iterate(pa_proplist *p, void **state)
|
|||
return pw_properties_iterate(p->props, state);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_proplist_to_string(pa_proplist *p)
|
||||
{
|
||||
spa_assert(p);
|
||||
return pa_proplist_to_string_sep(p, ",");
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep)
|
||||
{
|
||||
const char *key;
|
||||
|
|
@ -269,6 +284,7 @@ char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep)
|
|||
return pa_strbuf_to_string_free(buf);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_proplist *pa_proplist_from_string(const char *str)
|
||||
{
|
||||
spa_assert(str);
|
||||
|
|
@ -276,6 +292,7 @@ pa_proplist *pa_proplist_from_string(const char *str)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_contains(pa_proplist *p, const char *key)
|
||||
{
|
||||
spa_assert(p);
|
||||
|
|
@ -290,12 +307,14 @@ int pa_proplist_contains(pa_proplist *p, const char *key)
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_proplist_clear(pa_proplist *p)
|
||||
{
|
||||
spa_assert(p);
|
||||
pw_properties_clear(p->props);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_proplist* pa_proplist_copy(const pa_proplist *p)
|
||||
{
|
||||
pa_proplist *c;
|
||||
|
|
@ -310,18 +329,21 @@ pa_proplist* pa_proplist_copy(const pa_proplist *p)
|
|||
return c;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
unsigned pa_proplist_size(pa_proplist *p)
|
||||
{
|
||||
spa_assert(p);
|
||||
return p->props->dict.n_items;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_isempty(pa_proplist *p)
|
||||
{
|
||||
spa_assert(p);
|
||||
return p->props->dict.n_items == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_proplist_equal(pa_proplist *a, pa_proplist *b)
|
||||
{
|
||||
uint32_t i;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <pulse/rtclock.h>
|
||||
|
||||
SPA_EXPORT
|
||||
pa_usec_t pa_rtclock_now(void)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
|
|
|||
18
src/sample.c
18
src/sample.c
|
|
@ -50,6 +50,7 @@ static const size_t size_table[] = {
|
|||
[PA_SAMPLE_S24_32BE] = 4
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_sample_size_of_format(pa_sample_format_t f)
|
||||
{
|
||||
spa_assert(pa_sample_format_valid(f));
|
||||
|
|
@ -57,6 +58,7 @@ size_t pa_sample_size_of_format(pa_sample_format_t f)
|
|||
return size_table[f];
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_sample_size(const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -65,6 +67,7 @@ size_t pa_sample_size(const pa_sample_spec * spec)
|
|||
return size_table[spec->format];
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_frame_size(const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -73,6 +76,7 @@ size_t pa_frame_size(const pa_sample_spec * spec)
|
|||
return size_table[spec->format] * spec->channels;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_bytes_per_second(const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -81,6 +85,7 @@ size_t pa_bytes_per_second(const pa_sample_spec * spec)
|
|||
return spec->rate * size_table[spec->format] * spec->channels;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_usec_t pa_bytes_to_usec(uint64_t length, const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -91,6 +96,7 @@ pa_usec_t pa_bytes_to_usec(uint64_t length, const pa_sample_spec * spec)
|
|||
* PA_USEC_PER_SEC) / spec->rate);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -100,6 +106,7 @@ size_t pa_usec_to_bytes(pa_usec_t t, const pa_sample_spec * spec)
|
|||
(size_table[spec->format] * spec->channels);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_sample_spec *pa_sample_spec_init(pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -111,11 +118,13 @@ pa_sample_spec *pa_sample_spec_init(pa_sample_spec * spec)
|
|||
return spec;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_sample_format_valid(unsigned format)
|
||||
{
|
||||
return format < PA_SAMPLE_MAX;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_sample_rate_valid(uint32_t rate)
|
||||
{
|
||||
/* The extra 1% is due to module-loopback: it temporarily sets
|
||||
|
|
@ -124,11 +133,13 @@ int pa_sample_rate_valid(uint32_t rate)
|
|||
return rate > 0 && rate <= PA_RATE_MAX * 101 / 100;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_channels_valid(uint8_t channels)
|
||||
{
|
||||
return channels > 0 && channels <= PA_CHANNELS_MAX;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_sample_spec_valid(const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(spec);
|
||||
|
|
@ -141,6 +152,7 @@ int pa_sample_spec_valid(const pa_sample_spec * spec)
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_sample_spec_equal(const pa_sample_spec * a, const pa_sample_spec * b)
|
||||
{
|
||||
spa_assert(a);
|
||||
|
|
@ -158,6 +170,7 @@ int pa_sample_spec_equal(const pa_sample_spec * a, const pa_sample_spec * b)
|
|||
(a->rate == b->rate) && (a->channels == b->channels);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char *pa_sample_format_to_string(pa_sample_format_t f)
|
||||
{
|
||||
static const char *const table[] = {
|
||||
|
|
@ -182,6 +195,7 @@ const char *pa_sample_format_to_string(pa_sample_format_t f)
|
|||
return table[f];
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec * spec)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -200,6 +214,7 @@ char *pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec * spec)
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_bytes_snprint(char *s, size_t l, unsigned v)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -220,6 +235,7 @@ char *pa_bytes_snprint(char *s, size_t l, unsigned v)
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_sample_format_t pa_parse_sample_format(const char *format)
|
||||
{
|
||||
spa_assert(format);
|
||||
|
|
@ -284,6 +300,7 @@ pa_sample_format_t pa_parse_sample_format(const char *format)
|
|||
return PA_SAMPLE_INVALID;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_sample_format_is_le(pa_sample_format_t f)
|
||||
{
|
||||
spa_assert(pa_sample_format_valid(f));
|
||||
|
|
@ -308,6 +325,7 @@ int pa_sample_format_is_le(pa_sample_format_t f)
|
|||
}
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_sample_format_is_be(pa_sample_format_t f)
|
||||
{
|
||||
int r;
|
||||
|
|
|
|||
|
|
@ -23,24 +23,28 @@
|
|||
|
||||
#include "internal.h"
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_connect_upload(pa_stream *s, size_t length)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_finish_upload(pa_stream *s)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_remove_sample(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_play_sample(pa_context *c, const char *name, const char *dev,
|
||||
pa_volume_t volume, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
|
|
@ -48,6 +52,7 @@ pa_operation* pa_context_play_sample(pa_context *c, const char *name, const char
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_play_sample_with_proplist(pa_context *c, const char *name,
|
||||
const char *dev, pa_volume_t volume, pa_proplist *proplist,
|
||||
pa_context_play_sample_cb_t cb, void *userdata)
|
||||
|
|
|
|||
57
src/stream.c
57
src/stream.c
|
|
@ -495,7 +495,7 @@ static const struct pw_stream_events stream_events =
|
|||
.process = stream_process,
|
||||
};
|
||||
|
||||
pa_stream* stream_new(pa_context *c, const char *name,
|
||||
static pa_stream* stream_new(pa_context *c, const char *name,
|
||||
const pa_sample_spec *ss, const pa_channel_map *map,
|
||||
pa_format_info * const * formats, unsigned int n_formats,
|
||||
pa_proplist *p)
|
||||
|
|
@ -590,12 +590,14 @@ pa_stream* stream_new(pa_context *c, const char *name,
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_stream* pa_stream_new(pa_context *c, const char *name, const pa_sample_spec *ss,
|
||||
const pa_channel_map *map)
|
||||
{
|
||||
return stream_new(c, name, ss, map, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_stream* pa_stream_new_with_proplist(pa_context *c, const char *name,
|
||||
const pa_sample_spec *ss, const pa_channel_map *map, pa_proplist *p)
|
||||
{
|
||||
|
|
@ -607,6 +609,7 @@ pa_stream* pa_stream_new_with_proplist(pa_context *c, const char *name,
|
|||
return stream_new(c, name, ss, map, NULL, 0, p);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_stream *pa_stream_new_extended(pa_context *c, const char *name,
|
||||
pa_format_info * const * formats, unsigned int n_formats, pa_proplist *p)
|
||||
{
|
||||
|
|
@ -658,6 +661,7 @@ static void stream_free(pa_stream *s)
|
|||
free(s);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_unref(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -667,6 +671,7 @@ void pa_stream_unref(pa_stream *s)
|
|||
stream_free(s);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_stream *pa_stream_ref(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -676,6 +681,7 @@ pa_stream *pa_stream_ref(pa_stream *s)
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_stream_state_t pa_stream_get_state(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -683,6 +689,7 @@ pa_stream_state_t pa_stream_get_state(pa_stream *s)
|
|||
return s->state;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_context* pa_stream_get_context(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -690,6 +697,7 @@ pa_context* pa_stream_get_context(pa_stream *s)
|
|||
return s->context;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
uint32_t pa_stream_get_index(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -720,6 +728,7 @@ void pa_stream_set_state(pa_stream *s, pa_stream_state_t st) {
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
uint32_t pa_stream_get_device_index(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -736,6 +745,7 @@ uint32_t pa_stream_get_device_index(pa_stream *s)
|
|||
return s->device_index;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const char *pa_stream_get_device_name(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -748,6 +758,7 @@ const char *pa_stream_get_device_name(pa_stream *s)
|
|||
return s->device_name;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_is_suspended(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -759,6 +770,7 @@ int pa_stream_is_suspended(pa_stream *s)
|
|||
return s->suspended;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_is_corked(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -942,6 +954,7 @@ static int create_stream(pa_stream_direction_t direction,
|
|||
return res;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_connect_playback(
|
||||
pa_stream *s,
|
||||
const char *dev,
|
||||
|
|
@ -953,6 +966,7 @@ int pa_stream_connect_playback(
|
|||
return create_stream(PA_STREAM_PLAYBACK, s, dev, attr, flags, volume, sync_stream);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_connect_record(
|
||||
pa_stream *s,
|
||||
const char *dev,
|
||||
|
|
@ -967,6 +981,7 @@ static void on_disconnected(pa_operation *o, void *userdata)
|
|||
pa_stream_set_state(o->stream, PA_STREAM_TERMINATED);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_disconnect(pa_stream *s)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1036,6 +1051,7 @@ int queue_buffer(pa_stream *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_begin_write(
|
||||
pa_stream *s,
|
||||
void **data,
|
||||
|
|
@ -1066,6 +1082,7 @@ int pa_stream_begin_write(
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_cancel_write(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1081,6 +1098,7 @@ int pa_stream_cancel_write(pa_stream *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_write(pa_stream *s,
|
||||
const void *data,
|
||||
size_t nbytes,
|
||||
|
|
@ -1091,6 +1109,7 @@ int pa_stream_write(pa_stream *s,
|
|||
return pa_stream_write_ext_free(s, data, nbytes, free_cb, (void*) data, offset, seek);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_write_ext_free(pa_stream *s,
|
||||
const void *data,
|
||||
size_t nbytes,
|
||||
|
|
@ -1160,6 +1179,7 @@ int pa_stream_write_ext_free(pa_stream *s,
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_peek(pa_stream *s,
|
||||
const void **data,
|
||||
size_t *nbytes)
|
||||
|
|
@ -1185,6 +1205,7 @@ int pa_stream_peek(pa_stream *s,
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_drop(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1200,6 +1221,7 @@ int pa_stream_drop(pa_stream *s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_stream_writable_size(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1214,6 +1236,7 @@ size_t pa_stream_writable_size(pa_stream *s)
|
|||
return s->dequeued_size;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
size_t pa_stream_readable_size(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1241,6 +1264,7 @@ static void on_success(pa_operation *o, void *userdata)
|
|||
d->cb(s, 1, d->userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1276,6 +1300,7 @@ static void on_timing_success(pa_operation *o, void *userdata)
|
|||
d->cb(s, s->timing_info_valid, d->userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_update_timing_info(pa_stream *s, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1296,6 +1321,7 @@ pa_operation* pa_stream_update_timing_info(pa_stream *s, pa_stream_success_cb_t
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1308,6 +1334,7 @@ void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *
|
|||
s->state_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_write_callback(pa_stream *s, pa_stream_request_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1320,6 +1347,7 @@ void pa_stream_set_write_callback(pa_stream *s, pa_stream_request_cb_t cb, void
|
|||
s->write_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_read_callback(pa_stream *s, pa_stream_request_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1332,6 +1360,7 @@ void pa_stream_set_read_callback(pa_stream *s, pa_stream_request_cb_t cb, void *
|
|||
s->read_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_overflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1344,12 +1373,14 @@ void pa_stream_set_overflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, voi
|
|||
s->overflow_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int64_t pa_stream_get_underflow_index(pa_stream *s)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_underflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1362,6 +1393,7 @@ void pa_stream_set_underflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, vo
|
|||
s->underflow_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_started_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1374,6 +1406,7 @@ void pa_stream_set_started_callback(pa_stream *s, pa_stream_notify_cb_t cb, void
|
|||
s->started_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_latency_update_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1386,6 +1419,7 @@ void pa_stream_set_latency_update_callback(pa_stream *s, pa_stream_notify_cb_t c
|
|||
s->latency_update_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_moved_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1398,6 +1432,7 @@ void pa_stream_set_moved_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *
|
|||
s->moved_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_suspended_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1410,6 +1445,7 @@ void pa_stream_set_suspended_callback(pa_stream *s, pa_stream_notify_cb_t cb, vo
|
|||
s->suspended_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_event_callback(pa_stream *s, pa_stream_event_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1422,6 +1458,7 @@ void pa_stream_set_event_callback(pa_stream *s, pa_stream_event_cb_t cb, void *u
|
|||
s->event_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_stream_set_buffer_attr_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1434,6 +1471,7 @@ void pa_stream_set_buffer_attr_callback(pa_stream *s, pa_stream_notify_cb_t cb,
|
|||
s->buffer_attr_userdata = userdata;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1457,6 +1495,7 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1479,6 +1518,7 @@ pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *use
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1501,6 +1541,7 @@ pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1523,6 +1564,7 @@ pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *u
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1550,6 +1592,7 @@ pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_succe
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec)
|
||||
{
|
||||
pa_usec_t res;
|
||||
|
|
@ -1602,6 +1645,7 @@ static pa_usec_t time_counter_diff(const pa_stream *s, pa_usec_t a, pa_usec_t b,
|
|||
}
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative)
|
||||
{
|
||||
pa_usec_t t, c;
|
||||
|
|
@ -1635,6 +1679,7 @@ int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_timing_info* pa_stream_get_timing_info(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1651,6 +1696,7 @@ const pa_timing_info* pa_stream_get_timing_info(pa_stream *s)
|
|||
return &s->timing_info;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1658,6 +1704,7 @@ const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s)
|
|||
return &s->sample_spec;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_channel_map* pa_stream_get_channel_map(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1665,6 +1712,7 @@ const pa_channel_map* pa_stream_get_channel_map(pa_stream *s)
|
|||
return &s->channel_map;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_format_info* pa_stream_get_format_info(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1675,6 +1723,7 @@ const pa_format_info* pa_stream_get_format_info(pa_stream *s)
|
|||
return s->format;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1686,6 +1735,7 @@ const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s)
|
|||
return &s->buffer_attr;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1707,6 +1757,7 @@ pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1729,6 +1780,7 @@ pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_strea
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_stream_proplist_update(pa_stream *s, pa_update_mode_t mode, pa_proplist *p, pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1752,6 +1804,7 @@ pa_operation *pa_stream_proplist_update(pa_stream *s, pa_update_mode_t mode, pa_
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], pa_stream_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -1773,6 +1826,7 @@ pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[],
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
@ -1787,6 +1841,7 @@ int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
uint32_t pa_stream_get_monitor_stream(pa_stream *s)
|
||||
{
|
||||
spa_assert(s);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ static void on_subscribed(pa_operation *o, void *userdata)
|
|||
d->cb(o->context, PA_OK, d->userdata);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_operation *o;
|
||||
|
|
@ -54,6 +55,7 @@ pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_c
|
|||
return o;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_context_set_subscribe_callback(pa_context *c, pa_context_subscribe_cb_t cb, void *userdata)
|
||||
{
|
||||
pa_assert(c);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ struct pa_threaded_mainloop
|
|||
struct pw_thread_loop *tloop;
|
||||
};
|
||||
|
||||
SPA_EXPORT
|
||||
pa_threaded_mainloop *pa_threaded_mainloop_new(void)
|
||||
{
|
||||
pa_threaded_mainloop *m;
|
||||
|
|
@ -56,6 +57,7 @@ pa_threaded_mainloop *pa_threaded_mainloop_new(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_free(pa_threaded_mainloop* m)
|
||||
{
|
||||
pw_thread_loop_destroy(m->tloop);
|
||||
|
|
@ -63,56 +65,67 @@ void pa_threaded_mainloop_free(pa_threaded_mainloop* m)
|
|||
free(m);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_threaded_mainloop_start(pa_threaded_mainloop *m)
|
||||
{
|
||||
return pw_thread_loop_start(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_stop(pa_threaded_mainloop *m)
|
||||
{
|
||||
pw_thread_loop_stop(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_lock(pa_threaded_mainloop *m)
|
||||
{
|
||||
pw_thread_loop_lock(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_unlock(pa_threaded_mainloop *m)
|
||||
{
|
||||
pw_thread_loop_unlock(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_wait(pa_threaded_mainloop *m)
|
||||
{
|
||||
pw_thread_loop_wait(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_signal(pa_threaded_mainloop *m, int wait_for_accept)
|
||||
{
|
||||
pw_thread_loop_signal(m->tloop, wait_for_accept);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_accept(pa_threaded_mainloop *m)
|
||||
{
|
||||
pw_thread_loop_accept(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_threaded_mainloop_get_retval(pa_threaded_mainloop *m)
|
||||
{
|
||||
return pa_mainloop_get_retval(m->loop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_mainloop_api* pa_threaded_mainloop_get_api(pa_threaded_mainloop*m)
|
||||
{
|
||||
return pa_mainloop_get_api(m->loop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_threaded_mainloop_in_thread(pa_threaded_mainloop *m)
|
||||
{
|
||||
return pw_thread_loop_in_thread(m->tloop);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_threaded_mainloop_set_name(pa_threaded_mainloop *m, const char *name)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#define HAVE_GETTIMEOFDAY
|
||||
|
||||
SPA_EXPORT
|
||||
struct timeval *pa_gettimeofday(struct timeval *tv) {
|
||||
pa_assert(tv);
|
||||
|
||||
|
|
@ -71,6 +72,7 @@ struct timeval *pa_gettimeofday(struct timeval *tv) {
|
|||
return tv;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
|
||||
pa_usec_t r;
|
||||
|
||||
|
|
@ -97,6 +99,7 @@ pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
|
|||
return r;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_timeval_cmp(const struct timeval *a, const struct timeval *b) {
|
||||
pa_assert(a);
|
||||
pa_assert(b);
|
||||
|
|
@ -116,6 +119,7 @@ int pa_timeval_cmp(const struct timeval *a, const struct timeval *b) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_usec_t pa_timeval_age(const struct timeval *tv) {
|
||||
struct timeval now;
|
||||
pa_assert(tv);
|
||||
|
|
@ -123,6 +127,7 @@ pa_usec_t pa_timeval_age(const struct timeval *tv) {
|
|||
return pa_timeval_diff(pa_gettimeofday(&now), tv);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
struct timeval* pa_timeval_add(struct timeval *tv, pa_usec_t v) {
|
||||
time_t secs;
|
||||
pa_assert(tv);
|
||||
|
|
@ -154,6 +159,7 @@ overflow:
|
|||
return tv;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
struct timeval* pa_timeval_sub(struct timeval *tv, pa_usec_t v) {
|
||||
time_t secs;
|
||||
pa_assert(tv);
|
||||
|
|
@ -185,6 +191,7 @@ underflow:
|
|||
return tv;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
struct timeval* pa_timeval_store(struct timeval *tv, pa_usec_t v) {
|
||||
pa_assert(tv);
|
||||
|
||||
|
|
@ -201,6 +208,7 @@ struct timeval* pa_timeval_store(struct timeval *tv, pa_usec_t v) {
|
|||
return tv;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_usec_t pa_timeval_load(const struct timeval *tv) {
|
||||
|
||||
if (PA_UNLIKELY(!tv))
|
||||
|
|
|
|||
|
|
@ -172,10 +172,12 @@ failure:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_utf8_valid (const char *str) {
|
||||
return utf8_validate(str, NULL);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_utf8_filter (const char *str) {
|
||||
char *new_str;
|
||||
|
||||
|
|
@ -233,22 +235,26 @@ static char* iconv_simple(const char *str, const char *to, const char *from) {
|
|||
return new_str;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_utf8_to_locale (const char *str) {
|
||||
return iconv_simple(str, "", "UTF-8");
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_locale_to_utf8 (const char *str) {
|
||||
return iconv_simple(str, "UTF-8", "");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_utf8_to_locale (const char *str) {
|
||||
pa_assert(str);
|
||||
|
||||
return pa_ascii_filter(str);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char* pa_locale_to_utf8 (const char *str) {
|
||||
pa_assert(str);
|
||||
|
||||
|
|
@ -260,6 +266,7 @@ char* pa_locale_to_utf8 (const char *str) {
|
|||
|
||||
#endif
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_ascii_valid(const char *str) {
|
||||
const char *p;
|
||||
pa_assert(str);
|
||||
|
|
@ -271,6 +278,7 @@ char *pa_ascii_valid(const char *str) {
|
|||
return (char*) str;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_ascii_filter(const char *str) {
|
||||
char *r, *s, *d;
|
||||
pa_assert(str);
|
||||
|
|
|
|||
|
|
@ -26,33 +26,39 @@
|
|||
|
||||
#define PA_PATH_SEP_CHAR '/'
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_get_user_name(char *s, size_t l)
|
||||
{
|
||||
return strncpy(s, pw_get_user_name(), l);
|
||||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_get_host_name(char *s, size_t l)
|
||||
{
|
||||
return strncpy(s, pw_get_host_name(), l);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_get_fqdn(char *s, size_t l)
|
||||
{
|
||||
return strncpy(s, pw_get_host_name(), l);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_get_home_dir(char *s, size_t l)
|
||||
{
|
||||
pw_log_warn("Not Implemented");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_get_binary_name(char *s, size_t l)
|
||||
{
|
||||
return strncpy(s, pw_get_prgname(), l);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_path_get_filename(const char *p)
|
||||
{
|
||||
char *fn;
|
||||
|
|
@ -66,6 +72,7 @@ char *pa_path_get_filename(const char *p)
|
|||
return (char*) p;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_msleep(unsigned long t)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,11 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <spa/utils/defs.h>
|
||||
|
||||
#include <pulse/version.h>
|
||||
|
||||
SPA_EXPORT
|
||||
const char* pa_get_library_version(void)
|
||||
{
|
||||
return pa_get_headers_version();
|
||||
|
|
|
|||
44
src/volume.c
44
src/volume.c
|
|
@ -30,6 +30,7 @@
|
|||
#include "internal.h"
|
||||
#include "sample-util.h"
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) {
|
||||
int i;
|
||||
pa_assert(a);
|
||||
|
|
@ -52,6 +53,7 @@ int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_init(pa_cvolume *a) {
|
||||
unsigned c;
|
||||
|
||||
|
|
@ -65,6 +67,7 @@ pa_cvolume* pa_cvolume_init(pa_cvolume *a) {
|
|||
return a;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_set(pa_cvolume *a, unsigned channels, pa_volume_t v) {
|
||||
int i;
|
||||
|
||||
|
|
@ -81,6 +84,7 @@ pa_cvolume* pa_cvolume_set(pa_cvolume *a, unsigned channels, pa_volume_t v) {
|
|||
return a;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_avg(const pa_cvolume *a) {
|
||||
uint64_t sum = 0;
|
||||
unsigned c;
|
||||
|
|
@ -96,6 +100,7 @@ pa_volume_t pa_cvolume_avg(const pa_cvolume *a) {
|
|||
return (pa_volume_t) sum;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_avg_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) {
|
||||
uint64_t sum = 0;
|
||||
unsigned c, n;
|
||||
|
|
@ -122,6 +127,7 @@ pa_volume_t pa_cvolume_avg_mask(const pa_cvolume *a, const pa_channel_map *cm, p
|
|||
return (pa_volume_t) sum;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_max(const pa_cvolume *a) {
|
||||
pa_volume_t m = PA_VOLUME_MUTED;
|
||||
unsigned c;
|
||||
|
|
@ -136,6 +142,7 @@ pa_volume_t pa_cvolume_max(const pa_cvolume *a) {
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_min(const pa_cvolume *a) {
|
||||
pa_volume_t m = PA_VOLUME_MAX;
|
||||
unsigned c;
|
||||
|
|
@ -150,6 +157,7 @@ pa_volume_t pa_cvolume_min(const pa_cvolume *a) {
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_max_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) {
|
||||
pa_volume_t m = PA_VOLUME_MUTED;
|
||||
unsigned c;
|
||||
|
|
@ -173,6 +181,7 @@ pa_volume_t pa_cvolume_max_mask(const pa_cvolume *a, const pa_channel_map *cm, p
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_min_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) {
|
||||
pa_volume_t m = PA_VOLUME_MAX;
|
||||
unsigned c;
|
||||
|
|
@ -196,6 +205,7 @@ pa_volume_t pa_cvolume_min_mask(const pa_cvolume *a, const pa_channel_map *cm, p
|
|||
return m;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_sw_volume_multiply(pa_volume_t a, pa_volume_t b) {
|
||||
uint64_t result;
|
||||
|
||||
|
|
@ -212,6 +222,7 @@ pa_volume_t pa_sw_volume_multiply(pa_volume_t a, pa_volume_t b) {
|
|||
return (pa_volume_t) PA_CLAMP_VOLUME(result);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_sw_volume_divide(pa_volume_t a, pa_volume_t b) {
|
||||
uint64_t result;
|
||||
|
||||
|
|
@ -238,6 +249,7 @@ static double dB_to_linear(double v) {
|
|||
return pow(10.0, v / 20.0);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_sw_volume_from_dB(double dB) {
|
||||
if (isinf(dB) < 0 || dB <= PA_DECIBEL_MININFTY)
|
||||
return PA_VOLUME_MUTED;
|
||||
|
|
@ -245,6 +257,7 @@ pa_volume_t pa_sw_volume_from_dB(double dB) {
|
|||
return pa_sw_volume_from_linear(dB_to_linear(dB));
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
double pa_sw_volume_to_dB(pa_volume_t v) {
|
||||
|
||||
pa_return_val_if_fail(PA_VOLUME_IS_VALID(v), PA_DECIBEL_MININFTY);
|
||||
|
|
@ -255,6 +268,7 @@ double pa_sw_volume_to_dB(pa_volume_t v) {
|
|||
return linear_to_dB(pa_sw_volume_to_linear(v));
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_sw_volume_from_linear(double v) {
|
||||
|
||||
if (v <= 0.0)
|
||||
|
|
@ -273,6 +287,7 @@ pa_volume_t pa_sw_volume_from_linear(double v) {
|
|||
return (pa_volume_t) PA_CLAMP_VOLUME((uint64_t) lround(cbrt(v) * PA_VOLUME_NORM));
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
double pa_sw_volume_to_linear(pa_volume_t v) {
|
||||
double f;
|
||||
|
||||
|
|
@ -289,6 +304,7 @@ double pa_sw_volume_to_linear(pa_volume_t v) {
|
|||
return f*f*f;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
|
||||
unsigned channel;
|
||||
bool first = true;
|
||||
|
|
@ -320,6 +336,7 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_volume_snprint(char *s, size_t l, pa_volume_t v) {
|
||||
pa_assert(s);
|
||||
pa_assert(l > 0);
|
||||
|
|
@ -335,6 +352,7 @@ char *pa_volume_snprint(char *s, size_t l, pa_volume_t v) {
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c) {
|
||||
unsigned channel;
|
||||
bool first = true;
|
||||
|
|
@ -368,6 +386,7 @@ char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c) {
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_cvolume_snprint_verbose(char *s, size_t l, const pa_cvolume *c, const pa_channel_map *map, int print_dB) {
|
||||
char *current = s;
|
||||
bool first = true;
|
||||
|
|
@ -410,6 +429,7 @@ char *pa_cvolume_snprint_verbose(char *s, size_t l, const pa_cvolume *c, const p
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_sw_volume_snprint_dB(char *s, size_t l, pa_volume_t v) {
|
||||
double f;
|
||||
|
||||
|
|
@ -429,6 +449,7 @@ char *pa_sw_volume_snprint_dB(char *s, size_t l, pa_volume_t v) {
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_volume_snprint_verbose(char *s, size_t l, pa_volume_t v, int print_dB) {
|
||||
char dB[PA_SW_VOLUME_SNPRINT_DB_MAX];
|
||||
|
||||
|
|
@ -451,6 +472,7 @@ char *pa_volume_snprint_verbose(char *s, size_t l, pa_volume_t v, int print_dB)
|
|||
return s;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) {
|
||||
unsigned c;
|
||||
pa_assert(a);
|
||||
|
|
@ -465,6 +487,7 @@ int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume *pa_sw_cvolume_multiply(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b) {
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -483,6 +506,7 @@ pa_cvolume *pa_sw_cvolume_multiply(pa_cvolume *dest, const pa_cvolume *a, const
|
|||
return dest;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume *pa_sw_cvolume_multiply_scalar(pa_cvolume *dest, const pa_cvolume *a, pa_volume_t b) {
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -500,6 +524,7 @@ pa_cvolume *pa_sw_cvolume_multiply_scalar(pa_cvolume *dest, const pa_cvolume *a,
|
|||
return dest;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume *pa_sw_cvolume_divide(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b) {
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -518,6 +543,7 @@ pa_cvolume *pa_sw_cvolume_divide(pa_cvolume *dest, const pa_cvolume *a, const pa
|
|||
return dest;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume *pa_sw_cvolume_divide_scalar(pa_cvolume *dest, const pa_cvolume *a, pa_volume_t b) {
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -535,6 +561,7 @@ pa_cvolume *pa_sw_cvolume_divide_scalar(pa_cvolume *dest, const pa_cvolume *a, p
|
|||
return dest;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_cvolume_valid(const pa_cvolume *v) {
|
||||
unsigned c;
|
||||
|
||||
|
|
@ -578,6 +605,7 @@ static bool on_rear(pa_channel_position_t p) {
|
|||
return !!(PA_CHANNEL_POSITION_MASK(p) & PA_CHANNEL_POSITION_MASK_REAR);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume *pa_cvolume_remap(pa_cvolume *v, const pa_channel_map *from, const pa_channel_map *to) {
|
||||
int a, b;
|
||||
pa_cvolume result;
|
||||
|
|
@ -628,6 +656,7 @@ pa_cvolume *pa_cvolume_remap(pa_cvolume *v, const pa_channel_map *from, const pa
|
|||
return v;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) {
|
||||
|
||||
pa_assert(v);
|
||||
|
|
@ -639,6 +668,7 @@ int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) {
|
|||
return v->channels == ss->channels;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
int pa_cvolume_compatible_with_channel_map(const pa_cvolume *v, const pa_channel_map *cm) {
|
||||
pa_assert(v);
|
||||
pa_assert(cm);
|
||||
|
|
@ -686,6 +716,7 @@ static void get_avg(const pa_channel_map *map, const pa_cvolume *v, pa_volume_t
|
|||
*r = right / n_right;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
float pa_cvolume_get_balance(const pa_cvolume *v, const pa_channel_map *map) {
|
||||
pa_volume_t left, right;
|
||||
|
||||
|
|
@ -753,6 +784,7 @@ static pa_cvolume* set_balance(pa_cvolume *v, const pa_channel_map *map, float n
|
|||
}
|
||||
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_set_balance(pa_cvolume *v, const pa_channel_map *map, float new_balance) {
|
||||
pa_assert(map);
|
||||
pa_assert(v);
|
||||
|
|
@ -767,6 +799,7 @@ pa_cvolume* pa_cvolume_set_balance(pa_cvolume *v, const pa_channel_map *map, flo
|
|||
return set_balance(v, map, new_balance, on_left, on_right);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_scale(pa_cvolume *v, pa_volume_t max) {
|
||||
unsigned c;
|
||||
pa_volume_t t = 0;
|
||||
|
|
@ -787,6 +820,7 @@ pa_cvolume* pa_cvolume_scale(pa_cvolume *v, pa_volume_t max) {
|
|||
return v;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
#if PA_CHECK_VERSION(12, 0, 0)
|
||||
pa_cvolume* pa_cvolume_scale_mask(pa_cvolume *v, pa_volume_t max, const pa_channel_map *cm, pa_channel_position_mask_t mask) {
|
||||
#else
|
||||
|
|
@ -815,6 +849,7 @@ pa_cvolume* pa_cvolume_scale_mask(pa_cvolume *v, pa_volume_t max, pa_channel_map
|
|||
return v;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
float pa_cvolume_get_fade(const pa_cvolume *v, const pa_channel_map *map) {
|
||||
pa_volume_t rear, front;
|
||||
|
||||
|
|
@ -837,6 +872,7 @@ float pa_cvolume_get_fade(const pa_cvolume *v, const pa_channel_map *map) {
|
|||
return 1.0f - ((float) rear / (float) front);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_set_fade(pa_cvolume *v, const pa_channel_map *map, float new_fade) {
|
||||
pa_assert(map);
|
||||
pa_assert(v);
|
||||
|
|
@ -851,6 +887,7 @@ pa_cvolume* pa_cvolume_set_fade(pa_cvolume *v, const pa_channel_map *map, float
|
|||
return set_balance(v, map, new_fade, on_rear, on_front);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
float pa_cvolume_get_lfe_balance(const pa_cvolume *v, const pa_channel_map *map) {
|
||||
pa_volume_t hfe, lfe;
|
||||
|
||||
|
|
@ -873,6 +910,7 @@ float pa_cvolume_get_lfe_balance(const pa_cvolume *v, const pa_channel_map *map)
|
|||
return 1.0f - ((float) hfe / (float) lfe);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_set_lfe_balance(pa_cvolume *v, const pa_channel_map *map, float new_balance) {
|
||||
pa_assert(map);
|
||||
pa_assert(v);
|
||||
|
|
@ -887,6 +925,7 @@ pa_cvolume* pa_cvolume_set_lfe_balance(pa_cvolume *v, const pa_channel_map *map,
|
|||
return set_balance(v, map, new_balance, on_hfe, on_lfe);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_set_position(
|
||||
pa_cvolume *cv,
|
||||
const pa_channel_map *map,
|
||||
|
|
@ -912,6 +951,7 @@ pa_cvolume* pa_cvolume_set_position(
|
|||
return good ? cv : NULL;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_volume_t pa_cvolume_get_position(
|
||||
pa_cvolume *cv,
|
||||
const pa_channel_map *map,
|
||||
|
|
@ -934,6 +974,7 @@ pa_volume_t pa_cvolume_get_position(
|
|||
return v;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_merge(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b) {
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -952,6 +993,7 @@ pa_cvolume* pa_cvolume_merge(pa_cvolume *dest, const pa_cvolume *a, const pa_cvo
|
|||
return dest;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_inc_clamp(pa_cvolume *v, pa_volume_t inc, pa_volume_t limit) {
|
||||
pa_volume_t m;
|
||||
|
||||
|
|
@ -970,10 +1012,12 @@ pa_cvolume* pa_cvolume_inc_clamp(pa_cvolume *v, pa_volume_t inc, pa_volume_t lim
|
|||
return pa_cvolume_scale(v, m);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc) {
|
||||
return pa_cvolume_inc_clamp(v, inc, PA_VOLUME_MAX);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec) {
|
||||
pa_volume_t m;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ static void oom(void) {
|
|||
_exit(1);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void* pa_xmalloc(size_t l)
|
||||
{
|
||||
void *p;
|
||||
|
|
@ -47,6 +48,7 @@ void* pa_xmalloc(size_t l)
|
|||
return p;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void *pa_xmalloc0(size_t l)
|
||||
{
|
||||
void *p;
|
||||
|
|
@ -59,6 +61,7 @@ void *pa_xmalloc0(size_t l)
|
|||
return p;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void *pa_xrealloc(void *ptr, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
|
@ -70,6 +73,7 @@ void *pa_xrealloc(void *ptr, size_t size)
|
|||
return p;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void pa_xfree(void *p)
|
||||
{
|
||||
int saved_errno;
|
||||
|
|
@ -80,6 +84,7 @@ void pa_xfree(void *p)
|
|||
errno = saved_errno;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_xstrdup(const char *s)
|
||||
{
|
||||
if (!s)
|
||||
|
|
@ -87,6 +92,7 @@ char *pa_xstrdup(const char *s)
|
|||
return pa_xmemdup(s, strlen(s)+1);
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
char *pa_xstrndup(const char *s, size_t l)
|
||||
{
|
||||
char *e, *r;
|
||||
|
|
@ -103,6 +109,7 @@ char *pa_xstrndup(const char *s, size_t l)
|
|||
return r;
|
||||
}
|
||||
|
||||
SPA_EXPORT
|
||||
void* pa_xmemdup(const void *p, size_t l)
|
||||
{
|
||||
if (!p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue