OpenShot Library | libopenshot 0.5.0
Loading...
Searching...
No Matches
Settings.cpp
Go to the documentation of this file.
1
9// Copyright (c) 2008-2019 OpenShot Studios, LLC
10//
11// SPDX-License-Identifier: LGPL-3.0-or-later
12
13#include <cstdlib>
14#include <omp.h>
15#include "Settings.h"
16
17using namespace openshot;
18
19// Global reference to Settings
20Settings *Settings::m_pInstance = nullptr;
21
22// Create or Get an instance of the settings singleton
24{
25 if (!m_pInstance) {
26 // Create the actual instance of Settings only once
27 m_pInstance = new Settings;
28 m_pInstance->OMP_THREADS = omp_get_num_procs();
29 m_pInstance->FF_THREADS = omp_get_num_procs();
30 auto env_debug = std::getenv("LIBOPENSHOT_DEBUG");
31 if (env_debug != nullptr)
32 m_pInstance->DEBUG_TO_STDERR = true;
33 }
34
35 return m_pInstance;
36}
Header file for global Settings class.
This class is contains settings used by libopenshot (and can be safely toggled at any point)
Definition Settings.h:26
int OMP_THREADS
Number of threads of OpenMP.
Definition Settings.h:68
static Settings * Instance()
Create or get an instance of this logger singleton (invoke the class with this method)
Definition Settings.cpp:23
int FF_THREADS
Number of threads that ffmpeg uses.
Definition Settings.h:71
bool DEBUG_TO_STDERR
Whether to dump ZeroMQ debug messages to stderr.
Definition Settings.h:114
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29