Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
10bb1cba
Commit
10bb1cba
authored
May 20, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove dead code
parent
ff9a3042
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
63 deletions
+0
-63
src/bin/projectclip.cpp
src/bin/projectclip.cpp
+0
-60
src/bin/projectclip.h
src/bin/projectclip.h
+0
-3
No files found.
src/bin/projectclip.cpp
View file @
10bb1cba
...
...
@@ -1150,66 +1150,6 @@ QVariant ProjectClip::getData(DataType type) const
}
}
void
ProjectClip
::
slotExtractImage
(
const
QList
<
int
>
&
frames
)
{
QMutexLocker
lock
(
&
m_thumbMutex
);
for
(
int
i
=
0
;
i
<
frames
.
count
();
i
++
)
{
if
(
!
m_requestedThumbs
.
contains
(
frames
.
at
(
i
)))
{
m_requestedThumbs
<<
frames
.
at
(
i
);
}
}
qSort
(
m_requestedThumbs
);
if
(
!
m_thumbThread
.
isRunning
())
{
m_thumbThread
=
QtConcurrent
::
run
(
this
,
&
ProjectClip
::
doExtractImage
);
}
}
void
ProjectClip
::
doExtractImage
()
{
// TODO refac: we can probably move that into a ThumbJob
std
::
shared_ptr
<
Mlt
::
Producer
>
prod
=
thumbProducer
();
if
(
prod
==
nullptr
||
!
prod
->
is_valid
())
{
return
;
}
int
frameWidth
=
150
*
prod
->
profile
()
->
dar
()
+
0.5
;
bool
ok
=
false
;
auto
ptr
=
m_model
.
lock
();
Q_ASSERT
(
ptr
);
QDir
thumbFolder
=
pCore
->
currentDoc
()
->
getCacheDir
(
CacheThumbs
,
&
ok
);
int
max
=
prod
->
get_length
();
while
(
!
m_requestedThumbs
.
isEmpty
())
{
m_thumbMutex
.
lock
();
int
pos
=
m_requestedThumbs
.
takeFirst
();
m_thumbMutex
.
unlock
();
if
(
ok
&&
thumbFolder
.
exists
(
hash
()
+
QLatin1Char
(
'#'
)
+
QString
::
number
(
pos
)
+
QStringLiteral
(
".png"
)))
{
emit
thumbReady
(
pos
,
QImage
(
thumbFolder
.
absoluteFilePath
(
hash
()
+
QLatin1Char
(
'#'
)
+
QString
::
number
(
pos
)
+
QStringLiteral
(
".png"
))));
continue
;
}
if
(
pos
>=
max
)
{
pos
=
max
-
1
;
}
const
QString
path
=
url
()
+
QLatin1Char
(
'_'
)
+
QString
::
number
(
pos
);
QImage
img
;
if
(
ThumbnailCache
::
get
()
->
hasThumbnail
(
clipId
(),
pos
,
true
))
{
img
=
ThumbnailCache
::
get
()
->
getThumbnail
(
clipId
(),
pos
,
true
);
}
if
(
!
img
.
isNull
())
{
emit
thumbReady
(
pos
,
img
);
continue
;
}
prod
->
seek
(
pos
);
Mlt
::
Frame
*
frame
=
prod
->
get_frame
();
frame
->
set
(
"deinterlace_method"
,
"onefield"
);
frame
->
set
(
"top_field_first"
,
-
1
);
if
(
frame
->
is_valid
())
{
img
=
KThumb
::
getFrame
(
frame
,
frameWidth
,
150
,
!
qFuzzyCompare
(
prod
->
profile
()
->
sar
(),
1
));
ThumbnailCache
::
get
()
->
storeThumbnail
(
clipId
(),
pos
,
img
,
false
);
emit
thumbReady
(
pos
,
img
);
}
delete
frame
;
}
}
int
ProjectClip
::
audioChannels
()
const
{
if
(
!
audioInfo
())
{
...
...
src/bin/projectclip.h
View file @
10bb1cba
...
...
@@ -243,8 +243,6 @@ public slots:
/* @brief Store the audio thumbnails once computed. Note that the parameter is a value and not a reference, fill free to use it as a sink (use std::move to
* avoid copy). */
void
updateAudioThumbnail
(
QList
<
double
>
audioLevels
);
/** @brief Extract image thumbnails for timeline. */
void
slotExtractImage
(
const
QList
<
int
>
&
frames
);
/** @brief Delete the proxy file */
void
deleteProxy
();
...
...
@@ -262,7 +260,6 @@ private:
QFuture
<
void
>
m_thumbThread
;
QList
<
int
>
m_requestedThumbs
;
const
QString
geometryWithOffset
(
const
QString
&
data
,
int
offset
);
void
doExtractImage
();
// This is a helper function that creates the disabled producer. This is a clone of the original one, with audio and video disabled
void
createDisabledMasterProducer
();
...
...
Write
Preview
Markdown
is supported
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