File: fix_examples.patch

package info (click to toggle)
libopenshot 0.5.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,228 kB
  • sloc: cpp: 32,692; python: 92; sh: 67; makefile: 21; ruby: 5
file content (102 lines) | stat: -rwxr-xr-x 3,906 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Description: Fix examples
Author: Anton Gladky <gladk@debian.org>
Last-Update: 2025-10-17

Index: libopenshot-0.5.0/examples/CMakeLists.txt
===================================================================
--- libopenshot-0.5.0.orig/examples/CMakeLists.txt
+++ libopenshot-0.5.0/examples/CMakeLists.txt
@@ -9,10 +9,23 @@
 #
 # SPDX-License-Identifier: LGPL-3.0-or-later
 
+cmake_minimum_required(VERSION 3.10)
+project(libopenshot-examples)
+
 include(GNUInstallDirs)
 
 # Dependencies
-find_package(Qt5 COMPONENTS Gui REQUIRED)
+find_package(Qt5 COMPONENTS Gui Widgets REQUIRED)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(JSONCPP REQUIRED jsoncpp)
+
+# Find the openshot library and get its include directories
+find_library(OPENSHOT_LIB openshot)
+find_path(OPENSHOT_INCLUDE_DIR NAMES OpenShot.h PATHS /usr/include/libopenshot /usr/local/include/libopenshot)
+
+# Find the openshot library and get its include directories
+find_library(OPENSHOT_AUDIO_LIB openshot-audio)
+find_path(OPENSHOT_AUDIO_INCLUDE_DIR NAMES AppConfig.h PATHS /usr/include/libopenshot-audio /usr/local/include/libopenshot-audio)
 
 ############### CLI EXECUTABLES ################
 # Create test executable
@@ -24,23 +37,28 @@ target_compile_definitions(openshot-exam
 	-DTEST_MEDIA_PATH="${TEST_MEDIA_PATH}" )
 
 # Link test executable to the new library
-target_link_libraries(openshot-example openshot)
+target_link_libraries(openshot-example openshot openshot-audio Qt5::Gui)
+
+# Include directories for installed headers
+target_include_directories(openshot-example PRIVATE ${OPENSHOT_INCLUDE_DIR} ${OPENSHOT_AUDIO_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIRS})
 
 add_executable(openshot-html-example ExampleHtml.cpp)
-target_link_libraries(openshot-html-example openshot Qt5::Gui)
+target_link_libraries(openshot-html-example openshot openshot-audio Qt5::Gui)
+target_include_directories(openshot-html-example PRIVATE ${OPENSHOT_INCLUDE_DIR} ${OPENSHOT_AUDIO_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIRS})
 
 ############### PLAYER EXECUTABLE ################
 # Create test executable
 add_executable(openshot-player qt-demo/main.cpp)
 
 set_target_properties(openshot-player
-  PROPERTIES
-    AUTOMOC ON
-    WIN32_EXECUTABLE ON
+	PROPERTIES
+	AUTOMOC ON
+	AUTOUIC ON
+	WIN32_EXECUTABLE ON
 )
 
-# Link test executable to the new library
-target_link_libraries(openshot-player openshot)
+target_link_libraries(openshot-player openshot openshot-audio Qt5::Gui Qt5::Widgets)
+target_include_directories(openshot-player PRIVATE ${OPENSHOT_INCLUDE_DIR} ${OPENSHOT_AUDIO_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIRS})
 
 ############### OPENCV EXAMPLE ################
 #if (DEFINED CACHE{HAVE_OPENCV})
Index: libopenshot-0.5.0/CMakeLists.txt
===================================================================
--- libopenshot-0.5.0.orig/CMakeLists.txt
+++ libopenshot-0.5.0/CMakeLists.txt
@@ -130,7 +130,7 @@ endif()
 ### Process subdirectories
 ###
 add_subdirectory(src)
-add_subdirectory(examples)
+#add_subdirectory(examples)
 add_subdirectory(bindings)
 
 ###
--- libopenshot-0.5.0+dfsg1.orig/examples/Example.cpp
+++ libopenshot-0.5.0+dfsg1/examples/Example.cpp
@@ -25,7 +25,7 @@ int main(int argc, char* argv[]) {
 
 
     // 1) Open the FFmpegReader as usual
-    const char* input_path = "/home/jonathan/Downloads/openshot-testing/sintel_trailer-720p.mp4";
+    const char* input_path = "sintel_trailer-720p.mp4";
     FFmpegReader reader(input_path);
     reader.Open();
 
@@ -48,7 +48,7 @@ int main(int argc, char* argv[]) {
     cache->StartThread();      // juce::Thread method, begins run()
 
     // 3) Set up the writer exactly as before
-    FFmpegWriter writer("/home/jonathan/Downloads/performance‐cachetest.mp4");
+    FFmpegWriter writer("performance-cachetest.mp4");
     writer.SetAudioOptions("aac", 48000, 192000);
     writer.SetVideoOptions("libx264", 1280, 720, Fraction(30, 1), 5000000);
     writer.Open();