Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node system overhaul for better flexibility and usability #2236

Open
wants to merge 80 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
7acdb5a
config: default to rectified waveforms on
itsmattkc Dec 5, 2022
bae1951
audio: initial implementation of no-conform approach
itsmattkc Dec 5, 2022
dc3a52f
Merge branch 'master' into audio-no-conform
itsmattkc Feb 17, 2023
fa5d267
updated to latest master
itsmattkc Feb 17, 2023
a449950
Merge branch 'master' into audio-no-conform
itsmattkc Mar 9, 2023
67c790f
Merge branch 'master' into audio-no-conform
itsmattkc Mar 14, 2023
aec7327
Merge branch 'master' into audio-no-conform
itsmattkc Mar 20, 2023
51e54d3
initial traverser removal
itsmattkc Mar 26, 2023
83c50bb
ensure volume and pan adhere to guidelines
itsmattkc Mar 26, 2023
7f79fef
node: add convenience functions for enabled
itsmattkc Mar 26, 2023
1989eff
updated audio jobs to work with new system
itsmattkc Mar 27, 2023
04e02c8
use newer version of core
itsmattkc Mar 27, 2023
12f045c
excise nodevaluedatabase
itsmattkc Mar 27, 2023
18c7396
excised nodevaluetable
itsmattkc Mar 27, 2023
d26a142
nerfed valuehints
itsmattkc Mar 27, 2023
457b5a0
shifted nodevaluerow to accelerated jobs - the only place that uses t…
itsmattkc Mar 27, 2023
79c1ab7
make node value arrays into actual arrays
itsmattkc Mar 27, 2023
839380a
Merge branch 'master' into ts-timeline
itsmattkc Mar 27, 2023
90a5598
reimplemented loop mode
itsmattkc Mar 27, 2023
212d0b0
Merge branch 'master' into audio-no-conform
itsmattkc Mar 27, 2023
46bc5c3
transform: remove note
itsmattkc Mar 28, 2023
6c43857
multicam: fixed all view
itsmattkc Mar 28, 2023
254ab66
further simplified nodes
itsmattkc Mar 29, 2023
9178612
reinstated NodeValueTree
itsmattkc Mar 29, 2023
bb27a30
initial new value type implementation
itsmattkc Apr 3, 2023
8153ce7
corrected various straggling issues
itsmattkc Apr 4, 2023
7ef50ab
began math node rewrite
itsmattkc Apr 5, 2023
73227fd
use SSE in all sample operations
itsmattkc Apr 27, 2023
30b3fda
implement basic channel swizzling
itsmattkc May 20, 2023
a6c5cf9
show "not connected" label for inputs without widgets
itsmattkc May 20, 2023
77e6fdd
fix polygon node
itsmattkc May 20, 2023
b338199
fix minor qt issue
itsmattkc May 20, 2023
0299f07
fixed some node issues
itsmattkc May 20, 2023
31a108e
use exception as primary means of detecting bad cast
itsmattkc May 20, 2023
645c33e
added two methods of receiving values from value_t
itsmattkc May 21, 2023
79a23dd
implement auto conversion
itsmattkc May 21, 2023
a87bf80
fixed color param widget
itsmattkc May 21, 2023
ed938cd
fixed slider issues
itsmattkc May 21, 2023
8c24448
added some math functions
itsmattkc May 21, 2023
f9ed0a1
hide deprecated nodes
itsmattkc May 21, 2023
e6aa010
use actual input channel count in nodevaluetree
itsmattkc May 21, 2023
f5bd882
re-add matrix output to transform
itsmattkc May 21, 2023
fda9a2f
permit multiple inputs on nodes
itsmattkc May 22, 2023
ed6edf2
node: allow custom widgets
itsmattkc May 23, 2023
397f308
viewer: allow hiding toolbar
itsmattkc May 23, 2023
17260cd
enable swizzling texture channels
itsmattkc May 23, 2023
adbb228
valueswizzlewidget: enable gradients for slightly nicer appearance
itsmattkc May 23, 2023
311d407
nodes: reimplement value caching
itsmattkc May 23, 2023
cc4f8ac
readded outputs
itsmattkc May 25, 2023
95aab6a
nodevaluetree: fix issue where swizzles didn't auto update
itsmattkc May 25, 2023
4149ab4
implement swizzling audio
itsmattkc May 25, 2023
9554148
floatsliderparamwidget: fixed max not being set correctly
itsmattkc May 25, 2023
0c312e6
check if track is within bounds
itsmattkc May 25, 2023
b8d7fb8
valueparams: allow editing value cache
itsmattkc May 25, 2023
f857550
implement tonegenerator
itsmattkc May 25, 2023
55f2aea
implement some different appearance for channels
itsmattkc May 29, 2023
0b952e8
autoconvert double to samples
itsmattkc May 29, 2023
2921eb6
fixed viewer on wayland
itsmattkc May 29, 2023
f062b06
fix slider ladder on wayland
itsmattkc May 29, 2023
59f2284
fix actionsearch
itsmattkc May 29, 2023
f6bcebd
auto-add keyframe track where necessary
itsmattkc May 31, 2023
abd3777
node: ensure widgets are correctly recreated on subtype change
itsmattkc Jun 12, 2023
f2c1327
math: added floor/ceil/round/abs ops
itsmattkc Jun 12, 2023
ecc84f7
Merge branch 'master' into ts-timeline
itsmattkc Jun 12, 2023
d870da8
update core library
itsmattkc Jun 12, 2023
a6a1e74
fixed CI compiler issues
itsmattkc Jun 12, 2023
7440ffc
fix value ambiguity
itsmattkc Jun 12, 2023
12b5d38
mathnode: fix regression in texture ops
itsmattkc Jun 15, 2023
3c947df
nodevaluetree: fix obvious mistake
itsmattkc Jun 15, 2023
dae9f87
value: fixed macos/clang issue
itsmattkc Jun 15, 2023
f988a2f
Merge branch 'audio-no-conform' into ts-timeline
itsmattkc Jun 16, 2023
b25acc0
unsubmodule core library
itsmattkc Jun 27, 2023
db3f43a
Merge branch 'master' into ts-timeline
itsmattkc Jun 27, 2023
b42256e
minor adjustments for merge
itsmattkc Jun 27, 2023
82ee885
improve channel system
itsmattkc Jul 5, 2023
30233a8
address swizzling between multiple nodes
itsmattkc Jul 5, 2023
9560959
math: add modulo function
itsmattkc Jul 6, 2023
58aaab2
remove integer from value node
itsmattkc Jul 6, 2023
c43936c
pick up on old bool strings for int conversion
itsmattkc Jul 6, 2023
442038c
cmake: bump ffmpeg version requirement
itsmattkc Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "ext/core"]
path = ext/core
url = https://github.com/olive-editor/core
[submodule "ext/KDDockWidgets"]
path = ext/KDDockWidgets
url = https://github.com/olive-editor/KDDockWidgets.git
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ list(APPEND OLIVE_INCLUDE_DIRS ${OPENEXR_INCLUDES})

# Link Olive
list(APPEND OLIVE_LIBRARIES olivecore)
list(APPEND OLIVE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/core/include)
list(APPEND OLIVE_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/lib/olive/include)

# Link Qt
set(QT_LIBRARIES
Expand Down Expand Up @@ -168,7 +168,7 @@ list(APPEND OLIVE_LIBRARIES
)

# Link FFmpeg
find_package(FFMPEG 3.0 REQUIRED
find_package(FFMPEG 5.0 REQUIRED
COMPONENTS
avutil
avcodec
Expand Down Expand Up @@ -257,6 +257,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
list(APPEND OLIVE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/ext)

add_subdirectory(ext)
add_subdirectory(lib)
add_subdirectory(app)

if (BUILD_TESTS)
Expand Down
55 changes: 27 additions & 28 deletions app/audio/audioprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace olive {
AudioProcessor::AudioProcessor()
{
filter_graph_ = nullptr;
in_frame_ = nullptr;
out_frame_ = nullptr;
}

Expand All @@ -61,12 +60,12 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to, double

// Set up audio buffer args
char filter_args[200];
snprintf(filter_args, 200, "time_base=%d/%d:sample_rate=%d:sample_fmt=%d:channel_layout=0x%" PRIx64,
snprintf(filter_args, 200, "time_base=%d/%d:sample_rate=%d:sample_fmt=%d:channel_layout=%s",
1,
from.sample_rate(),
from.sample_rate(),
from_fmt_,
from.channel_layout());
from.channel_layout().toString().toUtf8().constData());

int r;

Expand Down Expand Up @@ -120,10 +119,10 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to, double
|| (to.format().is_planar() && create_tempo)) { // Tempo processor automatically converts to packed,
// so if the desired output is planar, it'll need
// to be converted
snprintf(filter_args, 200, "sample_fmts=%s:sample_rates=%d:channel_layouts=0x%" PRIx64,
snprintf(filter_args, 200, "sample_fmts=%s:sample_rates=%d:channel_layouts=%s",
av_get_sample_fmt_name(to_fmt_),
to.sample_rate(),
to.channel_layout());
to.channel_layout().toString().toUtf8().constData());

AVFilterContext *c;
r = avfilter_graph_create_filter(&c, avfilter_get_by_name("aformat"), "fmt", filter_args, nullptr, filter_graph_);
Expand Down Expand Up @@ -165,19 +164,6 @@ bool AudioProcessor::Open(const AudioParams &from, const AudioParams &to, double
return false;
}

in_frame_ = av_frame_alloc();
if (in_frame_) {
in_frame_->sample_rate = from.sample_rate();
in_frame_->format = from_fmt_;
in_frame_->channel_layout = from.channel_layout();
in_frame_->channels = from.channel_count();
in_frame_->pts = 0;
} else {
qCritical() << "Failed to allocate input frame";
Close();
return false;
}

out_frame_ = av_frame_alloc();
if (!out_frame_) {
qCritical() << "Failed to allocate output frame";
Expand All @@ -200,11 +186,6 @@ void AudioProcessor::Close()
buffersink_ctx_ = nullptr;
}

if (in_frame_) {
av_frame_free(&in_frame_);
in_frame_ = nullptr;
}

if (out_frame_) {
av_frame_free(&out_frame_);
out_frame_ = nullptr;
Expand All @@ -221,14 +202,32 @@ int AudioProcessor::Convert(float **in, int nb_in_samples, AudioProcessor::Buffe
int r = 0;

if (in && nb_in_samples) {
// Set frame parameters
in_frame_->nb_samples = nb_in_samples;
// Pass pointers to AVFilter through an AVFrame
AVFrame *in_frame = av_frame_alloc();
if (!in_frame) {
qCritical() << "Failed to allocate input frame";
return -1;
}

in_frame->sample_rate = from_.sample_rate();
in_frame->format = from_fmt_;
from_.channel_layout().exportTo(&in_frame->ch_layout);
in_frame->pts = 0;

in_frame->nb_samples = nb_in_samples;
for (int i=0; i<from_.channel_count(); i++) {
in_frame->data[i] = reinterpret_cast<uint8_t*>(in[i]);
in_frame->linesize[i] = from_.samples_to_bytes(nb_in_samples);
}

r = av_buffersrc_add_frame_flags(buffersrc_ctx_, in_frame, AV_BUFFERSRC_FLAG_KEEP_REF);

for (int i=0; i<from_.channel_count(); i++) {
in_frame_->data[i] = reinterpret_cast<uint8_t*>(in[i]);
in_frame_->linesize[i] = from_.samples_to_bytes(nb_in_samples);
in_frame->data[i] = nullptr;
in_frame->linesize[i] = 0;
}

r = av_buffersrc_add_frame_flags(buffersrc_ctx_, in_frame_, AV_BUFFERSRC_FLAG_KEEP_REF);
av_frame_free(&in_frame);
if (r < 0) {
qCritical() << "Failed to add frame to buffersrc:" << r;
return r;
Expand Down
6 changes: 1 addition & 5 deletions app/audio/audioprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,17 @@
#define AUDIOPROCESSOR_H

#include <inttypes.h>
#include <olive/core/core.h>
#include <QByteArray>

extern "C" {
#include <libavfilter/avfilter.h>
}

#include "common/define.h"
#include "core.h"

namespace olive {

using namespace core;

class AudioProcessor
{
public:
Expand Down Expand Up @@ -73,8 +71,6 @@ class AudioProcessor
AudioParams to_;
AVSampleFormat to_fmt_;

AVFrame *in_frame_;

AVFrame *out_frame_;

};
Expand Down
1 change: 1 addition & 0 deletions app/audio/audiovisualwaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QtGlobal>

#include "config/config.h"
#include "util/cpuoptimize.h"

namespace olive {

Expand Down
5 changes: 2 additions & 3 deletions app/audio/audiovisualwaveform.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
#ifndef SUMSAMPLES_H
#define SUMSAMPLES_H

#include <olive/core/core.h>
#include <QPainter>
#include <QVector>

namespace olive {
#include "render/samplebuffer.h"

using namespace core;
namespace olive {

/**
* @brief A buffer of data used to store a visual representation of audio
Expand Down
3 changes: 2 additions & 1 deletion app/codec/conformmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <QDir>

#include "common/filefunctions.h"
#include "task/taskmanager.h"

namespace olive {
Expand Down Expand Up @@ -66,7 +67,7 @@ QVector<QString> ConformManager::GetConformedFilename(const QString &cache_path,
QString::number(stream.stream()),
QString::number(params.sample_rate()),
QString::number(params.format()),
QString::number(params.channel_layout()),
params.channel_layout().toString(),
QString::number(i));

filenames[i] = QDir(cache_path).filePath(index_fn);
Expand Down
36 changes: 22 additions & 14 deletions app/codec/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ TexturePtr Decoder::RetrieveVideo(const RetrieveVideoParams &p)
return cached_texture_;
}

Decoder::RetrieveAudioStatus Decoder::RetrieveAudio(SampleBuffer &dest, const TimeRange &range, const AudioParams &params, const QString& cache_path, LoopMode loop_mode, RenderMode::Mode mode)
Decoder::RetrieveAudioStatus Decoder::RetrieveAudio(SampleBuffer &dest, const rational &time, const QString& cache_path, LoopMode loop_mode, RenderMode::Mode mode)
{
QMutexLocker locker(&mutex_);

Expand All @@ -139,18 +139,24 @@ Decoder::RetrieveAudioStatus Decoder::RetrieveAudio(SampleBuffer &dest, const Ti
return kInvalid;
}

// Get conform state from ConformManager
ConformManager::Conform conform = ConformManager::instance()->GetConformState(id(), cache_path, stream_, params, (mode == RenderMode::kOnline));
if (conform.state == ConformManager::kConformGenerating) {
// If we need the task, it's available in `conform.task`
return kWaitingForConform;
}
const bool use_conforms = false;

if (use_conforms) {
// Get conform state from ConformManager
ConformManager::Conform conform = ConformManager::instance()->GetConformState(id(), cache_path, stream_, dest.audio_params(), (mode == RenderMode::kOnline));
if (conform.state == ConformManager::kConformGenerating) {
// If we need the task, it's available in `conform.task`
return kWaitingForConform;
}

// See if we got the conform
if (RetrieveAudioFromConform(dest, conform.filenames, range, loop_mode, params)) {
return kOK;
// See if we got the conform
if (RetrieveAudioFromConform(dest, conform.filenames, time, loop_mode)) {
return kOK;
} else {
return kUnknownError;
}
} else {
return kUnknownError;
return RetrieveAudioInternal(dest, time);
}
}

Expand Down Expand Up @@ -280,14 +286,16 @@ bool Decoder::ConformAudioInternal(const QVector<QString> &filenames, const Audi
return false;
}

bool Decoder::RetrieveAudioFromConform(SampleBuffer &sample_buffer, const QVector<QString> &conform_filenames, TimeRange range, LoopMode loop_mode, const AudioParams &input_params)
bool Decoder::RetrieveAudioFromConform(SampleBuffer &sample_buffer, const QVector<QString> &conform_filenames, rational time, LoopMode loop_mode)
{
const AudioParams &input_params = sample_buffer.audio_params();

PlanarFileDevice input;
if (input.open(conform_filenames, QFile::ReadOnly)) {
// Offset range by audio start offset
range -= GetAudioStartOffset();
time -= GetAudioStartOffset();

qint64 read_index = input_params.time_to_bytes(range.in()) / input_params.channel_count();
qint64 read_index = input_params.time_to_bytes(time) / input_params.channel_count();
qint64 write_index = 0;

const qint64 buffer_length_in_bytes = sample_buffer.sample_count() * input_params.bytes_per_sample_per_channel();
Expand Down
11 changes: 9 additions & 2 deletions app/codec/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Decoder : public QObject
*
* This function is thread safe and can only run while the decoder is open. \see Open()
*/
RetrieveAudioStatus RetrieveAudio(SampleBuffer &dest, const TimeRange& range, const AudioParams& params, const QString &cache_path, LoopMode loop_mode, RenderMode::Mode mode);
RetrieveAudioStatus RetrieveAudio(SampleBuffer &dest, const rational& time, const QString &cache_path, LoopMode loop_mode, RenderMode::Mode mode);

/**
* @brief Determine the last time this decoder instance was used in any way
Expand Down Expand Up @@ -272,6 +272,11 @@ class Decoder : public QObject
*/
virtual TexturePtr RetrieveVideoInternal(const RetrieveVideoParams& p);

virtual RetrieveAudioStatus RetrieveAudioInternal(SampleBuffer &dest, const rational &time)
{
return kOK;
}

virtual bool ConformAudioInternal(const QVector<QString>& filenames, const AudioParams &params, CancelAtom *cancelled);

void SignalProcessingProgress(int64_t ts, int64_t duration);
Expand All @@ -288,6 +293,8 @@ class Decoder : public QObject

virtual rational GetAudioStartOffset() const { return 0; }

virtual int GetAudioSampleRate() const { return 0; }

signals:
/**
* @brief While indexing, this signal will provide progress as a percentage (0-100 inclusive) if
Expand All @@ -298,7 +305,7 @@ class Decoder : public QObject
private:
void UpdateLastAccessed();

bool RetrieveAudioFromConform(SampleBuffer &sample_buffer, const QVector<QString> &conform_filenames, TimeRange range, LoopMode loop_mode, const AudioParams &params);
bool RetrieveAudioFromConform(SampleBuffer &sample_buffer, const QVector<QString> &conform_filenames, rational time, LoopMode loop_mode);

CodecStream stream_;

Expand Down
25 changes: 13 additions & 12 deletions app/codec/encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <QFile>

#include "common/filefunctions.h"
#include "common/xmlutils.h"
#include "ffmpeg/ffmpegencoder.h"
#include "oiio/oiioencoder.h"
Expand Down Expand Up @@ -201,8 +202,8 @@ void EncodingParams::Save(QXmlStreamWriter *writer) const
writer->writeTextElement(QStringLiteral("format"), QString::number(format_));

writer->writeTextElement(QStringLiteral("range"), QString::number(has_custom_range_));
writer->writeTextElement(QStringLiteral("customrangein"), QString::fromStdString(custom_range_.in().toString()));
writer->writeTextElement(QStringLiteral("customrangeout"), QString::fromStdString(custom_range_.out().toString()));
writer->writeTextElement(QStringLiteral("customrangein"), custom_range_.in().toString());
writer->writeTextElement(QStringLiteral("customrangeout"), custom_range_.out().toString());

writer->writeStartElement(QStringLiteral("video"));

Expand All @@ -213,8 +214,8 @@ void EncodingParams::Save(QXmlStreamWriter *writer) const
writer->writeTextElement(QStringLiteral("width"), QString::number(video_params_.width()));
writer->writeTextElement(QStringLiteral("height"), QString::number(video_params_.height()));
writer->writeTextElement(QStringLiteral("format"), QString::number(video_params_.format()));
writer->writeTextElement(QStringLiteral("pixelaspect"), QString::fromStdString(video_params_.pixel_aspect_ratio().toString()));
writer->writeTextElement(QStringLiteral("timebase"), QString::fromStdString(video_params_.time_base().toString()));
writer->writeTextElement(QStringLiteral("pixelaspect"), video_params_.pixel_aspect_ratio().toString());
writer->writeTextElement(QStringLiteral("timebase"), video_params_.time_base().toString());
writer->writeTextElement(QStringLiteral("divider"), QString::number(video_params_.divider()));
writer->writeTextElement(QStringLiteral("bitrate"), QString::number(video_bit_rate_));
writer->writeTextElement(QStringLiteral("minbitrate"), QString::number(video_min_bit_rate_));
Expand Down Expand Up @@ -256,8 +257,8 @@ void EncodingParams::Save(QXmlStreamWriter *writer) const
if (audio_enabled_) {
writer->writeTextElement(QStringLiteral("codec"), QString::number(audio_codec_));
writer->writeTextElement(QStringLiteral("samplerate"), QString::number(audio_params_.sample_rate()));
writer->writeTextElement(QStringLiteral("channellayout"), QString::number(audio_params_.channel_layout()));
writer->writeTextElement(QStringLiteral("format"), QString::fromStdString(audio_params_.format().to_string()));
writer->writeTextElement(QStringLiteral("channellayout"), audio_params_.channel_layout().toString());
writer->writeTextElement(QStringLiteral("format"), audio_params_.format().to_string());
writer->writeTextElement(QStringLiteral("bitrate"), QString::number(audio_bit_rate_));
}

Expand Down Expand Up @@ -380,9 +381,9 @@ bool EncodingParams::LoadV1(QXmlStreamReader *reader)
} else if (reader->name() == QStringLiteral("range")) {
has_custom_range_ = reader->readElementText().toInt();
} else if (reader->name() == QStringLiteral("customrangein")) {
custom_range_in = rational::fromString(reader->readElementText().toStdString());
custom_range_in = rational::fromString(reader->readElementText());
} else if (reader->name() == QStringLiteral("customrangeout")) {
custom_range_out = rational::fromString(reader->readElementText().toStdString());
custom_range_out = rational::fromString(reader->readElementText());
} else if (reader->name() == QStringLiteral("video")) {
XMLAttributeLoop(reader, attr) {
if (attr.name() == QStringLiteral("enabled")) {
Expand All @@ -400,9 +401,9 @@ bool EncodingParams::LoadV1(QXmlStreamReader *reader)
} else if (reader->name() == QStringLiteral("format")) {
video_params_.set_format(static_cast<PixelFormat::Format>(reader->readElementText().toInt()));
} else if (reader->name() == QStringLiteral("pixelaspect")) {
video_params_.set_pixel_aspect_ratio(rational::fromString(reader->readElementText().toStdString()));
video_params_.set_pixel_aspect_ratio(rational::fromString(reader->readElementText()));
} else if (reader->name() == QStringLiteral("timebase")) {
video_params_.set_time_base(rational::fromString(reader->readElementText().toStdString()));
video_params_.set_time_base(rational::fromString(reader->readElementText()));
} else if (reader->name() == QStringLiteral("divider")) {
video_params_.set_divider(reader->readElementText().toInt());
} else if (reader->name() == QStringLiteral("bitrate")) {
Expand Down Expand Up @@ -469,9 +470,9 @@ bool EncodingParams::LoadV1(QXmlStreamReader *reader)
} else if (reader->name() == QStringLiteral("samplerate")) {
audio_params_.set_sample_rate(reader->readElementText().toInt());
} else if (reader->name() == QStringLiteral("channellayout")) {
audio_params_.set_channel_layout(reader->readElementText().toULongLong());
audio_params_.set_channel_layout(AudioChannelLayout::fromString(reader->readElementText()));
} else if (reader->name() == QStringLiteral("format")) {
audio_params_.set_format(SampleFormat::from_string(reader->readElementText().toStdString()));
audio_params_.set_format(SampleFormat::from_string(reader->readElementText()));
} else if (reader->name() == QStringLiteral("bitrate")) {
audio_bit_rate_ = reader->readElementText().toLongLong();
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/codec/encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class Encoder : public QObject
public slots:
virtual bool Open() = 0;

virtual bool WriteFrame(olive::FramePtr frame, olive::core::rational time) = 0;
virtual bool WriteFrame(olive::FramePtr frame, rational time) = 0;
virtual bool WriteAudio(const olive::SampleBuffer &audio) = 0;
virtual bool WriteSubtitle(const SubtitleBlock *sub_block) = 0;

Expand Down
Loading