mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-15 06:59:58 -05:00
More s/assert/pa_assert/ modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1804 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
391d09cd6e
commit
038e560152
4 changed files with 271 additions and 245 deletions
|
|
@ -26,11 +26,10 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include <pulse/context.h>
|
#include <pulse/context.h>
|
||||||
|
|
||||||
#include <pulsecore/gccmacro.h>
|
#include <pulsecore/gccmacro.h>
|
||||||
|
#include <pulsecore/macro.h>
|
||||||
#include <pulsecore/pstream-util.h>
|
#include <pulsecore/pstream-util.h>
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
@ -43,9 +42,9 @@ static void context_stat_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNU
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
pa_stat_info i, *p = &i;
|
pa_stat_info i, *p = &i;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
memset(&i, 0, sizeof(i));
|
memset(&i, 0, sizeof(i));
|
||||||
|
|
||||||
|
|
@ -86,9 +85,9 @@ static void context_get_server_info_callback(pa_pdispatch *pd, uint32_t command,
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
pa_server_info i, *p = &i;
|
pa_server_info i, *p = &i;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
memset(&i, 0, sizeof(i));
|
memset(&i, 0, sizeof(i));
|
||||||
|
|
||||||
|
|
@ -133,9 +132,9 @@ static void context_get_sink_info_callback(pa_pdispatch *pd, uint32_t command, P
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -198,9 +197,9 @@ pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t idx, pa_
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -220,9 +219,9 @@ pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name,
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
||||||
|
|
@ -244,9 +243,9 @@ static void context_get_source_info_callback(pa_pdispatch *pd, uint32_t command,
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -309,9 +308,9 @@ pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t idx, p
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -331,9 +330,9 @@ pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
||||||
|
|
@ -355,9 +354,9 @@ static void context_get_client_info_callback(pa_pdispatch *pd, uint32_t command,
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -403,9 +402,9 @@ pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -430,9 +429,9 @@ static void context_get_module_info_callback(pa_pdispatch *pd, uint32_t command,
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -479,9 +478,9 @@ pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -506,9 +505,9 @@ static void context_get_sink_input_info_callback(pa_pdispatch *pd, uint32_t comm
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -564,9 +563,9 @@ pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sin
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -591,9 +590,9 @@ static void context_get_source_output_info_callback(pa_pdispatch *pd, uint32_t c
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -648,9 +647,9 @@ pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -676,9 +675,9 @@ pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, c
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(volume);
|
pa_assert(volume);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
||||||
|
|
@ -700,10 +699,10 @@ pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(name);
|
pa_assert(name);
|
||||||
assert(volume);
|
pa_assert(volume);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
||||||
|
|
@ -726,8 +725,8 @@ pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -748,9 +747,9 @@ pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name,
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(name);
|
pa_assert(name);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
||||||
|
|
@ -772,9 +771,9 @@ pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, cons
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(volume);
|
pa_assert(volume);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -796,8 +795,8 @@ pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mu
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -819,9 +818,9 @@ pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx,
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(volume);
|
pa_assert(volume);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
||||||
|
|
@ -843,10 +842,10 @@ pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *na
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(name);
|
pa_assert(name);
|
||||||
assert(volume);
|
pa_assert(volume);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
|
||||||
|
|
@ -869,8 +868,8 @@ pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, i
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -891,9 +890,9 @@ pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(name);
|
pa_assert(name);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
|
||||||
|
|
@ -916,9 +915,9 @@ static void context_get_sample_info_callback(pa_pdispatch *pd, uint32_t command,
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -971,9 +970,9 @@ pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
@ -994,9 +993,9 @@ pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, p
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -1021,8 +1020,8 @@ static pa_operation* command_kill(pa_context *c, uint32_t command, uint32_t idx,
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -1053,9 +1052,9 @@ static void context_index_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UN
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
uint32_t idx;
|
uint32_t idx;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -1087,8 +1086,8 @@ pa_operation* pa_context_load_module(pa_context *c, const char*name, const char
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
@ -1114,9 +1113,9 @@ static void context_get_autoload_info_callback(pa_pdispatch *pd, uint32_t comman
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int eol = 1;
|
int eol = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -1164,9 +1163,9 @@ pa_operation* pa_context_get_autoload_info_by_name(pa_context *c, const char *na
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
@ -1188,9 +1187,9 @@ pa_operation* pa_context_get_autoload_info_by_index(pa_context *c, uint32_t idx,
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
assert(cb);
|
pa_assert(cb);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -1214,8 +1213,8 @@ pa_operation* pa_context_add_autoload(pa_context *c, const char *name, pa_autolo
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
@ -1240,8 +1239,8 @@ pa_operation* pa_context_remove_autoload_by_name(pa_context *c, const char *name
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
@ -1263,8 +1262,8 @@ pa_operation* pa_context_remove_autoload_by_index(pa_context *c, uint32_t idx, p
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
|
||||||
|
|
@ -1284,8 +1283,8 @@ pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, ch
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1309,8 +1308,8 @@ pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, u
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1334,8 +1333,8 @@ pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx,
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1359,8 +1358,8 @@ pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1384,8 +1383,8 @@ pa_operation* pa_context_suspend_sink_by_name(pa_context *c, char *sink_name, in
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1408,8 +1407,8 @@ pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1431,8 +1430,8 @@ pa_operation* pa_context_suspend_source_by_name(pa_context *c, char *source_name
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
@ -1455,8 +1454,8 @@ pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, in
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,12 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <pulsecore/pstream-util.h>
|
#include <pulsecore/pstream-util.h>
|
||||||
|
#include <pulsecore/macro.h>
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
|
@ -40,7 +40,8 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) {
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, length > 0, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY(s->context, length > 0, PA_ERR_INVALID);
|
||||||
|
|
@ -66,7 +67,9 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) {
|
||||||
int pa_stream_finish_upload(pa_stream *s) {
|
int pa_stream_finish_upload(pa_stream *s) {
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
assert(s);
|
|
||||||
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->channel_valid, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->channel_valid, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->context->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->context->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
@ -87,8 +90,8 @@ pa_operation *pa_context_play_sample(pa_context *c, const char *name, const char
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
@ -115,8 +118,8 @@ pa_operation* pa_context_remove_sample(pa_context *c, const char *name, pa_conte
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -48,7 +47,8 @@ pa_stream *pa_stream_new(pa_context *c, const char *name, const pa_sample_spec *
|
||||||
pa_stream *s;
|
pa_stream *s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID);
|
||||||
|
|
@ -120,10 +120,12 @@ pa_stream *pa_stream_new(pa_context *c, const char *name, const pa_sample_spec *
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stream_free(pa_stream *s) {
|
static void stream_free(pa_stream *s) {
|
||||||
assert(s && !s->context && !s->channel_valid);
|
pa_assert(s);
|
||||||
|
pa_assert(!s->context);
|
||||||
|
pa_assert(!s->channel_valid);
|
||||||
|
|
||||||
if (s->auto_timing_update_event) {
|
if (s->auto_timing_update_event) {
|
||||||
assert(s->mainloop);
|
pa_assert(s->mainloop);
|
||||||
s->mainloop->time_free(s->auto_timing_update_event);
|
s->mainloop->time_free(s->auto_timing_update_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,38 +143,38 @@ static void stream_free(pa_stream *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_unref(pa_stream *s) {
|
void pa_stream_unref(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
if (PA_REFCNT_DEC(s) <= 0)
|
if (PA_REFCNT_DEC(s) <= 0)
|
||||||
stream_free(s);
|
stream_free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_stream* pa_stream_ref(pa_stream *s) {
|
pa_stream* pa_stream_ref(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_REFCNT_INC(s);
|
PA_REFCNT_INC(s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_stream_state_t pa_stream_get_state(pa_stream *s) {
|
pa_stream_state_t pa_stream_get_state(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
return s->state;
|
return s->state;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_context* pa_stream_get_context(pa_stream *s) {
|
pa_context* pa_stream_get_context(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
return s->context;
|
return s->context;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t pa_stream_get_index(pa_stream *s) {
|
uint32_t pa_stream_get_index(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, PA_INVALID_INDEX);
|
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, PA_INVALID_INDEX);
|
||||||
|
|
||||||
|
|
@ -180,8 +182,8 @@ uint32_t pa_stream_get_index(pa_stream *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_state(pa_stream *s, pa_stream_state_t st) {
|
void pa_stream_set_state(pa_stream *s, pa_stream_state_t st) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
if (s->state == st)
|
if (s->state == st)
|
||||||
return;
|
return;
|
||||||
|
|
@ -236,10 +238,11 @@ void pa_command_stream_killed(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED
|
||||||
pa_stream *s;
|
pa_stream *s;
|
||||||
uint32_t channel;
|
uint32_t channel;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(command == PA_COMMAND_PLAYBACK_STREAM_KILLED || command == PA_COMMAND_RECORD_STREAM_KILLED);
|
pa_assert(command == PA_COMMAND_PLAYBACK_STREAM_KILLED || command == PA_COMMAND_RECORD_STREAM_KILLED);
|
||||||
assert(t);
|
pa_assert(t);
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
pa_context_ref(c);
|
pa_context_ref(c);
|
||||||
|
|
||||||
|
|
@ -264,10 +267,11 @@ void pa_command_request(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32
|
||||||
pa_context *c = userdata;
|
pa_context *c = userdata;
|
||||||
uint32_t bytes, channel;
|
uint32_t bytes, channel;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(command == PA_COMMAND_REQUEST);
|
pa_assert(command == PA_COMMAND_REQUEST);
|
||||||
assert(t);
|
pa_assert(t);
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
pa_context_ref(c);
|
pa_context_ref(c);
|
||||||
|
|
||||||
|
|
@ -297,10 +301,11 @@ void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, PA_GCC
|
||||||
pa_context *c = userdata;
|
pa_context *c = userdata;
|
||||||
uint32_t channel;
|
uint32_t channel;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(command == PA_COMMAND_OVERFLOW || command == PA_COMMAND_UNDERFLOW);
|
pa_assert(command == PA_COMMAND_OVERFLOW || command == PA_COMMAND_UNDERFLOW);
|
||||||
assert(t);
|
pa_assert(t);
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
pa_context_ref(c);
|
pa_context_ref(c);
|
||||||
|
|
||||||
|
|
@ -329,7 +334,8 @@ void pa_command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, PA_GCC
|
||||||
}
|
}
|
||||||
|
|
||||||
static void request_auto_timing_update(pa_stream *s, int force) {
|
static void request_auto_timing_update(pa_stream *s, int force) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
if (!(s->flags & PA_STREAM_AUTO_TIMING_UPDATE))
|
if (!(s->flags & PA_STREAM_AUTO_TIMING_UPDATE))
|
||||||
return;
|
return;
|
||||||
|
|
@ -355,7 +361,8 @@ static void request_auto_timing_update(pa_stream *s, int force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void invalidate_indexes(pa_stream *s, int r, int w) {
|
static void invalidate_indexes(pa_stream *s, int r, int w) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
/* pa_log("invalidate r:%u w:%u tag:%u", r, w, s->context->ctag); */
|
/* pa_log("invalidate r:%u w:%u tag:%u", r, w, s->context->ctag); */
|
||||||
|
|
||||||
|
|
@ -390,6 +397,9 @@ static void invalidate_indexes(pa_stream *s, int r, int w) {
|
||||||
static void auto_timing_update_callback(PA_GCC_UNUSED pa_mainloop_api *m, PA_GCC_UNUSED pa_time_event *e, PA_GCC_UNUSED const struct timeval *tv, void *userdata) {
|
static void auto_timing_update_callback(PA_GCC_UNUSED pa_mainloop_api *m, PA_GCC_UNUSED pa_time_event *e, PA_GCC_UNUSED const struct timeval *tv, void *userdata) {
|
||||||
pa_stream *s = userdata;
|
pa_stream *s = userdata;
|
||||||
|
|
||||||
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
/* pa_log("time event"); */
|
/* pa_log("time event"); */
|
||||||
|
|
||||||
pa_stream_ref(s);
|
pa_stream_ref(s);
|
||||||
|
|
@ -399,6 +409,7 @@ static void auto_timing_update_callback(PA_GCC_UNUSED pa_mainloop_api *m, PA_GCC
|
||||||
|
|
||||||
static void create_stream_complete(pa_stream *s) {
|
static void create_stream_complete(pa_stream *s) {
|
||||||
pa_assert(s);
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
pa_assert(s->state == PA_STREAM_CREATING);
|
pa_assert(s->state == PA_STREAM_CREATING);
|
||||||
|
|
||||||
pa_stream_set_state(s, PA_STREAM_READY);
|
pa_stream_set_state(s, PA_STREAM_READY);
|
||||||
|
|
@ -410,7 +421,7 @@ static void create_stream_complete(pa_stream *s) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
pa_gettimeofday(&tv);
|
pa_gettimeofday(&tv);
|
||||||
tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
|
tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
|
||||||
assert(!s->auto_timing_update_event);
|
pa_assert(!s->auto_timing_update_event);
|
||||||
s->auto_timing_update_event = s->mainloop->time_new(s->mainloop, &tv, &auto_timing_update_callback, s);
|
s->auto_timing_update_event = s->mainloop->time_new(s->mainloop, &tv, &auto_timing_update_callback, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -418,9 +429,10 @@ static void create_stream_complete(pa_stream *s) {
|
||||||
void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32_t tag, pa_tagstruct *t, void *userdata) {
|
void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32_t tag, pa_tagstruct *t, void *userdata) {
|
||||||
pa_stream *s = userdata;
|
pa_stream *s = userdata;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(s->state == PA_STREAM_CREATING);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
pa_assert(s->state == PA_STREAM_CREATING);
|
||||||
|
|
||||||
pa_stream_ref(s);
|
pa_stream_ref(s);
|
||||||
|
|
||||||
|
|
@ -463,7 +475,7 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->direction == PA_STREAM_RECORD) {
|
if (s->direction == PA_STREAM_RECORD) {
|
||||||
assert(!s->record_memblockq);
|
pa_assert(!s->record_memblockq);
|
||||||
|
|
||||||
s->record_memblockq = pa_memblockq_new(
|
s->record_memblockq = pa_memblockq_new(
|
||||||
0,
|
0,
|
||||||
|
|
@ -505,8 +517,8 @@ static int create_stream(
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, !(flags & ~((direction != PA_STREAM_UPLOAD ?
|
PA_CHECK_VALIDITY(s->context, !(flags & ~((direction != PA_STREAM_UPLOAD ?
|
||||||
|
|
@ -590,8 +602,8 @@ int pa_stream_connect_playback(
|
||||||
pa_cvolume *volume,
|
pa_cvolume *volume,
|
||||||
pa_stream *sync_stream) {
|
pa_stream *sync_stream) {
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
return create_stream(PA_STREAM_PLAYBACK, s, dev, attr, flags, volume, sync_stream);
|
return create_stream(PA_STREAM_PLAYBACK, s, dev, attr, flags, volume, sync_stream);
|
||||||
}
|
}
|
||||||
|
|
@ -602,8 +614,8 @@ int pa_stream_connect_record(
|
||||||
const pa_buffer_attr *attr,
|
const pa_buffer_attr *attr,
|
||||||
pa_stream_flags_t flags) {
|
pa_stream_flags_t flags) {
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
return create_stream(PA_STREAM_RECORD, s, dev, attr, flags, NULL, NULL);
|
return create_stream(PA_STREAM_RECORD, s, dev, attr, flags, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
@ -618,9 +630,9 @@ int pa_stream_write(
|
||||||
|
|
||||||
pa_memchunk chunk;
|
pa_memchunk chunk;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
assert(data);
|
pa_assert(data);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_PLAYBACK || s->direction == PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_PLAYBACK || s->direction == PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -688,10 +700,10 @@ int pa_stream_write(
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_stream_peek(pa_stream *s, const void **data, size_t *length) {
|
int pa_stream_peek(pa_stream *s, const void **data, size_t *length) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
assert(data);
|
pa_assert(data);
|
||||||
assert(length);
|
pa_assert(length);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -707,15 +719,15 @@ int pa_stream_peek(pa_stream *s, const void **data, size_t *length) {
|
||||||
s->peek_data = pa_memblock_acquire(s->peek_memchunk.memblock);
|
s->peek_data = pa_memblock_acquire(s->peek_memchunk.memblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(s->peek_data);
|
pa_assert(s->peek_data);
|
||||||
*data = (uint8_t*) s->peek_data + s->peek_memchunk.index;
|
*data = (uint8_t*) s->peek_data + s->peek_memchunk.index;
|
||||||
*length = s->peek_memchunk.length;
|
*length = s->peek_memchunk.length;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pa_stream_drop(pa_stream *s) {
|
int pa_stream_drop(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -727,7 +739,7 @@ int pa_stream_drop(pa_stream *s) {
|
||||||
if (s->timing_info_valid && !s->timing_info.read_index_corrupt)
|
if (s->timing_info_valid && !s->timing_info.read_index_corrupt)
|
||||||
s->timing_info.read_index += s->peek_memchunk.length;
|
s->timing_info.read_index += s->peek_memchunk.length;
|
||||||
|
|
||||||
assert(s->peek_data);
|
pa_assert(s->peek_data);
|
||||||
pa_memblock_release(s->peek_memchunk.memblock);
|
pa_memblock_release(s->peek_memchunk.memblock);
|
||||||
pa_memblock_unref(s->peek_memchunk.memblock);
|
pa_memblock_unref(s->peek_memchunk.memblock);
|
||||||
s->peek_memchunk.length = 0;
|
s->peek_memchunk.length = 0;
|
||||||
|
|
@ -738,8 +750,8 @@ int pa_stream_drop(pa_stream *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t pa_stream_writable_size(pa_stream *s) {
|
size_t pa_stream_writable_size(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1);
|
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1);
|
||||||
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction != PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1);
|
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction != PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1);
|
||||||
|
|
@ -748,8 +760,8 @@ size_t pa_stream_writable_size(pa_stream *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t pa_stream_readable_size(pa_stream *s) {
|
size_t pa_stream_readable_size(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1);
|
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1);
|
||||||
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1);
|
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1);
|
||||||
|
|
@ -762,8 +774,8 @@ pa_operation * pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
||||||
|
|
@ -783,8 +795,9 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
||||||
struct timeval local, remote, now;
|
struct timeval local, remote, now;
|
||||||
pa_timing_info *i;
|
pa_timing_info *i;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context || !o->stream)
|
if (!o->context || !o->stream)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -932,8 +945,8 @@ pa_operation* pa_stream_update_timing_info(pa_stream *s, pa_stream_success_cb_t
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
int cidx = 0;
|
int cidx = 0;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -975,9 +988,9 @@ pa_operation* pa_stream_update_timing_info(pa_stream *s, pa_stream_success_cb_t
|
||||||
void pa_stream_disconnect_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32_t tag, pa_tagstruct *t, void *userdata) {
|
void pa_stream_disconnect_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32_t tag, pa_tagstruct *t, void *userdata) {
|
||||||
pa_stream *s = userdata;
|
pa_stream *s = userdata;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
pa_stream_ref(s);
|
pa_stream_ref(s);
|
||||||
|
|
||||||
|
|
@ -1002,8 +1015,8 @@ int pa_stream_disconnect(pa_stream *s) {
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->channel_valid, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->channel_valid, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->context->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->context->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
@ -1024,48 +1037,48 @@ int pa_stream_disconnect(pa_stream *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_read_callback(pa_stream *s, pa_stream_request_cb_t cb, void *userdata) {
|
void pa_stream_set_read_callback(pa_stream *s, pa_stream_request_cb_t cb, void *userdata) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
s->read_callback = cb;
|
s->read_callback = cb;
|
||||||
s->read_userdata = userdata;
|
s->read_userdata = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_write_callback(pa_stream *s, pa_stream_request_cb_t cb, void *userdata) {
|
void pa_stream_set_write_callback(pa_stream *s, pa_stream_request_cb_t cb, void *userdata) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
s->write_callback = cb;
|
s->write_callback = cb;
|
||||||
s->write_userdata = userdata;
|
s->write_userdata = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
s->state_callback = cb;
|
s->state_callback = cb;
|
||||||
s->state_userdata = userdata;
|
s->state_userdata = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_overflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
void pa_stream_set_overflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
s->overflow_callback = cb;
|
s->overflow_callback = cb;
|
||||||
s->overflow_userdata = userdata;
|
s->overflow_userdata = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_underflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
void pa_stream_set_underflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
s->underflow_callback = cb;
|
s->underflow_callback = cb;
|
||||||
s->underflow_userdata = userdata;
|
s->underflow_userdata = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_stream_set_latency_update_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
void pa_stream_set_latency_update_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
s->latency_update_callback = cb;
|
s->latency_update_callback = cb;
|
||||||
s->latency_update_userdata = userdata;
|
s->latency_update_userdata = userdata;
|
||||||
|
|
@ -1075,9 +1088,9 @@ void pa_stream_simple_ack_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UN
|
||||||
pa_operation *o = userdata;
|
pa_operation *o = userdata;
|
||||||
int success = 1;
|
int success = 1;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(o);
|
pa_assert(o);
|
||||||
assert(PA_REFCNT_VALUE(o) >= 1);
|
pa_assert(PA_REFCNT_VALUE(o) >= 1);
|
||||||
|
|
||||||
if (!o->context)
|
if (!o->context)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
@ -1107,8 +1120,8 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -1137,8 +1150,8 @@ static pa_operation* stream_send_simple_command(pa_stream *s, uint32_t command,
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -1155,6 +1168,9 @@ static pa_operation* stream_send_simple_command(pa_stream *s, uint32_t command,
|
||||||
pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) {
|
pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) {
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
|
|
||||||
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata))) {
|
if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata))) {
|
||||||
|
|
@ -1180,6 +1196,9 @@ pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *use
|
||||||
pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) {
|
pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) {
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
|
|
||||||
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->buffer_attr.prebuf > 0, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->buffer_attr.prebuf > 0, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -1192,6 +1211,9 @@ pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *us
|
||||||
pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) {
|
pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) {
|
||||||
pa_operation *o;
|
pa_operation *o;
|
||||||
|
|
||||||
|
pa_assert(s);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->buffer_attr.prebuf > 0, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->buffer_attr.prebuf > 0, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -1206,9 +1228,9 @@ pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_succe
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
assert(name);
|
pa_assert(name);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -1230,8 +1252,8 @@ pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_succe
|
||||||
int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec) {
|
int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec) {
|
||||||
pa_usec_t usec = 0;
|
pa_usec_t usec = 0;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -1314,8 +1336,8 @@ int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static pa_usec_t time_counter_diff(pa_stream *s, pa_usec_t a, pa_usec_t b, int *negative) {
|
static pa_usec_t time_counter_diff(pa_stream *s, pa_usec_t a, pa_usec_t b, int *negative) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
if (negative)
|
if (negative)
|
||||||
*negative = 0;
|
*negative = 0;
|
||||||
|
|
@ -1336,9 +1358,9 @@ int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative) {
|
||||||
int r;
|
int r;
|
||||||
int64_t cindex;
|
int64_t cindex;
|
||||||
|
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
assert(r_usec);
|
pa_assert(r_usec);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -1368,8 +1390,8 @@ int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const pa_timing_info* pa_stream_get_timing_info(pa_stream *s) {
|
const pa_timing_info* pa_stream_get_timing_info(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
@ -1379,22 +1401,22 @@ const pa_timing_info* pa_stream_get_timing_info(pa_stream *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s) {
|
const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
return &s->sample_spec;
|
return &s->sample_spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pa_channel_map* pa_stream_get_channel_map(pa_stream *s) {
|
const pa_channel_map* pa_stream_get_channel_map(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
return &s->channel_map;
|
return &s->channel_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s) {
|
const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s) {
|
||||||
assert(s);
|
pa_assert(s);
|
||||||
assert(PA_REFCNT_VALUE(s) >= 1);
|
pa_assert(PA_REFCNT_VALUE(s) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <pulsecore/gccmacro.h>
|
#include <pulsecore/gccmacro.h>
|
||||||
|
#include <pulsecore/macro.h>
|
||||||
#include <pulsecore/pstream-util.h>
|
#include <pulsecore/pstream-util.h>
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
@ -40,10 +41,11 @@ void pa_command_subscribe_event(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSE
|
||||||
pa_subscription_event_type_t e;
|
pa_subscription_event_type_t e;
|
||||||
uint32_t idx;
|
uint32_t idx;
|
||||||
|
|
||||||
assert(pd);
|
pa_assert(pd);
|
||||||
assert(command == PA_COMMAND_SUBSCRIBE_EVENT);
|
pa_assert(command == PA_COMMAND_SUBSCRIBE_EVENT);
|
||||||
assert(t);
|
pa_assert(t);
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
pa_context_ref(c);
|
pa_context_ref(c);
|
||||||
|
|
||||||
|
|
@ -67,8 +69,8 @@ pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_c
|
||||||
pa_tagstruct *t;
|
pa_tagstruct *t;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
|
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||||
|
|
||||||
|
|
@ -83,8 +85,8 @@ pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_c
|
||||||
}
|
}
|
||||||
|
|
||||||
void pa_context_set_subscribe_callback(pa_context *c, pa_context_subscribe_cb_t cb, void *userdata) {
|
void pa_context_set_subscribe_callback(pa_context *c, pa_context_subscribe_cb_t cb, void *userdata) {
|
||||||
assert(c);
|
pa_assert(c);
|
||||||
assert(PA_REFCNT_VALUE(c) >= 1);
|
pa_assert(PA_REFCNT_VALUE(c) >= 1);
|
||||||
|
|
||||||
c->subscribe_callback = cb;
|
c->subscribe_callback = cb;
|
||||||
c->subscribe_userdata = userdata;
|
c->subscribe_userdata = userdata;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue