Skip to content

Commit

Permalink
Resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennoCaldato committed Oct 20, 2020
1 parent 1626e1e commit a9274df
Show file tree
Hide file tree
Showing 30 changed files with 314 additions and 351 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
87 changes: 46 additions & 41 deletions src/CMakeLists.txt
Expand Up @@ -114,6 +114,52 @@ if (ENABLE_BLACKMAGIC)

endif()

################ OPENCV ##################

find_package( OpenCV 4 )
if (OpenCV_FOUND)
message("\nCOMPILING WITH OPENCV\n")
set(CMAKE_SWIG_FLAGS "-DUSE_OPENCV=1")
add_definitions( -DUSE_OPENCV=1 )
else()
message("\nOPENCV NOT FOUND, SOME FUNCTIONALITIES WILL BE DISABLED\n")
endif()

################ PROTOBUF ##################
if (OpenCV_FOUND)
find_package(Protobuf 3)

if (NOT Protobuf_FOUND)
# Protobuf is required when compiling with opencv
message(FATAL_ERROR "\nPLEASE INSTALL PROTOBUF. Protobuf is required when compiling with opencv.\n")
endif()

include_directories(${PROTOBUF_INCLUDE_DIR})

set(PROTOBUF_MESSAGES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/protobuf_messages")

FILE(GLOB PROTO_MSGS "${PROTOBUF_MESSAGES_FOLDER}/*.proto")
foreach(PROTO_MSG ${PROTO_MSGS})
execute_process (
COMMAND bash -c "${PROTOBUF_PROTOC_EXECUTABLE} -I=${PROTOBUF_MESSAGES_FOLDER} --cpp_out=${PROTOBUF_MESSAGES_FOLDER} ${PROTO_MSG}"
)
endforeach()

FILE(GLOB PROTO_CCS "${PROTOBUF_MESSAGES_FOLDER}/*.pb.cc")
foreach(PROTO_CC ${PROTO_CCS})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${PROTO_CC} ${CMAKE_CURRENT_SOURCE_DIR})
file(REMOVE ${PROTO_CC})
endforeach()

FILE(GLOB PROTO_HS "${PROTOBUF_MESSAGES_FOLDER}/*.pb.h")
foreach(PROTO_H ${PROTO_HS})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${PROTO_H} ${CMAKE_CURRENT_SOURCE_DIR})
file(REMOVE ${PROTO_H})
endforeach()

endif()


############### PROFILING #################
#set(PROFILER "/usr/lib/libprofiler.so.0.3.2")
#set(PROFILER "/usr/lib/libtcmalloc.so.4")
Expand Down Expand Up @@ -515,45 +561,6 @@ endif()
### INSTALL HEADERS & LIBRARY
###

############### CLI EXECUTABLES ################
# Create test executable
add_executable(openshot-example examples/Example.cpp)


# Define path to test input files
set(TEST_MEDIA_PATH "${PROJECT_SOURCE_DIR}/src/examples/")
if (WIN32)
string(REPLACE "/" "\\\\" TEST_MEDIA_PATH TEST_MEDIA_PATH)
endif()
target_compile_definitions(openshot-example PRIVATE
-DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )

# Link test executable to the new library
target_link_libraries(openshot-example openshot)


add_executable(openshot-html-test examples/ExampleHtml.cpp)
target_link_libraries(openshot-html-test openshot Qt5::Gui)

############### OPENCV EXAMPLE EXECUTABLE ################
if (OpenCV_FOUND)
# Create test Opencv executable
add_executable( openshotCV-example examples/Example_opencv.cpp )
# Define path to test input files
target_link_libraries( openshotCV-example ${OpenCV_LIBS} openshot)
target_compile_definitions(openshotCV-example PRIVATE
-DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
# Link test executable to the new library
target_link_libraries(openshot-example openshot)
endif()


############### PLAYER EXECUTABLE ################
# Create test executable
add_executable(openshot-player Qt/demo/main.cpp)

# Link test executable to the new library
target_link_libraries(openshot-player openshot)

############### TEST BLACKMAGIC CAPTURE APP ################
if (BLACKMAGIC_FOUND)
Expand All @@ -565,8 +572,6 @@ if (BLACKMAGIC_FOUND)
target_link_libraries(openshot-blackmagic openshot)
endif()

############### INCLUDE SWIG BINDINGS ################
add_subdirectory(bindings)

############### INSTALL HEADERS & LIBRARY ################

Expand Down
2 changes: 1 addition & 1 deletion src/CVObjectDetection.cpp
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../include/CVObjectDetection.h"
#include "CVObjectDetection.h"

// // Initialize the parameters
// float confThreshold = 0.5; // Confidence threshold
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/CVStabilization.cpp
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../include/CVStabilization.h"
#include "CVStabilization.h"

// Set default smoothing window value to compute stabilization
CVStabilization::CVStabilization(std::string processInfoJson, ProcessingController &processingController)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/CVTracker.cpp
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../include/CVTracker.h"
#include "CVTracker.h"

// Constructor
CVTracker::CVTracker(std::string processInfoJson, ProcessingController &processingController)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ClipProcessingJobs.cpp
@@ -1,4 +1,4 @@
#include "../include/ClipProcessingJobs.h"
#include "ClipProcessingJobs.h"

// Constructor responsible to choose processing type and apply to clip
ClipProcessingJobs::ClipProcessingJobs(std::string processingType, std::string processInfoJson) :
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/Frame.cpp
Expand Up @@ -939,6 +939,7 @@ std::shared_ptr<QImage> Frame::GetImage()
}

#ifdef USE_OPENCV

// Convert Qimage to Mat
cv::Mat Frame::Qimage2mat( std::shared_ptr<QImage>& qimage) {

Expand Down
File renamed without changes.
35 changes: 2 additions & 33 deletions src/effects/ObjectDetection.cpp
Expand Up @@ -28,39 +28,8 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../include/effects/ObjectDetection.h"

/**
* @file
* @brief Source file for Tracker effect class
* @author Jonathan Thomas <jonathan@openshot.org>
*
* @ref License
*/

/* LICENSE
*
* Copyright (c) 2008-2019 OpenShot Studios, LLC
* <http://www.openshotstudios.com/>. This file is part of
* OpenShot Library (libopenshot), an open-source project dedicated to
* delivering high quality video editing and animation solutions to the
* world. For more information visit <http://www.openshot.org/>.
*
* OpenShot Library (libopenshot) is free software: you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* OpenShot Library (libopenshot) is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../include/effects/Tracker.h"
#include "effects/ObjectDetection.h"
#include "effects/Tracker.h"

using namespace openshot;

Expand Down
Expand Up @@ -98,7 +98,9 @@ namespace openshot
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;


std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::shared_ptr<Frame> (new Frame()), frame_number); }

// Load protobuf data file
bool LoadObjDetectdData(std::string inputFilePath);

Expand Down
3 changes: 1 addition & 2 deletions src/effects/Stabilizer.cpp
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../include/effects/Stabilizer.h"
#include "effects/Stabilizer.h"

using namespace openshot;

Expand All @@ -46,7 +46,6 @@ Stabilizer::Stabilizer()
{
// Init effect properties
init_effect_details();
// LoadStabilizedData("/home/gustavostahl/LabVisao/VideoEditor/openshot-qt/stabilization.data");
}

// Init effect settings
Expand Down
2 changes: 2 additions & 0 deletions include/effects/Stabilizer.h → src/effects/Stabilizer.h
Expand Up @@ -114,6 +114,8 @@ namespace openshot
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;

std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::shared_ptr<Frame> (new Frame()), frame_number); }

// Load protobuf data file
bool LoadStabilizedData(std::string inputFilePath);

Expand Down
2 changes: 1 addition & 1 deletion src/effects/Tracker.cpp
Expand Up @@ -28,7 +28,7 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "../../include/effects/Tracker.h"
#include "effects/Tracker.h"

using namespace openshot;

Expand Down
3 changes: 2 additions & 1 deletion include/effects/Tracker.h → src/effects/Tracker.h
Expand Up @@ -111,7 +111,8 @@ namespace openshot
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;

std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::shared_ptr<Frame> (new Frame()), frame_number); }

// Load protobuf data file
bool LoadTrackedData(std::string inputFilePath);

Expand Down

0 comments on commit a9274df

Please sign in to comment.