diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fileinfo')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp | 9 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fileinfo/MainUI.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp index 40d2d544..0fb736d3 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.cpp @@ -25,6 +25,7 @@ MainUI::MainUI() : QDialog(), ui(new Ui::MainUI){ SetupConnections(); player = new QMediaPlayer(this, QMediaPlayer::VideoSurface); surface = new LVideoSurface(this); + qDebug() << surface->surfaceFormat(); player->setVideoOutput(surface); player->setMuted(true); connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(setDuration(QMediaPlayer::MediaStatus))); @@ -96,7 +97,11 @@ void MainUI::LoadFile(QString path, QString type){ ui->label_file_size->setText( ui->label_file_size->text()+" ("+QString::number(pix.width())+" x "+QString::number(pix.height())+" px)" ); //qDebug() << " - done with image"; }else if(INFO->isVideo()){ - player->setMedia(QUrl("file://"+INFO->absoluteFilePath())); + timer.start(); + QMediaResource video = QMediaResource(QUrl("file://"+INFO->absoluteFilePath())); + video.setResolution(64,64); + player->setMedia(video); + //player->setMedia(QUrl("file://"+INFO->absoluteFilePath())); player->play(); player->pause(); //Pixmap set when video is loaded in stopVideo @@ -313,6 +318,8 @@ void MainUI::getXdgCommand(QString prev){ void MainUI::stopVideo(QPixmap img) { ui->label_file_icon->setPixmap( img.scaledToHeight(64) ); player->pause(); + qDebug() << timer.elapsed(); + qDebug() << player->media().canonicalResource().resolution(); } void MainUI::setDuration(QMediaPlayer::MediaStatus status) { diff --git a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h index 5ce7b01a..3bc85aae 100644 --- a/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fileinfo/MainUI.h @@ -17,6 +17,7 @@ #include <QMediaPlayer> #include <LuminaXDG.h> #include <LVideoSurface.h> +#include <QElapsedTimer> namespace Ui{ class MainUI; }; @@ -38,6 +39,7 @@ private: LVideoSurface *surface; QMediaPlayer *player; bool flag; + QElapsedTimer timer; bool canwrite; bool terminate_thread; //flag for terminating the GetDirSize task |