28 #include <pulse/simple.h>
29 #include <pulse/rtclock.h>
30 #include <pulse/error.h>
37 #define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
67 default:
return PA_SAMPLE_INVALID;
83 pa_buffer_attr attr = { -1 };
131 if ((pa_simple_read(pd->
s, pkt->
data, pkt->
size, &res)) < 0) {
138 if ((latency = pa_simple_get_latency(pd->
s, &res)) == (pa_usec_t) -1) {
160 pa_simple_free(pd->
s);
164 #define OFFSET(a) offsetof(PulseData, a)
165 #define D AV_OPT_FLAG_DECODING_PARAM
171 {
"sample_rate",
"sample rate in Hz",
OFFSET(sample_rate),
AV_OPT_TYPE_INT, {.i64 = 48000}, 1, INT_MAX,
D },
174 {
"fragment_size",
"buffering size, affects latency and cpu usage",
OFFSET(fragment_size),
AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX,
D },
175 {
"wallclock",
"set the initial pts using the current time",
OFFSET(wallclock),
AV_OPT_TYPE_INT, {.i64 = 1}, -1, 1,
D },
194 .priv_class = &pulse_demuxer_class,