mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
Implement mix-test for s24le and s24be sample formats.
This commit is contained in:
parent
595f80fef7
commit
ad4e025ef5
1 changed files with 29 additions and 0 deletions
|
|
@ -79,6 +79,16 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case PA_SAMPLE_S24NE:
|
||||||
|
case PA_SAMPLE_S24RE: {
|
||||||
|
uint8_t *u = d;
|
||||||
|
|
||||||
|
for (i = 0; i < chunk->length / pa_frame_size(ss); i++)
|
||||||
|
printf("0x%02x%02x%02xx ", *(u++), *(u++), *(u++));
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PA_SAMPLE_FLOAT32NE:
|
case PA_SAMPLE_FLOAT32NE:
|
||||||
case PA_SAMPLE_FLOAT32RE: {
|
case PA_SAMPLE_FLOAT32RE: {
|
||||||
float *u = d;
|
float *u = d;
|
||||||
|
|
@ -141,6 +151,25 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case PA_SAMPLE_S24NE:
|
||||||
|
case PA_SAMPLE_S24RE: {
|
||||||
|
/* Need to be on a byte array because they are not aligned */
|
||||||
|
static const uint8_t u24_samples[] =
|
||||||
|
{ 0x00, 0x00, 0x01,
|
||||||
|
0xFF, 0xFF, 0x02,
|
||||||
|
0x7F, 0xFF, 0x03,
|
||||||
|
0x80, 0x00, 0x04,
|
||||||
|
0x9f, 0xff, 0x05,
|
||||||
|
0x3f, 0xff, 0x06,
|
||||||
|
0x01, 0x00, 0x07,
|
||||||
|
0xF0, 0x00, 0x08,
|
||||||
|
0x20, 0x00, 0x09,
|
||||||
|
0x21, 0x00, 0x0A };
|
||||||
|
|
||||||
|
memcpy(d, &u24_samples[0], sizeof(u24_samples));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case PA_SAMPLE_FLOAT32NE:
|
case PA_SAMPLE_FLOAT32NE:
|
||||||
case PA_SAMPLE_FLOAT32RE: {
|
case PA_SAMPLE_FLOAT32RE: {
|
||||||
float *u = d;
|
float *u = d;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue