diff options
Diffstat (limited to '')
-rw-r--r-- | src/pcm_export.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/pcm_export.h b/src/pcm_export.h index 7ce35c096..c132c7169 100644 --- a/src/pcm_export.h +++ b/src/pcm_export.h @@ -35,6 +35,14 @@ struct audio_format; */ struct pcm_export_state { /** + * The buffer is used to convert DSD samples to the + * DSD-over-USB format. + * + * @see #dsd_usb + */ + struct pcm_buffer dsd_buffer; + + /** * The buffer is used to pack samples, removing padding. * * @see #pack24 @@ -49,6 +57,18 @@ struct pcm_export_state { struct pcm_buffer reverse_buffer; /** + * The number of channels. + */ + uint8_t channels; + + /** + * Convert DSD to DSD-over-USB? Input format must be + * SAMPLE_FORMAT_DSD and output format must be + * SAMPLE_FORMAT_S24_P32. + */ + bool dsd_usb; + + /** * Pack 24 bit samples? */ bool pack24; @@ -80,11 +100,13 @@ pcm_export_deinit(struct pcm_export_state *state); * times to reuse the object, until pcm_export_deinit() is called. * * This function cannot fail. + * + * @param channels the number of channels; ignored unless dsd_usb is set */ void pcm_export_open(struct pcm_export_state *state, - enum sample_format sample_format, - bool pack, bool reverse_endian); + enum sample_format sample_format, unsigned channels, + bool dsd_usb, bool pack, bool reverse_endian); /** * Export a PCM buffer. @@ -99,4 +121,13 @@ const void * pcm_export(struct pcm_export_state *state, const void *src, size_t src_size, size_t *dest_size_r); +/** + * Converts the number of consumed bytes from the pcm_export() + * destination buffer to the according number of bytes from the + * pcm_export() source buffer. + */ +G_GNUC_PURE +size_t +pcm_export_source_size(const struct pcm_export_state *state, size_t dest_size); + #endif |