OpenShot Library | libopenshot  0.4.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
17 using namespace openshot;
18 
19 // Global reference to Settings
20 Settings *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 }
Settings.h
Header file for global Settings class.
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::Settings
This class is contains settings used by libopenshot (and can be safely toggled at any point)
Definition: Settings.h:26
openshot::Settings::Instance
static Settings * Instance()
Create or get an instance of this logger singleton (invoke the class with this method)
Definition: Settings.cpp:23
openshot::Settings::FF_THREADS
int FF_THREADS
Number of threads that ffmpeg uses.
Definition: Settings.h:71
openshot::Settings::OMP_THREADS
int OMP_THREADS
Number of threads of OpenMP.
Definition: Settings.h:68
openshot::Settings::DEBUG_TO_STDERR
bool DEBUG_TO_STDERR
Whether to dump ZeroMQ debug messages to stderr.
Definition: Settings.h:114