Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8d212ff5 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '1912'

parents f69171d1 36126ef0
......@@ -3,10 +3,10 @@
<name>Loudness</name>
<description>Correct audio loudness as recommended by EBU R128</description>
<author>Brian Matherly</author>
<parameter type="double" name="program" max="-10" min="-50" default="-23.00" decimals="2">
<parameter type="double" name="program" max="-10" min="-50" default="-23.00" decimals="2" suffix="LUFS">
<name>Target Program Loudness</name>
</parameter>
<parameter type="filterjob" filtertag="loudness" filterparams="%params" consumer="null" consumerparams="video_off=1 all=1 terminate_on_pause=1">
<parameter type="filterjob" filtertag="loudness" filterparams="%params" consumer="null" consumerparams="video_off=1 no_meta=1 all=1 terminate_on_pause=1">
<name>Analyse</name>
<jobparam name="key">results</jobparam>
<jobparam name="finalfilter">loudness</jobparam>
......
......@@ -49,10 +49,9 @@ const QString FilterClipJob::getDescription() const
void FilterClipJob::configureConsumer()
{
m_consumer = std::make_unique<Mlt::Consumer>(*m_profile.get(), "null");
m_consumer = std::make_unique<Mlt::Consumer>(*m_profile.get(), "xml");
m_consumer->set("all", 1);
m_consumer->set("terminate_on_pause", 1);
m_consumer->set("real_time", -KdenliveSettings::mltthreads());
}
void FilterClipJob::configureFilter()
......
......@@ -34,8 +34,7 @@
#include <mlt++/Mlt.h>
static void consumer_frame_render(mlt_consumer, MeltJob *self, mlt_frame frame_ptr)
{
Mlt::Frame frame(frame_ptr);
self->mltFrameCallback((int)frame.get_position());
self->jobProgress((int)(100 * mlt_frame_get_position(frame_ptr) / self->length));
}
MeltJob::MeltJob(const QString &binId, JOBTYPE type, bool useProducerProfile, int in, int out)
......@@ -238,15 +237,14 @@ bool MeltJob::startJob()
m_consumer->connect(tractor);
m_producer->set_speed(0);
m_producer->seek(0);
m_length = m_producer->get_playtime();
if (m_length == 0) {
m_length = m_producer->get_length();
length = m_producer->get_playtime();
if (length == 0) {
length = m_producer->get_length();
}
if (m_filter) {
m_producer->attach(*m_filter.get());
}
m_showFrameEvent.reset(m_consumer->listen("consumer-frame-render", this, (mlt_listener)consumer_frame_render));
m_producer->set_speed(1);
m_showFrameEvent.reset(m_consumer->listen("consumer-frame-show", this, (mlt_listener)consumer_frame_render));
connect(this, &MeltJob::jobCanceled, [&] () {
m_consumer->stop();
return false;
......@@ -269,10 +267,3 @@ bool MeltJob::startJob()
m_successful = m_done = true;
return true;
}
void MeltJob::mltFrameCallback(int pos)
{
if (m_length > 0) {
emit jobProgress((int)(100 * pos / m_length));
}
}
......@@ -53,8 +53,7 @@ public:
MeltJob(const QString &binId, JOBTYPE type, bool useProducerProfile = false, int in = -1, int out = -1);
bool startJob() override;
/* @brief this is public for convenience reason, but it should not be called directly */
void mltFrameCallback(int frame);
int length;
protected:
// @brief extra configuration of the profile (eg: resize the profile)
......@@ -83,7 +82,6 @@ protected:
QString m_filterName;
bool m_useProducerProfile;
int m_in, m_out;
int m_length;
// @brief Does this job require a filter
bool m_requiresFilter;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment