OpenShot Library | libopenshot 1.1.1
Settings.h
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#ifndef OPENSHOT_SETTINGS_H
14#define OPENSHOT_SETTINGS_H
15
16#include <string>
17
18namespace openshot {
19
26 class Settings {
27 private:
28
30 Settings(){}; // Don't allow user to create an instance of this singleton
31
32#if __GNUC__ >=7
34 Settings(Settings const&) = delete; // Don't allow the user to assign this instance
35
37 Settings & operator=(Settings const&) = delete; // Don't allow the user to assign this instance
38#else
40 Settings(Settings const&) {}; // Don't allow the user to assign this instance
41
43 Settings & operator=(Settings const&); // Don't allow the user to assign this instance
44#endif
45
47 static Settings * m_pInstance;
48
50 int applied_omp_threads = 0;
51
53 int default_omp_threads = 2;
54
56 int default_ff_threads = 2;
57
58 public:
72
75
77 int OMP_THREADS = 2;
78
80 int FF_THREADS = 16;
81
84
87
90
93
96
99
102
105
108
111
114
117
120
123 std::string PATH_OPENSHOT_INSTALL = "";
124
126 bool DEBUG_TO_STDERR = false;
127
129 int EffectiveOMPThreads() const;
130
132 int MaxAllowedThreads() const;
133
135 int DefaultOMPThreads() const { return default_omp_threads; }
136
138 int DefaultFFThreads() const { return default_ff_threads; }
139
141 void ApplyOpenMPSettings();
142
144 static Settings * Instance();
145 };
146
147}
148
149#endif
This class is contains settings used by libopenshot (and can be safely toggled at any point)
Definition: Settings.h:26
int PLAYBACK_AUDIO_BUFFER_SIZE
Size of playback buffer before audio playback starts.
Definition: Settings.h:119
int DE_LIMIT_WIDTH_MAX
Maximum columns that hardware decode can handle.
Definition: Settings.h:89
int OMP_THREADS
Number of OpenMP threads.
Definition: Settings.h:77
int MaxAllowedThreads() const
Return the maximum allowed thread override based on this machine.
Definition: Settings.cpp:28
std::string PLAYBACK_AUDIO_DEVICE_NAME
The audio device name to use during playback.
Definition: Settings.h:113
std::string PLAYBACK_AUDIO_DEVICE_TYPE
The device type for the playback audio devices.
Definition: Settings.h:116
std::string PATH_OPENSHOT_INSTALL
Definition: Settings.h:123
int HW_DE_DEVICE_SET
Which GPU to use to decode (0 is the first)
Definition: Settings.h:92
int CACHE_MIN_FRAMES
Minimum number of frames for frame-count-based caches.
Definition: Settings.h:83
void ApplyOpenMPSettings()
Apply any explicit OpenMP thread override to the runtime.
Definition: Settings.cpp:33
int DE_LIMIT_HEIGHT_MAX
Maximum rows that hardware decode can handle.
Definition: Settings.h:86
static Settings * Instance()
Create or get an instance of this logger singleton (invoke the class with this method)
Definition: Settings.cpp:43
int VIDEO_CACHE_MIN_PREROLL_FRAMES
Minimum number of frames to cache before playback begins.
Definition: Settings.h:101
int HARDWARE_DECODER
Use video codec for faster video decoding (if supported)
Definition: Settings.h:71
bool HIGH_QUALITY_SCALING
Scale mode used in FFmpeg decoding and encoding (used as an optimization for faster previews)
Definition: Settings.h:74
int VIDEO_CACHE_MAX_FRAMES
Max number of frames (when paused) to cache for playback.
Definition: Settings.h:107
int FF_THREADS
Number of threads that ffmpeg uses.
Definition: Settings.h:80
float VIDEO_CACHE_PERCENT_AHEAD
Percentage of cache in front of the playhead (0.0 to 1.0)
Definition: Settings.h:98
bool ENABLE_PLAYBACK_CACHING
Enable/Disable the cache thread to pre-fetch and cache video frames before we need them.
Definition: Settings.h:110
int DefaultFFThreads() const
Return the machine default FFmpeg thread count detected at startup.
Definition: Settings.h:138
int DefaultOMPThreads() const
Return the machine default OpenMP thread count detected at startup.
Definition: Settings.h:135
int EffectiveOMPThreads() const
Return the effective OpenMP worker budget used by libopenshot heuristics.
Definition: Settings.cpp:23
int HW_EN_DEVICE_SET
Which GPU to use to encode (0 is the first)
Definition: Settings.h:95
int VIDEO_CACHE_MAX_PREROLL_FRAMES
Max number of frames (ahead of playhead) to cache during playback.
Definition: Settings.h:104
bool DEBUG_TO_STDERR
Legacy native debug-to-stderr switch (explicit Logger levels take precedence)
Definition: Settings.h:126
This namespace is the default namespace for all code in the openshot library.
Definition: AnimatedCurve.h:24