28 #include <pulse/simple.h>
29 #include <pulse/rtclock.h>
30 #include <pulse/error.h>
36 #define DEFAULT_CODEC_ID AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE)
65 default:
return PA_SAMPLE_INVALID;
82 pa_buffer_attr attr = { -1 };
130 if ((pa_simple_read(pd->
s, pkt->
data, pkt->
size, &res)) < 0) {
137 if ((latency = pa_simple_get_latency(pd->
s, &res)) == (pa_usec_t) -1) {
157 pa_simple_free(pd->
s);
161 #define OFFSET(a) offsetof(PulseData, a)
162 #define D AV_OPT_FLAG_DECODING_PARAM
168 {
"sample_rate",
"sample rate in Hz",
OFFSET(sample_rate),
AV_OPT_TYPE_INT, {.dbl = 48000}, 1, INT_MAX,
D },
170 {
"frame_size",
"number of bytes per frame",
OFFSET(frame_size),
AV_OPT_TYPE_INT, {.dbl = 1024}, 1, INT_MAX,
D },
171 {
"fragment_size",
"buffering size, affects latency and cpu usage",
OFFSET(fragment_size),
AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX,
D },
190 .priv_class = &pulse_demuxer_class,