Skip to content

Commit fc3fa0e

Browse files
committed
Merge branch 'master' of https://github.com/olive-editor/olive into ci-update-2022-12-11
2 parents 6bfcdd1 + 3bc53ce commit fc3fa0e

406 files changed

Lines changed: 10193 additions & 19493 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
steps:
5757
- name: Checkout Source Code
5858
uses: actions/checkout@v3
59+
with:
60+
submodules: 'true'
5961

6062
- name: Generate Patreon List
6163
env:
@@ -156,6 +158,8 @@ jobs:
156158
steps:
157159
- name: Checkout Source Code
158160
uses: actions/checkout@v3
161+
with:
162+
submodules: 'true'
159163

160164
- name: Automatically Generate Package Name
161165
shell: bash
@@ -176,10 +180,10 @@ jobs:
176180
shell: bash
177181
working-directory: ${{ runner.workspace }}
178182
run: |
179-
$DOWNLOAD_TOOL https://github.com/olive-editor/vcpkg-registry/releases/download/continuous/olive-dep-x64-windows.zip
180-
7z x olive-dep-x64-windows.zip
181-
VCPKG_DIR=(vcpkg-export-*)
182-
echo "VCPKG_ROOT=$(pwd -W)/$VCPKG_DIR" >> $GITHUB_ENV
183+
$DOWNLOAD_TOOL https://github.com/olive-editor/dependencies/releases/download/continuous/olive-dep-win32-Release.tar.gz
184+
tar xzf olive-dep-win32-Release.tar.gz
185+
echo "$(pwd -W)/install" >> $GITHUB_PATH
186+
echo "$(pwd -W)/install/bin" >> $GITHUB_PATH
183187
184188
- name: Acquire Google Crashpad
185189
shell: bash
@@ -207,7 +211,6 @@ jobs:
207211
working-directory: ${{ runner.workspace }}/build
208212
run: |
209213
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -G "${{ matrix.cmake-gen }}" \
210-
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \
211214
$CMAKE_ARGS
212215
213216
- name: Build
@@ -216,11 +219,11 @@ jobs:
216219
run: |
217220
cmake --build .
218221
219-
- name: Test
220-
working-directory: ${{ runner.workspace }}/build
221-
shell: bash
222-
run: |
223-
PATH=$PATH:$VCPKG_ROOT/installed/x64-windows/bin ctest -C ${{ matrix.build-type }} -V
222+
#- name: Test
223+
# working-directory: ${{ runner.workspace }}/build
224+
# shell: bash
225+
# run: |
226+
# ctest -C ${{ matrix.build-type }} -V
224227

225228
- name: Create Package
226229
working-directory: ${{ runner.workspace }}/build
@@ -232,9 +235,8 @@ jobs:
232235
cp app/olive-editor.exe olive-editor
233236
cp app/crashhandler/olive-crashhandler.exe olive-editor
234237
cp app/olive-editor.pdb olive-editor
235-
$VCPKG_ROOT/installed/x64-windows/tools/qt5/bin/windeployqt --no-angle olive-editor/olive-crashhandler.exe
236-
$VCPKG_ROOT/installed/x64-windows/tools/qt5/bin/windeployqt --no-angle olive-editor/olive-editor.exe
237-
cp $(cygpath $VCPKG_ROOT)/installed/x64-windows/bin/*.dll olive-editor
238+
windeployqt --no-angle olive-editor/olive-crashhandler.exe
239+
windeployqt --no-angle olive-editor/olive-editor.exe
238240
cp $(cygpath $ORIGINAL_WORKSPACE)/install/bin/*.dll olive-editor
239241
cp $(cygpath $ORIGINAL_WORKSPACE)/install/crashpad/out/Default/crashpad_handler.exe olive-editor
240242
cp $(cygpath $ORIGINAL_WORKSPACE)/install/bin/minidump_stackwalk.exe olive-editor
@@ -287,7 +289,7 @@ jobs:
287289
compiler-name: Clang LLVM
288290
os-name: macOS
289291
os-arch: x86_64
290-
os: macos-10.15
292+
os: macos-11.0
291293
cmake-gen: Ninja
292294
min-deploy: 10.13
293295
- build-type: RelWithDebInfo
@@ -310,6 +312,8 @@ jobs:
310312
steps:
311313
- name: Checkout Source Code
312314
uses: actions/checkout@v3
315+
with:
316+
submodules: 'true'
313317

314318
- name: Automatically Generate Package Name
315319
shell: bash

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "ext/core"]
2+
path = ext/core
3+
url = https://github.com/olive-editor/core
4+
[submodule "ext/KDDockWidgets"]
5+
path = ext/KDDockWidgets
6+
url = https://github.com/KDAB/KDDockWidgets

CMakeLists.txt

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Olive - Non-Linear Video Editor
2-
# Copyright (C) 2022 Olive Team
2+
# Copyright (C) 2023 Olive Studios LLC
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
1818

1919
project(olive-editor VERSION 0.2.0 LANGUAGES CXX)
2020

21+
option(BUILD_QT6 "Build with Qt 6 over 5 (experimental)" OFF)
2122
option(BUILD_DOXYGEN "Build Doxygen documentation" OFF)
2223
option(BUILD_TESTS "Build unit tests" OFF)
2324
option(USE_WERROR "Error on compile warning" OFF)
@@ -94,6 +95,10 @@ find_package(OpenEXR REQUIRED)
9495
list(APPEND OLIVE_LIBRARIES ${OPENEXR_LIBRARIES})
9596
list(APPEND OLIVE_INCLUDE_DIRS ${OPENEXR_INCLUDES})
9697

98+
# Link Olive
99+
list(APPEND OLIVE_LIBRARIES olivecore)
100+
list(APPEND OLIVE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/core/include)
101+
97102
# Link Qt
98103
set(QT_LIBRARIES
99104
Core
@@ -106,10 +111,14 @@ set(QT_LIBRARIES
106111
if (UNIX AND NOT APPLE)
107112
list(APPEND QT_LIBRARIES DBus)
108113
endif()
114+
if (BUILD_QT6)
115+
set(QT_NAME Qt6)
116+
else()
117+
set(QT_NAME Qt5)
118+
endif()
109119
find_package(QT
110120
NAMES
111-
Qt6
112-
Qt5
121+
${QT_NAME}
113122
REQUIRED
114123
COMPONENTS
115124
${QT_LIBRARIES}
@@ -142,8 +151,18 @@ if (${QT_VERSION_MAJOR} EQUAL "6")
142151
list(APPEND OLIVE_LIBRARIES
143152
Qt${QT_VERSION_MAJOR}::OpenGLWidgets
144153
)
154+
155+
# Link KDDockWidgets
156+
#find_package(KDDockWidgets-qt6 CONFIG REQUIRED)
157+
else()
158+
# Link KDDockWidgets
159+
#find_package(KDDockWidgets CONFIG REQUIRED)
145160
endif()
146161

162+
list(APPEND OLIVE_LIBRARIES
163+
KDAB::kddockwidgets
164+
)
165+
147166
# Link FFmpeg
148167
find_package(FFMPEG 3.0 REQUIRED
149168
COMPONENTS
@@ -233,9 +252,10 @@ endif()
233252
set(CMAKE_INCLUDE_CURRENT_DIR ON)
234253
list(APPEND OLIVE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/ext)
235254

255+
add_subdirectory(ext)
236256
add_subdirectory(app)
237257

238258
if (BUILD_TESTS)
239-
enable_testing()
240-
add_subdirectory(tests)
259+
enable_testing()
260+
add_subdirectory(tests)
241261
endif()

app/audio/audiomanager.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int InputCallback(const void *input, void *output, unsigned long frameCount, con
7373
FFmpegEncoder *f = static_cast<FFmpegEncoder*>(userData);
7474

7575
AudioParams our_params = f->params().audio_params();
76-
our_params.set_format(AudioParams::GetPackedEquivalent(f->params().audio_params().format()));
76+
our_params.set_format(f->params().audio_params().format().to_packed_equivalent());
7777

7878
f->WriteAudioData(our_params, reinterpret_cast<const uint8_t**>(&input), frameCount);
7979

@@ -119,27 +119,27 @@ void AudioManager::ClearBufferedOutput()
119119
output_buffer_->clear();
120120
}
121121

122-
PaSampleFormat AudioManager::GetPortAudioSampleFormat(AudioParams::Format fmt)
122+
PaSampleFormat AudioManager::GetPortAudioSampleFormat(SampleFormat fmt)
123123
{
124124
switch (fmt) {
125-
case AudioParams::kFormatUnsigned8Packed:
126-
case AudioParams::kFormatUnsigned8Planar:
125+
case SampleFormat::U8:
126+
case SampleFormat::U8P:
127127
return paUInt8;
128-
case AudioParams::kFormatSigned16Packed:
129-
case AudioParams::kFormatSigned16Planar:
128+
case SampleFormat::S16:
129+
case SampleFormat::S16P:
130130
return paInt16;
131-
case AudioParams::kFormatSigned32Packed:
132-
case AudioParams::kFormatSigned32Planar:
131+
case SampleFormat::S32:
132+
case SampleFormat::S32P:
133133
return paInt32;
134-
case AudioParams::kFormatFloat32Packed:
135-
case AudioParams::kFormatFloat32Planar:
134+
case SampleFormat::F32:
135+
case SampleFormat::F32P:
136136
return paFloat32;
137-
case AudioParams::kFormatSigned64Packed:
138-
case AudioParams::kFormatSigned64Planar:
139-
case AudioParams::kFormatFloat64Packed:
140-
case AudioParams::kFormatFloat64Planar:
141-
case AudioParams::kFormatInvalid:
142-
case AudioParams::kFormatCount:
137+
case SampleFormat::S64:
138+
case SampleFormat::S64P:
139+
case SampleFormat::F64:
140+
case SampleFormat::F64P:
141+
case SampleFormat::INVALID:
142+
case SampleFormat::COUNT:
143143
break;
144144
}
145145

app/audio/audiomanager.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "audio/audioprocessor.h"
3131
#include "common/define.h"
3232
#include "codec/ffmpeg/ffmpegencoder.h"
33-
#include "render/audioparams.h"
3433
#include "render/audioplaybackcache.h"
3534
#include "render/previewaudiodevice.h"
3635

@@ -94,7 +93,7 @@ class AudioManager : public QObject
9493

9594
virtual ~AudioManager() override;
9695

97-
static PaSampleFormat GetPortAudioSampleFormat(AudioParams::Format fmt);
96+
static PaSampleFormat GetPortAudioSampleFormat(SampleFormat fmt);
9897

9998
void CloseOutputStream();
10099

app/audio/audioprocessor.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ extern "C" {
2525
#include <libavfilter/buffersink.h>
2626
}
2727

28+
#include <QDebug>
29+
2830
#include "common/ffmpegutils.h"
2931

3032
namespace olive {
@@ -88,13 +90,13 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to, double
8890
double speed_log = log(tempo) / log(base);
8991

9092
// This is the number of how many 0.5 or 2.0 tempos we need to daisychain
91-
int whole = qFloor(speed_log);
93+
int whole = std::floor(speed_log);
9294

9395
// Set speed_log to the remainder
9496
speed_log -= whole;
9597

9698
for (int i=0;i<=whole;i++) {
97-
double filter_tempo = (i == whole) ? qPow(base, speed_log) : base;
99+
double filter_tempo = (i == whole) ? std::pow(base, speed_log) : base;
98100

99101
if (qFuzzyCompare(filter_tempo, 1.0)) {
100102
// This filter would do nothing
@@ -115,7 +117,7 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to, double
115117

116118
// Create conversion filter
117119
if (from.sample_rate() != to.sample_rate() || from.channel_layout() != to.channel_layout() || from.format() != to.format()
118-
|| (to.FormatIsPlanar() && create_tempo)) { // Tempo processor automatically converts to packed,
120+
|| (to.format().is_planar() && create_tempo)) { // Tempo processor automatically converts to packed,
119121
// so if the desired output is planar, it'll need
120122
// to be converted
121123
snprintf(filter_args, 200, "sample_fmts=%s:sample_rates=%d:channel_layouts=0x%" PRIx64,
@@ -236,7 +238,7 @@ int AudioProcessor::Convert(float **in, int nb_in_samples, AudioProcessor::Buffe
236238
if (output) {
237239
int nb_channels = to_.channel_count();
238240

239-
if (to_.FormatIsPacked()) {
241+
if (to_.format().is_packed()) {
240242
nb_channels = 1;
241243
}
242244

@@ -259,7 +261,7 @@ int AudioProcessor::Convert(float **in, int nb_in_samples, AudioProcessor::Buffe
259261
}
260262

261263
int nb_bytes = out_frame_->nb_samples * to_.bytes_per_sample_per_channel();
262-
if (to_.FormatIsPacked()) {
264+
if (to_.format().is_packed()) {
263265
nb_bytes *= to_.channel_count();
264266
}
265267

app/audio/audioprocessor.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@
2222
#define AUDIOPROCESSOR_H
2323

2424
#include <inttypes.h>
25+
#include <olive/core/core.h>
26+
#include <QByteArray>
2527

2628
extern "C" {
2729
#include <libavfilter/avfilter.h>
2830
}
2931

30-
#include "render/audioparams.h"
32+
#include "common/define.h"
3133

3234
namespace olive {
3335

36+
using namespace core;
37+
3438
class AudioProcessor
3539
{
3640
public:

app/audio/audiovisualwaveform.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <QtGlobal>
2525

2626
#include "config/config.h"
27-
#include "common/cpuoptimize.h"
2827

2928
namespace olive {
3029

@@ -459,8 +458,8 @@ void AudioVisualWaveform::DrawWaveform(QPainter *painter, const QRect& rect, con
459458
break;
460459
}
461460

462-
next_sample_index = qMin(arr.size(),
463-
start_sample_index + qFloor(rate_dbl * static_cast<double>(i - rect.x() + 1) / scale) * samples.channel_count());
461+
next_sample_index = std::min(arr.size(),
462+
size_t(start_sample_index + std::floor(rate_dbl * static_cast<double>(i - rect.x() + 1) / scale) * samples.channel_count()));
464463

465464
if (summary_index != sample_index) {
466465
summary = AudioVisualWaveform::ReSumSamples(&arr.at(sample_index),
@@ -480,7 +479,7 @@ size_t AudioVisualWaveform::time_to_samples(const rational &time, double sample_
480479

481480
size_t AudioVisualWaveform::time_to_samples(const double &time, double sample_rate) const
482481
{
483-
return qFloor(time * sample_rate) * channels_;
482+
return std::floor(time * sample_rate) * channels_;
484483
}
485484

486485
std::map<rational, AudioVisualWaveform::Sample>::const_iterator AudioVisualWaveform::GetMipmapForScale(double scale) const

app/audio/audiovisualwaveform.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
#ifndef SUMSAMPLES_H
2222
#define SUMSAMPLES_H
2323

24+
#include <olive/core/core.h>
2425
#include <QPainter>
2526
#include <QVector>
2627

27-
#include "codec/samplebuffer.h"
28-
2928
namespace olive {
3029

30+
using namespace core;
31+
3132
/**
3233
* @brief A buffer of data used to store a visual representation of audio
3334
*

app/codec/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,5 @@ set(OLIVE_SOURCES
3333
codec/frame.h
3434
codec/planarfiledevice.cpp
3535
codec/planarfiledevice.h
36-
codec/samplebuffer.cpp
37-
codec/samplebuffer.h
3836
PARENT_SCOPE
3937
)

0 commit comments

Comments
 (0)