configure.ac: Don't allow UNIX IPC to be configured for a native Windows build.
[mpd-mk.git] / src / pcm_format.h
blob3e96fc65f19e2858d478d3ea05653c25bec52a04
1 /*
2 * Copyright (C) 2003-2010 The Music Player Daemon Project
3 * http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef PCM_FORMAT_H
21 #define PCM_FORMAT_H
23 #include "audio_format.h"
25 #include <stdint.h>
26 #include <stddef.h>
28 struct pcm_buffer;
29 struct pcm_dither;
31 /**
32 * Converts PCM samples to 16 bit. If the source format is 24 bit,
33 * then dithering is applied.
35 * @param buffer a pcm_buffer object
36 * @param dither a pcm_dither object for 24-to-16 conversion
37 * @param bits the number of in the source buffer
38 * @param src the source PCM buffer
39 * @param src_size the size of #src in bytes
40 * @param dest_size_r returns the number of bytes of the destination buffer
41 * @return the destination buffer
43 const int16_t *
44 pcm_convert_to_16(struct pcm_buffer *buffer, struct pcm_dither *dither,
45 enum sample_format src_format, const void *src,
46 size_t src_size, size_t *dest_size_r);
48 /**
49 * Converts PCM samples to 24 bit (32 bit alignment).
51 * @param buffer a pcm_buffer object
52 * @param bits the number of in the source buffer
53 * @param src the source PCM buffer
54 * @param src_size the size of #src in bytes
55 * @param dest_size_r returns the number of bytes of the destination buffer
56 * @return the destination buffer
58 const int32_t *
59 pcm_convert_to_24(struct pcm_buffer *buffer,
60 enum sample_format src_format, const void *src,
61 size_t src_size, size_t *dest_size_r);
63 /**
64 * Converts PCM samples to 32 bit.
66 * @param buffer a pcm_buffer object
67 * @param bits the number of in the source buffer
68 * @param src the source PCM buffer
69 * @param src_size the size of #src in bytes
70 * @param dest_size_r returns the number of bytes of the destination buffer
71 * @return the destination buffer
73 const int32_t *
74 pcm_convert_to_32(struct pcm_buffer *buffer,
75 enum sample_format src_format, const void *src,
76 size_t src_size, size_t *dest_size_r);
78 #endif