Debian Codegraph @

modules/lsp-runtime-lib/include/lsp-plug.in/mm/sample.h

raw
1 /*
2 * Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2023 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 16 апр. 2020 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_MM_SAMPLE_H_
23 #define LSP_PLUG_IN_MM_SAMPLE_H_
24
25 #include <lsp-plug.in/runtime/version.h>
26 #include <lsp-plug.in/mm/types.h>
27
28 namespace lsp
29 {
30 namespace mm
31 {
32 /**
33 * Convert endianess of samples to match CPU endianess
34 * @param buf buffer to process
35 * @param samples number of samples to process
36 * @param format sample format
37 * @return true if conversion is possible
38 */
39 bool sample_endian_to_cpu(void *buf, size_t samples, size_t format);
40
41 /**
42 * Convert sample format
43 * @param dst destination buffer to store samples
44 * @param src source buffer to convert samples (contents may be modified during processing)
45 * @param samples number of samples to convert
46 * @param to target sample format
47 * @param from source sample format
48 * @return true if conversion is possible
49 */
50 bool convert_samples(void *dst, void *src, size_t samples, size_t to, size_t from);
51 } /* namespace mm */
52 } /* namespace lsp */
53
54
55 #endif /* LSP_PLUG_IN_MM_SAMPLE_H_ */