MPD 0.17~git
Functions
src/pcm_byteswap.h File Reference
#include "audio_format.h"
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Functions

const int16_t * pcm_byteswap_16 (struct pcm_buffer *buffer, const int16_t *src, size_t len)
 Changes the endianness of 16 bit PCM data.
const int32_t * pcm_byteswap_32 (struct pcm_buffer *buffer, const int32_t *src, size_t len)
 Changes the endianness of 32-bit (or 24-bit) PCM data.
G_GNUC_MALLOC const void * pcm_byteswap (struct pcm_buffer *buffer, enum sample_format format, const void *src, size_t size)
 Changes the endianness of PCM data.

Function Documentation

G_GNUC_MALLOC const void* pcm_byteswap ( struct pcm_buffer buffer,
enum sample_format  format,
const void *  src,
size_t  size 
)

Changes the endianness of PCM data.

Parameters:
bufferthe destination pcm_buffer object
formatthe sample format (both input and output)
srcthe source PCM buffer
src_sizethe number of bytes in #src
Returns:
the destination buffer, or NULL if the sample format is not supported
const int16_t* pcm_byteswap_16 ( struct pcm_buffer buffer,
const int16_t *  src,
size_t  len 
)

Changes the endianness of 16 bit PCM data.

Parameters:
bufferthe destination pcm_buffer object
srcthe source PCM buffer
src_sizethe number of bytes in #src
Returns:
the destination buffer
const int32_t* pcm_byteswap_32 ( struct pcm_buffer buffer,
const int32_t *  src,
size_t  len 
)

Changes the endianness of 32-bit (or 24-bit) PCM data.

Parameters:
bufferthe destination pcm_buffer object
srcthe source PCM buffer
src_sizethe number of bytes in #src
Returns:
the destination buffer