Skip to content

Commit 97f6590

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents cc1f822 + c271352 commit 97f6590

File tree

18 files changed

+1207
-75
lines changed

18 files changed

+1207
-75
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ linux-builder:
1717
- export LIBOPENSHOT_AUDIO_DIR=$CI_PROJECT_DIR/build/install-x64
1818
- mkdir -p build; cd build;
1919
- mkdir -p install-x64/python;
20-
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"CMAKE_BUILD_TYPE:STRING=Release" ../
20+
- cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -D"CMAKE_INSTALL_PREFIX:PATH=$CI_PROJECT_DIR/build/install-x64" -D"CMAKE_BUILD_TYPE:STRING=Release" -D"USE_SYSTEM_JSONCPP=0" ../
2121
- make
2222
- make install
2323
- make doc
@@ -70,7 +70,6 @@ windows-builder-x64:
7070
- Expand-Archive -Path artifacts.zip -DestinationPath .
7171
- $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x64"
7272
- $env:UNITTEST_DIR = "C:\msys64\usr"
73-
- $env:ZMQDIR = "C:\msys64\usr"
7473
- $env:RESVGDIR = "C:\msys64\usr"
7574
- $env:Path = "C:\msys64\mingw64\bin;C:\msys64\mingw64\lib;C:\msys64\usr\lib\cmake\UnitTest++;C:\msys64\home\jonathan\depot_tools;C:\msys64\usr;C:\msys64\usr\lib;" + $env:Path;
7675
- New-Item -ItemType Directory -Force -Path build
@@ -101,7 +100,6 @@ windows-builder-x86:
101100
- $env:LIBOPENSHOT_AUDIO_DIR = "$CI_PROJECT_DIR\build\install-x86"
102101
- $env:UNITTEST_DIR = "C:\msys32\usr"
103102
- $env:RESVGDIR = "C:\msys32\usr"
104-
- $env:ZMQDIR = "C:\msys32\usr"
105103
- $env:Path = "C:\msys32\mingw32\bin;C:\msys32\mingw32\lib;C:\msys32\usr\lib\cmake\UnitTest++;C:\msys32\home\jonathan\depot_tools;C:\msys32\usr;C:\msys32\usr\lib;" + $env:Path;
106104
- New-Item -ItemType Directory -Force -Path build
107105
- New-Item -ItemType Directory -Force -Path build\install-x86\python

.travis.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: cpp
2+
compiler: gcc
23

34
# This section uses a rather esoteric (and tricky!) feature of YAML,
45
# &aliases and *anchors, to build package lists out of sublists without
@@ -32,7 +33,7 @@ addons:
3233

3334
matrix:
3435
include:
35-
- name: "FFmpeg 2 (Ubuntu 16.04 Xenial)"
36+
- name: "FFmpeg 2 GCC (Ubuntu 16.04 Xenial)"
3637
env: BUILD_VERSION=ffmpeg2
3738
os: linux
3839
dist: xenial
@@ -44,7 +45,7 @@ matrix:
4445
packages:
4546
- *ff_common
4647

47-
- name: "FFmpeg 3 (Ubuntu 18.04 Bionic)"
48+
- name: "FFmpeg 3 GCC (Ubuntu 18.04 Bionic)"
4849
env: BUILD_VERSION=ffmpeg3
4950
os: linux
5051
dist: bionic
@@ -57,7 +58,7 @@ matrix:
5758
- *ff_common
5859
- qt5-default
5960

60-
- name: "FFmpeg 4 (Ubuntu 18.04 Bionic)"
61+
- name: "FFmpeg 4 GCC (Ubuntu 18.04 Bionic)"
6162
env: BUILD_VERSION=ffmpeg4
6263
os: linux
6364
dist: bionic
@@ -80,6 +81,21 @@ matrix:
8081
- libavresample4
8182
- libswresample3
8283

84+
- name: "FFmpeg 3 Clang (Ubuntu 18.04 Bionic)"
85+
env: BUILD_VERSION=ffmpeg3
86+
os: linux
87+
dist: bionic
88+
compiler: clang
89+
addons:
90+
apt:
91+
sources:
92+
- sourceline: 'ppa:openshot.developers/libopenshot-daily'
93+
- sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic'
94+
packages:
95+
- *ff_common
96+
- qt5-default
97+
- libomp-dev
98+
8399
script:
84100
- mkdir -p build; cd build;
85101
- cmake -DCMAKE_BUILD_TYPE:STRING="Debug" ../

cmake/Modules/FindZeroMQ.cmake

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
2+
find_package(PkgConfig)
3+
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
4+
5+
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
6+
7+
find_path(ZeroMQ_INCLUDE_DIR zmq.h
8+
PATHS ${ZeroMQ_DIR}/include
9+
${PC_LIBZMQ_INCLUDE_DIRS})
10+
11+
find_library(ZeroMQ_LIBRARY
12+
NAMES zmq
13+
PATHS ${ZeroMQ_DIR}/lib
14+
${PC_LIBZMQ_LIBDIR}
15+
${PC_LIBZMQ_LIBRARY_DIRS})
16+
17+
if(ZeroMQ_LIBRARY)
18+
set(ZeroMQ_FOUND ON)
19+
endif()
20+
21+
set ( ZeroMQ_LIBRARIES ${ZeroMQ_LIBRARY} )
22+
set ( ZeroMQ_INCLUDE_DIRS ${ZeroMQ_INCLUDE_DIR} )
23+
24+
if(NOT TARGET libzmq)
25+
add_library(libzmq UNKNOWN IMPORTED)
26+
set_target_properties(libzmq PROPERTIES
27+
IMPORTED_LOCATION ${ZeroMQ_LIBRARIES}
28+
INTERFACE_INCLUDE_DIRECTORIES ${ZeroMQ_INCLUDE_DIRS})
29+
endif()
30+
31+
include ( FindPackageHandleStandardArgs )
32+
# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
33+
# if all listed variables are TRUE
34+
find_package_handle_standard_args ( ZeroMQ DEFAULT_MSG ZeroMQ_LIBRARIES ZeroMQ_INCLUDE_DIRS )

include/KeyFrame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace openshot {
9898
/// Default constructor for the Keyframe class
9999
Keyframe();
100100

101-
/// Constructor which sets the default point & coordinate at X=0
101+
/// Constructor which sets the default point & coordinate at X=1
102102
Keyframe(double value);
103103

104104
/// Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle.

include/OpenShot.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@
135135
#include "PlayerBase.h"
136136
#include "Point.h"
137137
#include "Profiles.h"
138+
#include "QtHtmlReader.h"
138139
#include "QtImageReader.h"
140+
#include "QtTextReader.h"
139141
#include "Timeline.h"
140142
#include "Settings.h"
141143

include/QtHtmlReader.h

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/**
2+
* @file
3+
* @brief Header file for QtHtmlReader class
4+
* @author Jonathan Thomas <[email protected]>
5+
* @author Sergei Kolesov (jediserg)
6+
* @author Jeff Shillitto (jeffski)
7+
*
8+
* @ref License
9+
*/
10+
11+
/* LICENSE
12+
*
13+
* Copyright (c) 2008-2019 OpenShot Studios, LLC
14+
* <http://www.openshotstudios.com/>. This file is part of
15+
* OpenShot Library (libopenshot), an open-source project dedicated to
16+
* delivering high quality video editing and animation solutions to the
17+
* world. For more information visit <http://www.openshot.org/>.
18+
*
19+
* OpenShot Library (libopenshot) is free software: you can redistribute it
20+
* and/or modify it under the terms of the GNU Lesser General Public License
21+
* as published by the Free Software Foundation, either version 3 of the
22+
* License, or (at your option) any later version.
23+
*
24+
* OpenShot Library (libopenshot) is distributed in the hope that it will be
25+
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
26+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+
* GNU Lesser General Public License for more details.
28+
*
29+
* You should have received a copy of the GNU Lesser General Public License
30+
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
31+
*/
32+
33+
#ifndef OPENSHOT_QT_HTML_READER_H
34+
#define OPENSHOT_QT_HTML_READER_H
35+
36+
#include "ReaderBase.h"
37+
38+
#include <cmath>
39+
#include <ctime>
40+
#include <iostream>
41+
#include <omp.h>
42+
#include <stdio.h>
43+
#include <memory>
44+
#include "CacheMemory.h"
45+
#include "Enums.h"
46+
#include "Exceptions.h"
47+
48+
class QImage;
49+
50+
namespace openshot
51+
{
52+
53+
/**
54+
* @brief This class uses Qt libraries, to create frames with rendered HTML, and return
55+
* openshot::Frame objects.
56+
*
57+
* Supports HTML/CSS subset available via Qt libraries, see: https://doc.qt.io/qt-5/richtext-html-subset.html
58+
*
59+
* @code
60+
* // Any application using this class must instantiate either QGuiApplication or QApplication
61+
* QApplication a(argc, argv);
62+
*
63+
* // Create a reader to generate an openshot::Frame containing text
64+
* QtHtmlReader r(720, // width
65+
* 480, // height
66+
* 5, // x_offset
67+
* 5, // y_offset
68+
* GRAVITY_CENTER, // gravity
69+
* "<b>Check out</b> this Text!", // html
70+
* "b { color: #ff0000 }", // css
71+
* "#000000" // background_color
72+
* );
73+
* r.Open(); // Open the reader
74+
*
75+
* // Get frame number 1 from the video (in fact, any frame # you request will return the same frame)
76+
* std::shared_ptr<Frame> f = r.GetFrame(1);
77+
*
78+
* // Now that we have an openshot::Frame object, lets have some fun!
79+
* f->Display(); // Display the frame on the screen
80+
*
81+
* // Close the reader
82+
* r.Close();
83+
* @endcode
84+
*/
85+
class QtHtmlReader : public ReaderBase
86+
{
87+
private:
88+
int width;
89+
int height;
90+
int x_offset;
91+
int y_offset;
92+
std::string html;
93+
std::string css;
94+
std::string background_color;
95+
std::shared_ptr<QImage> image;
96+
bool is_open;
97+
openshot::GravityType gravity;
98+
public:
99+
100+
/// Default constructor (blank text)
101+
QtHtmlReader();
102+
103+
/// @brief Constructor for QtHtmlReader with all parameters.
104+
/// @param width The width of the requested openshot::Frame (not the size of the text)
105+
/// @param height The height of the requested openshot::Frame (not the size of the text)
106+
/// @param x_offset The number of pixels to offset the text on the X axis (horizontal)
107+
/// @param y_offset The number of pixels to offset the text on the Y axis (vertical)
108+
/// @param gravity The alignment / gravity of the text
109+
/// @param html The HTML you want to render / display
110+
/// @param css The CSS you want to apply to style the HTML
111+
/// @param background_color The background color of the frame image (valid values are a color string in #RRGGBB or #AARRGGBB notation, a CSS color name, or 'transparent')
112+
QtHtmlReader(int width, int height, int x_offset, int y_offset, GravityType gravity, std::string html, std::string css, std::string background_color);
113+
114+
/// Close Reader
115+
void Close();
116+
117+
/// Get the cache object used by this reader (always returns NULL for this object)
118+
openshot::CacheMemory* GetCache() { return NULL; };
119+
120+
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
121+
/// return the same Frame, since they all share the same image data.
122+
///
123+
/// @returns The requested frame (containing the image)
124+
/// @param requested_frame The frame number that is requested.
125+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
126+
127+
/// Determine if reader is open or closed
128+
bool IsOpen() { return is_open; };
129+
130+
/// Return the type name of the class
131+
std::string Name() { return "QtHtmlReader"; };
132+
133+
/// Get and Set JSON methods
134+
std::string Json(); ///< Generate JSON string of this object
135+
void SetJson(std::string value); ///< Load JSON string into this object
136+
Json::Value JsonValue(); ///< Generate Json::JsonValue for this object
137+
void SetJsonValue(Json::Value root); ///< Load Json::JsonValue into this object
138+
139+
/// Open Reader - which is called by the constructor automatically
140+
void Open();
141+
};
142+
143+
}
144+
145+
#endif

0 commit comments

Comments
 (0)