[vlmc-devel] ThumbnailImageProvider: Use snapshot of media
Yikai Lu
git at videolan.org
Wed Jul 19 16:33:24 CEST 2017
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Wed Jul 19 16:33:10 2017 +0200| [132da5b5a98d4b2dd5623474f341e03a35c1070e] | committer: Yikai Lu
ThumbnailImageProvider: Use snapshot of media
> https://code.videolan.org/videolan/vlmc/commit/132da5b5a98d4b2dd5623474f341e03a35c1070e
---
src/Gui/timeline/ThumbnailImageProvider.cpp | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/Gui/timeline/ThumbnailImageProvider.cpp b/src/Gui/timeline/ThumbnailImageProvider.cpp
index 804df860..367378e7 100644
--- a/src/Gui/timeline/ThumbnailImageProvider.cpp
+++ b/src/Gui/timeline/ThumbnailImageProvider.cpp
@@ -49,14 +49,9 @@ ThumbnailImageProvider::requestImage( const QString& id, QSize* size, const QSiz
auto infos = tmp.split( '/' );
auto libraryUuid = infos[0];
auto clip = Core::instance()->library()->clip( libraryUuid );
- Backend::MLT::MLTInput input( qPrintable( clip->media()->mrl() ) );
- input.setPosition( infos[0].toLongLong() );
- size->setWidth( input.width() );
- size->setHeight( input.height() );
+ QImage snapshot( clip->media()->snapshot() );
+ *size = snapshot.size();
auto width = requestedSize.width() > 0 ? requestedSize.width() : size->width();
auto height = requestedSize.height() > 0 ? requestedSize.height() : size->height();
- auto image = input.image( width, height );
- QImage qImg( image, width, height, QImage::Format_RGBA8888,
- []( void* ptr ){ delete[] (uint8_t*)ptr; } );
- return qImg;
+ return snapshot.scaled( width, height );
}
More information about the Vlmc-devel
mailing list