00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PCM_EXPORT_H
00021 #define PCM_EXPORT_H
00022
00023 #include "check.h"
00024 #include "pcm_buffer.h"
00025 #include "audio_format.h"
00026
00027 #include <stdbool.h>
00028
00029 struct audio_format;
00030
00036 struct pcm_export_state {
00043 struct pcm_buffer dsd_buffer;
00044
00050 struct pcm_buffer pack_buffer;
00051
00057 struct pcm_buffer reverse_buffer;
00058
00062 uint8_t channels;
00063
00069 bool dsd_usb;
00070
00075 bool shift8;
00076
00080 bool pack24;
00081
00087 uint8_t reverse_endian;
00088 };
00089
00093 void
00094 pcm_export_init(struct pcm_export_state *state);
00095
00099 void
00100 pcm_export_deinit(struct pcm_export_state *state);
00101
00112 void
00113 pcm_export_open(struct pcm_export_state *state,
00114 enum sample_format sample_format, unsigned channels,
00115 bool dsd_usb, bool shift8, bool pack, bool reverse_endian);
00116
00120 G_GNUC_PURE
00121 size_t
00122 pcm_export_frame_size(const struct pcm_export_state *state,
00123 const struct audio_format *audio_format);
00124
00134 const void *
00135 pcm_export(struct pcm_export_state *state, const void *src, size_t src_size,
00136 size_t *dest_size_r);
00137
00143 G_GNUC_PURE
00144 size_t
00145 pcm_export_source_size(const struct pcm_export_state *state, size_t dest_size);
00146
00147 #endif