Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
36126ef0
Commit
36126ef0
authored
Nov 19, 2019
by
Jean-Baptiste Mardelle
Browse files
Faster analyse clip jobs
parent
7d834a86
Changes
4
Hide whitespace changes
Inline
Side-by-side
data/effects/loudness.xml
View file @
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>
...
...
src/jobs/filterclipjob.cpp
View file @
36126ef0
...
...
@@ -49,10 +49,9 @@ const QString FilterClipJob::getDescription() const
void
FilterClipJob
::
configureConsumer
()
{
m_consumer
=
std
::
make_unique
<
Mlt
::
Consumer
>
(
*
m_profile
.
get
(),
"
nul
l"
);
m_consumer
=
std
::
make_unique
<
Mlt
::
Consumer
>
(
*
m_profile
.
get
(),
"
xm
l"
);
m_consumer
->
set
(
"all"
,
1
);
m_consumer
->
set
(
"terminate_on_pause"
,
1
);
m_consumer
->
set
(
"real_time"
,
-
KdenliveSettings
::
mltthreads
());
}
void
FilterClipJob
::
configureFilter
()
...
...
src/jobs/meltjob.cpp
View file @
36126ef0
...
...
@@ -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
));
}
}
src/jobs/meltjob.h
View file @
36126ef0
...
...
@@ -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
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment