28 #include <pulse/simple.h>
29 #include <pulse/rtclock.h>
30 #include <pulse/error.h>
36 #define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
57 int ret, sample_bytes;
64 pa_buffer_attr attr = { -1 };
100 "(channels * bytes_per_sample) \n", pd->
frame_size, sample_bytes);
117 if ((pa_simple_read(pd->
s, pkt->
data, pkt->
size, &res)) < 0) {
127 if ((latency = pa_simple_get_latency(pd->
s, &res)) == (pa_usec_t) -1) {
146 pa_simple_free(pd->
s);
150 #define OFFSET(a) offsetof(PulseData, a)
151 #define D AV_OPT_FLAG_DECODING_PARAM
158 {
"channels",
"set number of audio channels",
OFFSET(channels),
AV_OPT_TYPE_INT, {.i64 = 2}, 1, INT_MAX,
D },
160 {
"fragment_size",
"set buffering size, affects latency and cpu usage",
OFFSET(fragment_size),
AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX,
D },
179 .priv_class = &pulse_demuxer_class,