Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
75ef793c
Commit
75ef793c
authored
Aug 21, 2016
by
luyikei
Browse files
ThumbnailWorker: Take an absolute position of a clip
parent
46cadb56
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/Gui/timeline/Clip.qml
View file @
75ef793c
...
...
@@ -189,10 +189,10 @@ Rectangle {
if
(
uuid
===
"
videoUuid
"
||
uuid
===
"
audioUuid
"
)
return
;
if
(
thumbnailProvider
.
hasImage
(
uuid
,
0
)
)
updateThumbnail
(
0
);
if
(
thumbnailProvider
.
hasImage
(
uuid
,
begin
)
)
updateThumbnail
(
begin
);
else
workflow
.
takeThumbnail
(
uuid
,
0
);
workflow
.
takeThumbnail
(
uuid
,
begin
);
}
Component.onDestruction
:
{
...
...
src/Gui/timeline/main.qml
View file @
75ef793c
...
...
@@ -650,7 +650,7 @@ Rectangle {
target
:
thumbnailProvider
onImageReady
:
{
var
clipItem
=
findClipItem
(
uuid
);
clipItem
.
updateThumbnail
(
0
);
clipItem
.
updateThumbnail
(
clipItem
.
begin
);
}
}
}
...
...
src/Workflow/MainWorkflow.cpp
View file @
75ef793c
...
...
@@ -304,8 +304,7 @@ MainWorkflow::takeThumbnail( const QString& uuid, quint32 pos )
{
auto
clip
=
m_sequenceWorkflow
->
clip
(
uuid
);
auto
worker
=
new
ThumbnailWorker
(
uuid
,
clip
->
media
()
->
fileInfo
()
->
absoluteFilePath
(),
clip
->
begin
(),
pos
,
clip
->
input
()
->
width
(),
clip
->
input
()
->
height
()
);
pos
,
clip
->
input
()
->
width
(),
clip
->
input
()
->
height
()
);
auto
t
=
new
QThread
;
worker
->
moveToThread
(
t
);
connect
(
t
,
&
QThread
::
started
,
worker
,
&
ThumbnailWorker
::
run
);
...
...
src/Workflow/ThumbnailWorker.cpp
View file @
75ef793c
...
...
@@ -6,12 +6,10 @@
#include
"Backend/MLT/MLTInput.h"
ThumbnailWorker
::
ThumbnailWorker
(
const
QString
&
uuid
,
const
QString
&
filePath
,
qint64
begin
,
qint64
pos
,
quint32
width
,
quint32
height
,
QObject
*
parent
)
qint64
pos
,
quint32
width
,
quint32
height
,
QObject
*
parent
)
:
QObject
(
parent
)
,
m_uuid
(
uuid
)
,
m_filePath
(
filePath
)
,
m_begin
(
begin
)
,
m_pos
(
pos
)
,
m_width
(
width
)
,
m_height
(
height
)
...
...
@@ -23,7 +21,6 @@ void
ThumbnailWorker
::
run
()
{
Backend
::
MLT
::
MLTInput
input
(
qPrintable
(
m_filePath
)
);
input
.
setBegin
(
m_begin
);
input
.
setPosition
(
m_pos
);
auto
image
=
input
.
image
(
m_width
,
m_height
);
QImage
qImg
(
image
,
m_width
,
m_height
,
...
...
src/Workflow/ThumbnailWorker.h
View file @
75ef793c
...
...
@@ -10,8 +10,7 @@ class ThumbnailWorker : public QObject
Q_OBJECT
public:
explicit
ThumbnailWorker
(
const
QString
&
uuid
,
const
QString
&
filePath
,
qint64
begin
,
qint64
pos
,
quint32
width
,
quint32
height
,
QObject
*
parent
=
0
);
qint64
pos
,
quint32
width
,
quint32
height
,
QObject
*
parent
=
0
);
signals:
void
imageReady
(
const
QString
&
uuid
,
qint64
pos
,
const
QPixmap
&
pixmap
);
...
...
@@ -22,7 +21,6 @@ public slots:
private:
QString
m_uuid
;
QString
m_filePath
;
qint64
m_begin
;
qint64
m_pos
;
quint32
m_width
;
quint32
m_height
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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