mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
cpu: Add CPU information to pa_core
This retains CPU information (processor type and supported features) in pa_core, so that this information can be used by modules at init time to figure out what optimisations may be used.
This commit is contained in:
parent
ffcf3c8a6c
commit
ab4223e9cf
8 changed files with 119 additions and 55 deletions
|
|
@ -934,11 +934,6 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
pa_memtrap_install();
|
||||
|
||||
if (!getenv("PULSE_NO_SIMD")) {
|
||||
pa_cpu_init_x86();
|
||||
pa_cpu_init_arm();
|
||||
}
|
||||
|
||||
pa_assert_se(mainloop = pa_mainloop_new());
|
||||
|
||||
if (!(c = pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_shm, conf->shm_size))) {
|
||||
|
|
@ -964,6 +959,14 @@ int main(int argc, char *argv[]) {
|
|||
c->server_type = conf->local_server_type;
|
||||
#endif
|
||||
|
||||
c->cpu_info.cpu_type = PA_CPU_UNDEFINED;
|
||||
if (!getenv("PULSE_NO_SIMD")) {
|
||||
if (pa_cpu_init_x86(&(c->cpu_info.flags.x86)))
|
||||
c->cpu_info.cpu_type = PA_CPU_X86;
|
||||
if (pa_cpu_init_arm(&(c->cpu_info.flags.arm)))
|
||||
c->cpu_info.cpu_type = PA_CPU_ARM;
|
||||
}
|
||||
|
||||
pa_assert_se(pa_signal_init(pa_mainloop_get_api(mainloop)) == 0);
|
||||
pa_signal_new(SIGINT, signal_callback, c);
|
||||
pa_signal_new(SIGTERM, signal_callback, c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue