mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
add pa_memblockq_apply_attr()/pa_memblockq_get_attr()
This commit is contained in:
parent
7c37c37fff
commit
b349dae6e1
2 changed files with 24 additions and 1 deletions
|
|
@ -851,6 +851,26 @@ void pa_memblockq_set_maxrewind(pa_memblockq *bq, size_t maxrewind) {
|
|||
bq->maxrewind = (maxrewind/bq->base)*bq->base;
|
||||
}
|
||||
|
||||
void pa_memblockq_apply_attr(pa_memblockq *bq, const pa_buffer_attr *a) {
|
||||
pa_assert(bq);
|
||||
pa_assert(a);
|
||||
|
||||
pa_memblockq_set_maxlength(bq, a->maxlength);
|
||||
pa_memblockq_set_tlength(bq, a->tlength);
|
||||
pa_memblockq_set_prebuf(bq, a->prebuf);
|
||||
pa_memblockq_set_minreq(bq, a->minreq);
|
||||
}
|
||||
|
||||
void pa_memblockq_get_attr(pa_memblockq *bq, pa_buffer_attr *a) {
|
||||
pa_assert(bq);
|
||||
pa_assert(a);
|
||||
|
||||
a->maxlength = (uint32_t) pa_memblockq_get_maxlength(bq);
|
||||
a->tlength = (uint32_t) pa_memblockq_get_tlength(bq);
|
||||
a->prebuf = (uint32_t) pa_memblockq_get_prebuf(bq);
|
||||
a->minreq = (uint32_t) pa_memblockq_get_minreq(bq);
|
||||
}
|
||||
|
||||
int pa_memblockq_splice(pa_memblockq *bq, pa_memblockq *source) {
|
||||
|
||||
pa_assert(bq);
|
||||
|
|
|
|||
|
|
@ -158,6 +158,10 @@ void pa_memblockq_set_minreq(pa_memblockq *memblockq, size_t minreq);
|
|||
void pa_memblockq_set_maxrewind(pa_memblockq *memblockq, size_t maxrewind); /* Set the maximum history size */
|
||||
void pa_memblockq_set_silence(pa_memblockq *memblockq, pa_memchunk *silence);
|
||||
|
||||
/* Apply the data from pa_buffer_attr */
|
||||
void pa_memblockq_apply_attr(pa_memblockq *memblockq, const pa_buffer_attr *a);
|
||||
void pa_memblockq_get_attr(pa_memblockq *bq, pa_buffer_attr *a);
|
||||
|
||||
/* Call pa_memchunk_willneed() for every chunk in the queue from the current read pointer to the end */
|
||||
void pa_memblockq_willneed(pa_memblockq *bq);
|
||||
|
||||
|
|
@ -175,5 +179,4 @@ pa_bool_t pa_memblockq_prebuf_active(pa_memblockq *bq);
|
|||
/* Return how many items are currently stored in the queue */
|
||||
unsigned pa_memblockq_get_nblocks(pa_memblockq *bq);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue