src/pcm_export.h File Reference

#include "check.h"
#include "pcm_buffer.h"
#include "audio_format.h"
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  pcm_export_state
 An object that handles export of PCM samples to some instance outside of MPD. More...

Functions

void pcm_export_init (struct pcm_export_state *state)
 Initialize a pcm_export_state object.
void pcm_export_deinit (struct pcm_export_state *state)
 Deinitialize a pcm_export_state object and free allocated memory.
void pcm_export_open (struct pcm_export_state *state, enum sample_format sample_format, unsigned channels, bool dsd_usb, bool shift8, bool pack, bool reverse_endian)
 Open the pcm_export_state object.
G_GNUC_PURE size_t pcm_export_frame_size (const struct pcm_export_state *state, const struct audio_format *audio_format)
 Calculate the size of one output frame.
const void * pcm_export (struct pcm_export_state *state, const void *src, size_t src_size, size_t *dest_size_r)
 Export a PCM buffer.
G_GNUC_PURE size_t pcm_export_source_size (const struct pcm_export_state *state, size_t dest_size)
 Converts the number of consumed bytes from the pcm_export() destination buffer to the according number of bytes from the pcm_export() source buffer.

Function Documentation

const void* pcm_export ( struct pcm_export_state state,
const void *  src,
size_t  src_size,
size_t *  dest_size_r 
)

Export a PCM buffer.

Parameters:
state an initialized and open pcm_export_state object
src the source PCM buffer
src_size the size of src in bytes
dest_size_r returns the number of bytes of the destination buffer
Returns:
the destination buffer (may be a pointer to the source buffer)
void pcm_export_deinit ( struct pcm_export_state state  ) 

Deinitialize a pcm_export_state object and free allocated memory.

G_GNUC_PURE size_t pcm_export_frame_size ( const struct pcm_export_state state,
const struct audio_format audio_format 
)

Calculate the size of one output frame.

void pcm_export_init ( struct pcm_export_state state  ) 

Initialize a pcm_export_state object.

void pcm_export_open ( struct pcm_export_state state,
enum sample_format  sample_format,
unsigned  channels,
bool  dsd_usb,
bool  shift8,
bool  pack,
bool  reverse_endian 
)

Open the pcm_export_state object.

There is no "close" method. This function may be called multiple times to reuse the object, until pcm_export_deinit() is called.

This function cannot fail.

Parameters:
channels the number of channels; ignored unless dsd_usb is set
G_GNUC_PURE size_t pcm_export_source_size ( const struct pcm_export_state state,
size_t  dest_size 
)

Converts the number of consumed bytes from the pcm_export() destination buffer to the according number of bytes from the pcm_export() source buffer.


Generated on 17 Jul 2013 for MPD by  doxygen 1.6.1