Skip to content

Commit 4951bc5

Browse files
committed
Merge branch 'develop' into origin/develop
2 parents 97f6590 + 06e6de5 commit 4951bc5

File tree

120 files changed

+1736
-2081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1736
-2081
lines changed

CMakeLists.txt

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ configure_file(include/OpenShotVersion.h.in include/OpenShotVersion.h @ONLY)
7272
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/OpenShotVersion.h
7373
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libopenshot)
7474

75-
############### Set up include paths #################
76-
list(APPEND OPENSHOT_INCLUDE_DIRS
77-
${CMAKE_CURRENT_SOURCE_DIR}/include
78-
${CMAKE_CURRENT_SOURCE_DIR}/include/effects
79-
${CMAKE_CURRENT_SOURCE_DIR}/include/Qt
80-
${CMAKE_CURRENT_BINARY_DIR}/include )
81-
8275
#### Enable C++11 (for std::shared_ptr support)
8376
set(CMAKE_CXX_STANDARD 11)
8477
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -88,9 +81,9 @@ IF (WIN32)
8881
SET_PROPERTY(GLOBAL PROPERTY WIN32 "WIN32")
8982
ENDIF(WIN32)
9083

91-
############## FIND ALL QT RELATED HEADERS ##############
92-
set(QT_HEADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/Qt)
93-
FILE(GLOB QT_HEADER_FILES "${QT_HEADER_DIR}/*.h")
84+
include_directories(
85+
${CMAKE_CURRENT_SOURCE_DIR}/include
86+
${CMAKE_CURRENT_BINARY_DIR}/include)
9487

9588
############## PROCESS src/ DIRECTORIES ##############
9689
add_subdirectory(src)
@@ -104,14 +97,14 @@ if (TARGET doc)
10497
message(STATUS "Doxygen found, documentation target enabled")
10598
message("\nTo compile documentation in doc/html, run: 'make doc'")
10699

107-
# Install docs, if the user builds them with `make doc`
108-
install(CODE "MESSAGE(\"Checking for documentation files to install...\")")
109-
install(CODE "MESSAGE(\"(Compile with 'make doc' command, requires Doxygen)\")")
100+
# Install docs, if the user builds them with `make doc`
101+
install(CODE "MESSAGE(\"Checking for documentation files to install...\")")
102+
install(CODE "MESSAGE(\"(Compile with 'make doc' command, requires Doxygen)\")")
110103

111-
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html/
112-
DESTINATION ${CMAKE_INSTALL_DOCDIR}/API
113-
MESSAGE_NEVER # Don't spew about file copies
114-
OPTIONAL ) # No error if the docs aren't found
104+
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html/
105+
DESTINATION ${CMAKE_INSTALL_DOCDIR}/API
106+
MESSAGE_NEVER # Don't spew about file copies
107+
OPTIONAL ) # No error if the docs aren't found
115108
endif()
116109

117110
############# PROCESS tests/ DIRECTORY ##############

Doxyfile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ AUTOLINK_SUPPORT = YES
340340
# diagrams that involve STL classes more complete and accurate.
341341
# The default value is: NO.
342342

343-
BUILTIN_STL_SUPPORT = NO
343+
BUILTIN_STL_SUPPORT = YES
344344

345345
# If you use Microsoft's C++/CLI language, you should set this option to YES to
346346
# enable parsing support.
@@ -2096,7 +2096,7 @@ INCLUDE_FILE_PATTERNS =
20962096
# recursively expanded use the := operator instead of the = operator.
20972097
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
20982098

2099-
PREDEFINED =
2099+
PREDEFINED = USE_BLACKMAGIC USE_IMAGEMAGICK
21002100

21012101
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
21022102
# tag can be used to specify a list of macro names that should be expanded. The

cmake/Modules/FindFFmpeg.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,16 @@ foreach (_component ${FFmpeg_FIND_COMPONENTS})
180180
endif ()
181181
endforeach ()
182182

183-
# Build the include path with duplicates removed.
183+
# Build the result lists with duplicates removed, in case of repeated
184+
# invocations.
184185
if (FFmpeg_INCLUDE_DIRS)
185186
list(REMOVE_DUPLICATES FFmpeg_INCLUDE_DIRS)
187+
endif()
188+
if (FFmpeg_LIBRARIES)
189+
list(REMOVE_DUPLICATES FFmpeg_LIBRARIES)
190+
endif()
191+
if(FFmpeg_DEFINITIONS)
192+
list(REMOVE_DUPLICATES FFmpeg_DEFINITIONS)
186193
endif ()
187194

188195
# cache the vars.

include/AudioBufferSource.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
#include <iomanip>
4343
#include "JuceHeader.h"
4444

45-
using namespace std;
46-
4745
/// This namespace is the default namespace for all code in the openshot library
4846
namespace openshot
4947
{

include/AudioDeviceInfo.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@
3737
*
3838
* The type and name of the audio device.
3939
*/
40-
struct AudioDeviceInfo
41-
{
42-
string name;
43-
string type;
44-
};
45-
46-
#endif
40+
namespace openshot {
41+
struct AudioDeviceInfo
42+
{
43+
std::string name;
44+
std::string type;
45+
};
46+
}
47+
#endif

include/AudioReaderSource.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
#include "ReaderBase.h"
4444
#include "JuceHeader.h"
4545

46-
using namespace std;
47-
4846
/// This namespace is the default namespace for all code in the openshot library
4947
namespace openshot
5048
{

include/AudioResampler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ namespace openshot {
5757
private:
5858
juce::AudioSampleBuffer *buffer;
5959
juce::AudioSampleBuffer *resampled_buffer;
60-
AudioBufferSource *buffer_source;
60+
openshot::AudioBufferSource *buffer_source;
6161
juce::ResamplingAudioSource *resample_source;
6262
juce::AudioSourceChannelInfo resample_callback_buffer;
6363

include/CacheBase.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace openshot {
4949
class CacheBase
5050
{
5151
protected:
52-
string cache_type; ///< This is a friendly type name of the derived cache instance
52+
std::string cache_type; ///< This is a friendly type name of the derived cache instance
5353
int64_t max_bytes; ///< This is the max number of bytes to cache (0 = no limit)
5454

5555
/// Section lock for multiple threads
@@ -66,7 +66,7 @@ namespace openshot {
6666

6767
/// @brief Add a Frame to the cache
6868
/// @param frame The openshot::Frame object needing to be cached.
69-
virtual void Add(std::shared_ptr<Frame> frame) = 0;
69+
virtual void Add(std::shared_ptr<openshot::Frame> frame) = 0;
7070

7171
/// Clear the cache of all frames
7272
virtual void Clear() = 0;
@@ -76,13 +76,13 @@ namespace openshot {
7676

7777
/// @brief Get a frame from the cache
7878
/// @param frame_number The frame number of the cached frame
79-
virtual std::shared_ptr<Frame> GetFrame(int64_t frame_number) = 0;
79+
virtual std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) = 0;
8080

8181
/// Gets the maximum bytes value
8282
virtual int64_t GetBytes() = 0;
8383

8484
/// Get the smallest frame number
85-
virtual std::shared_ptr<Frame> GetSmallestFrame() = 0;
85+
virtual std::shared_ptr<openshot::Frame> GetSmallestFrame() = 0;
8686

8787
/// @brief Remove a specific frame
8888
/// @param frame_number The frame number of the cached frame
@@ -109,8 +109,8 @@ namespace openshot {
109109
void SetMaxBytesFromInfo(int64_t number_of_frames, int width, int height, int sample_rate, int channels);
110110

111111
/// Get and Set JSON methods
112-
virtual string Json() = 0; ///< Generate JSON string of this object
113-
virtual void SetJson(string value) = 0; ///< Load JSON string into this object
112+
virtual std::string Json() = 0; ///< Generate JSON string of this object
113+
virtual void SetJson(std::string value) = 0; ///< Load JSON string into this object
114114
virtual Json::Value JsonValue() = 0; ///< Generate Json::JsonValue for this object
115115
virtual void SetJsonValue(Json::Value root) = 0; ///< Load Json::JsonValue into this object
116116
virtual ~CacheBase() = default;

include/CacheDisk.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,24 @@ namespace openshot {
5353
class CacheDisk : public CacheBase {
5454
private:
5555
QDir path; ///< This is the folder path of the cache directory
56-
map<int64_t, int64_t> frames; ///< This map holds the frame number and Frame objects
57-
deque<int64_t> frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
58-
string image_format;
56+
std::map<int64_t, int64_t> frames; ///< This map holds the frame number and Frame objects
57+
std::deque<int64_t> frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
58+
std::string image_format;
5959
float image_quality;
6060
float image_scale;
6161

6262
int64_t frame_size_bytes; ///< The size of the cached frame in bytes
6363
bool needs_range_processing; ///< Something has changed, and the range data needs to be re-calculated
64-
string json_ranges; ///< JSON ranges of frame numbers
65-
vector<int64_t> ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
66-
map<int64_t, int64_t> frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
64+
std::string json_ranges; ///< JSON ranges of frame numbers
65+
std::vector<int64_t> ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
66+
std::map<int64_t, int64_t> frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
6767
int64_t range_version; ///< The version of the JSON range data (incremented with each change)
6868

6969
/// Clean up cached frames that exceed the max number of bytes
7070
void CleanUp();
7171

7272
/// Init path directory
73-
void InitPath(string cache_path);
73+
void InitPath(std::string cache_path);
7474

7575
/// Calculate ranges of frames
7676
void CalculateRanges();
@@ -81,22 +81,22 @@ namespace openshot {
8181
/// @param format The image format for disk caching (ppm, jpg, png)
8282
/// @param quality The quality of the image (1.0=highest quality/slowest speed, 0.0=worst quality/fastest speed)
8383
/// @param scale The scale factor for the preview images (1.0 = original size, 0.5=half size, 0.25=quarter size, etc...)
84-
CacheDisk(string cache_path, string format, float quality, float scale);
84+
CacheDisk(std::string cache_path, std::string format, float quality, float scale);
8585

8686
/// @brief Constructor that sets the max bytes to cache
8787
/// @param cache_path The folder path of the cache directory (empty string = /tmp/preview-cache/)
8888
/// @param format The image format for disk caching (ppm, jpg, png)
8989
/// @param quality The quality of the image (1.0=highest quality/slowest speed, 0.0=worst quality/fastest speed)
9090
/// @param scale The scale factor for the preview images (1.0 = original size, 0.5=half size, 0.25=quarter size, etc...)
9191
/// @param max_bytes The maximum bytes to allow in the cache. Once exceeded, the cache will purge the oldest frames.
92-
CacheDisk(string cache_path, string format, float quality, float scale, int64_t max_bytes);
92+
CacheDisk(std::string cache_path, std::string format, float quality, float scale, int64_t max_bytes);
9393

9494
// Default destructor
9595
~CacheDisk();
9696

9797
/// @brief Add a Frame to the cache
9898
/// @param frame The openshot::Frame object needing to be cached.
99-
void Add(std::shared_ptr<Frame> frame);
99+
void Add(std::shared_ptr<openshot::Frame> frame);
100100

101101
/// Clear the cache of all frames
102102
void Clear();
@@ -106,13 +106,13 @@ namespace openshot {
106106

107107
/// @brief Get a frame from the cache
108108
/// @param frame_number The frame number of the cached frame
109-
std::shared_ptr<Frame> GetFrame(int64_t frame_number);
109+
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number);
110110

111111
/// Gets the maximum bytes value
112112
int64_t GetBytes();
113113

114114
/// Get the smallest frame number
115-
std::shared_ptr<Frame> GetSmallestFrame();
115+
std::shared_ptr<openshot::Frame> GetSmallestFrame();
116116

117117
/// @brief Move frame to front of queue (so it lasts longer)
118118
/// @param frame_number The frame number of the cached frame
@@ -128,8 +128,8 @@ namespace openshot {
128128
void Remove(int64_t start_frame_number, int64_t end_frame_number);
129129

130130
/// Get and Set JSON methods
131-
string Json(); ///< Generate JSON string of this object
132-
void SetJson(string value); ///< Load JSON string into this object
131+
std::string Json(); ///< Generate JSON string of this object
132+
void SetJson(std::string value); ///< Load JSON string into this object
133133
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
134134
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
135135
};

include/CacheMemory.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ namespace openshot {
5050
*/
5151
class CacheMemory : public CacheBase {
5252
private:
53-
map<int64_t, std::shared_ptr<Frame> > frames; ///< This map holds the frame number and Frame objects
54-
deque<int64_t> frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
53+
std::map<int64_t, std::shared_ptr<openshot::Frame> > frames; ///< This map holds the frame number and Frame objects
54+
std::deque<int64_t> frame_numbers; ///< This queue holds a sequential list of cached Frame numbers
5555

5656
bool needs_range_processing; ///< Something has changed, and the range data needs to be re-calculated
57-
string json_ranges; ///< JSON ranges of frame numbers
58-
vector<int64_t> ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
59-
map<int64_t, int64_t> frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
57+
std::string json_ranges; ///< JSON ranges of frame numbers
58+
std::vector<int64_t> ordered_frame_numbers; ///< Ordered list of frame numbers used by cache
59+
std::map<int64_t, int64_t> frame_ranges; ///< This map holds the ranges of frames, useful for quickly displaying the contents of the cache
6060
int64_t range_version; ///< The version of the JSON range data (incremented with each change)
6161

6262
/// Clean up cached frames that exceed the max number of bytes
@@ -78,7 +78,7 @@ namespace openshot {
7878

7979
/// @brief Add a Frame to the cache
8080
/// @param frame The openshot::Frame object needing to be cached.
81-
void Add(std::shared_ptr<Frame> frame);
81+
void Add(std::shared_ptr<openshot::Frame> frame);
8282

8383
/// Clear the cache of all frames
8484
void Clear();
@@ -88,13 +88,13 @@ namespace openshot {
8888

8989
/// @brief Get a frame from the cache
9090
/// @param frame_number The frame number of the cached frame
91-
std::shared_ptr<Frame> GetFrame(int64_t frame_number);
91+
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number);
9292

9393
/// Gets the maximum bytes value
9494
int64_t GetBytes();
9595

9696
/// Get the smallest frame number
97-
std::shared_ptr<Frame> GetSmallestFrame();
97+
std::shared_ptr<openshot::Frame> GetSmallestFrame();
9898

9999
/// @brief Move frame to front of queue (so it lasts longer)
100100
/// @param frame_number The frame number of the cached frame
@@ -110,8 +110,8 @@ namespace openshot {
110110
void Remove(int64_t start_frame_number, int64_t end_frame_number);
111111

112112
/// Get and Set JSON methods
113-
string Json(); ///< Generate JSON string of this object
114-
void SetJson(string value); ///< Load JSON string into this object
113+
std::string Json(); ///< Generate JSON string of this object
114+
void SetJson(std::string value); ///< Load JSON string into this object
115115
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
116116
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
117117
};

0 commit comments

Comments
 (0)