43 default:
return PA_SAMPLE_INVALID;
64 switch (pa_context_get_state(c)) {
65 case PA_CONTEXT_FAILED:
66 case PA_CONTEXT_TERMINATED:
69 case PA_CONTEXT_READY:
83 pa_context_set_state_callback(*pa_ctx,
NULL,
NULL);
84 pa_context_disconnect(*pa_ctx);
85 pa_context_unref(*pa_ctx);
88 pa_mainloop_free(*pa_ml);
97 pa_mainloop_api *pa_mlapi =
NULL;
106 if (!(*pa_ml = pa_mainloop_new()))
108 if (!(pa_mlapi = pa_mainloop_get_api(*pa_ml))) {
112 if (!(*pa_ctx = pa_context_new(pa_mlapi, description))) {
116 pa_context_set_state_callback(*pa_ctx,
pa_state_cb, &context_state);
117 if (pa_context_connect(*pa_ctx, server, 0,
NULL) < 0) {
123 pa_mainloop_iterate(*pa_ml, 1,
NULL);
173 int eol,
void *userdata)
180 int eol,
void *userdata)
199 pa_mainloop *pa_ml =
NULL;
200 pa_operation *pa_op =
NULL;
201 pa_context *pa_ctx =
NULL;
202 enum pa_operation_state op_state;
220 while ((op_state = pa_operation_get_state(pa_op)) == PA_OPERATION_RUNNING)
221 pa_mainloop_iterate(pa_ml, 1,
NULL);
222 if (op_state != PA_OPERATION_DONE)
224 pa_operation_unref(pa_op);
229 while ((op_state = pa_operation_get_state(pa_op)) == PA_OPERATION_RUNNING)
230 pa_mainloop_iterate(pa_ml, 1,
NULL);
231 if (op_state != PA_OPERATION_DONE)
233 pa_operation_unref(pa_op);
Structure describes basic parameters of the device.
char * device_description
human friendly name
Memory handling functions.
char * device_name
device name, format depends on device
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Macro definitions for various function/variable attributes.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int ff_pulse_audio_connect_context(pa_mainloop **pa_ml, pa_context **pa_ctx, const char *server, const char *description)
int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem)
Add an element to a dynamic array.
AVCodecID
Identify the syntax and semantics of the bitstream.
simple assert() macros that are a bit more flexible than ISO C assert().
AVDeviceInfo ** devices
list of autodetected devices
void ff_pulse_audio_disconnect_context(pa_mainloop **pa_ml, pa_context **pa_ctx)
pa_sample_format_t av_cold ff_codec_id_to_pulse_format(enum AVCodecID codec_id)
static void pa_state_cb(pa_context *c, void *userdata)
char * av_strdup(const char *s)
Duplicate a string.
static void pulse_audio_sink_device_cb(pa_context *c, const pa_sink_info *dev, int eol, void *userdata)
static void pulse_server_info_cb(pa_context *c, const pa_server_info *i, void *userdata)
int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, int output)
int default_device
index of default device or -1 if no default
static void pulse_audio_source_device_cb(pa_context *c, const pa_source_info *dev, int eol, void *userdata)
AVDeviceInfoList * devices
static void pulse_add_detected_device(PulseAudioDeviceList *info, const char *name, const char *description)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
int nb_devices
number of autodetected devices
#define AVERROR_EXTERNAL
Generic error in an external library.