[vlmc-devel] ThumbnailWorker: Take an absolute position of a clip

Yikai Lu git at videolan.org
Mon Aug 22 05:59:29 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Aug 21 22:58:33 2016 -0500| [75ef793c92f4da7ef377253fd4975c8c2961689e] | committer: Yikai Lu

ThumbnailWorker: Take an absolute position of a clip

> https://code.videolan.org/videolan/vlmc/commit/75ef793c92f4da7ef377253fd4975c8c2961689e
---

 src/Gui/timeline/Clip.qml        | 6 +++---
 src/Gui/timeline/main.qml        | 2 +-
 src/Workflow/MainWorkflow.cpp    | 3 +--
 src/Workflow/ThumbnailWorker.cpp | 5 +----
 src/Workflow/ThumbnailWorker.h   | 4 +---
 5 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/Gui/timeline/Clip.qml b/src/Gui/timeline/Clip.qml
index cac88f1..03cd61a 100644
--- a/src/Gui/timeline/Clip.qml
+++ b/src/Gui/timeline/Clip.qml
@@ -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: {
diff --git a/src/Gui/timeline/main.qml b/src/Gui/timeline/main.qml
index 0efd052..b3f83af 100644
--- a/src/Gui/timeline/main.qml
+++ b/src/Gui/timeline/main.qml
@@ -650,7 +650,7 @@ Rectangle {
         target: thumbnailProvider
         onImageReady: {
             var clipItem = findClipItem( uuid );
-            clipItem.updateThumbnail( 0 );
+            clipItem.updateThumbnail( clipItem.begin );
         }
     }
 }
diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index d7ac322..a101c24 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -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 );
diff --git a/src/Workflow/ThumbnailWorker.cpp b/src/Workflow/ThumbnailWorker.cpp
index 923cda7..4dc6031 100644
--- a/src/Workflow/ThumbnailWorker.cpp
+++ b/src/Workflow/ThumbnailWorker.cpp
@@ -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,
diff --git a/src/Workflow/ThumbnailWorker.h b/src/Workflow/ThumbnailWorker.h
index ab302aa..f5deece 100644
--- a/src/Workflow/ThumbnailWorker.h
+++ b/src/Workflow/ThumbnailWorker.h
@@ -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;



More information about the Vlmc-devel mailing list