1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Detection of available hardware resources
6 // Copyright (C) 2007 Lasse Collin
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
13 // This program 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 GNU
16 // Lesser General Public License for more details.
18 ///////////////////////////////////////////////////////////////////////////////
20 /// Initialize some hardware-specific variables, which are needed by other
21 /// hardware_* functions.
22 extern void hardware_init(void);
25 /// Set custom value for maximum number of coder threads.
26 extern void hardware_threadlimit_set(uint32_t threadlimit);
28 /// Get the maximum number of coder threads. Some additional helper threads
29 /// are allowed on top of this).
30 extern uint32_t hardware_threadlimit_get(void);
33 /// Set custom memory usage limit. This is used for both encoding and
34 /// decoding. Zero indicates resetting the limit back to defaults.
35 extern void hardware_memlimit_set(uint64_t memlimit);
37 /// Get the memory usage limit for encoding. By default this is 90 % of RAM.
38 extern uint64_t hardware_memlimit_encoder(void);
41 /// Get the memory usage limit for decoding. By default this is 30 % of RAM.
42 extern uint64_t hardware_memlimit_decoder(void);