Logo Search packages:      
Sourcecode: pulseaudio version File versions

size_t pa_sample_size_of_format ( pa_sample_format_t  f  ) 

Similar to pa_sample_size() but take a sample format instead of a full sample spec.

Since:
0.9.15

Definition at line 39 of file sample.c.

References PA_SAMPLE_ALAW, PA_SAMPLE_FLOAT32BE, PA_SAMPLE_FLOAT32LE, PA_SAMPLE_MAX, PA_SAMPLE_S16BE, PA_SAMPLE_S16LE, PA_SAMPLE_S24_32BE, PA_SAMPLE_S24_32LE, PA_SAMPLE_S24BE, PA_SAMPLE_S24LE, PA_SAMPLE_S32BE, PA_SAMPLE_S32LE, PA_SAMPLE_U8, and PA_SAMPLE_ULAW.

                                                      {

    static const size_t table[] = {
        [PA_SAMPLE_U8] = 1,
        [PA_SAMPLE_ULAW] = 1,
        [PA_SAMPLE_ALAW] = 1,
        [PA_SAMPLE_S16LE] = 2,
        [PA_SAMPLE_S16BE] = 2,
        [PA_SAMPLE_FLOAT32LE] = 4,
        [PA_SAMPLE_FLOAT32BE] = 4,
        [PA_SAMPLE_S32LE] = 4,
        [PA_SAMPLE_S32BE] = 4,
        [PA_SAMPLE_S24LE] = 3,
        [PA_SAMPLE_S24BE] = 3,
        [PA_SAMPLE_S24_32LE] = 4,
        [PA_SAMPLE_S24_32BE] = 4
    };

    pa_assert(f >= 0);
    pa_assert(f < PA_SAMPLE_MAX);

    return table[f];
}


Generated by  Doxygen 1.6.0   Back to index