Skip to content

Commit

Permalink
Revert "fix: Remove Thumbnailer dependency (#294)" (#295)
Browse files Browse the repository at this point in the history
This reverts commit 0b8cd83.
  • Loading branch information
pengfeixx authored Jun 14, 2024
1 parent 0b8cd83 commit be33ea8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Depends:
${shlibs:Depends},
${misc:Depends},
libavcodec58 (>= 7:4.0) | libavcodec60, libavformat58 (>= 7:4.1) | libavformat60, libavutil56 (>= 7:4.0) | libavutil58, libswresample3 (>= 7:4.0) | libswresample4, libswscale5 (>= 7:4.0) | libswscale7,
libdtkcore5, libdtkgui5, libdtkwidget5, libgl1, libpng16-16 (>= 1.6.2-1), libportaudio2 (>= 19+svn20101113), libqt5concurrent5 (>= 5.0.2), libqt5core5a (>= 5.11.0~rc1),
libdtkcore5, libdtkgui5, libdtkwidget5, libffmpegthumbnailer4v5, libgl1, libpng16-16 (>= 1.6.2-1), libportaudio2 (>= 19+svn20101113), libqt5concurrent5 (>= 5.0.2), libqt5core5a (>= 5.11.0~rc1),
libqt5dbus5 (>= 5.0.2), libqt5gui5 (>= 5.8.0), libqt5network5 (>= 5.0.2), libqt5printsupport5 (>= 5.0.2), libqt5widgets5 (>= 5.2.0~alpha1), libqt5x11extras5 (>= 5.6.0), libasound2 (>= 1.0.16),
libqt5xml5 (>= 5.0.2), libsdl2-2.0-0 (>= 2.0.9), libstdc++6 (>= 7), libudev1 (>= 183), libusb-1.0-0 (>= 2:1.0.8), libv4l-0 (>= 0.5.0), zlib1g (>= 1:1.1.4), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0), dde-api,
libdwaylandclient5 | libkf5waylandclient5, libdwaylandserver5 | libkf5waylandserver5
Recommends: libimageeditor, uos-reporter, deepin-event-log, libffmpegthumbnailer4v5
Recommends: libimageeditor, uos-reporter, deepin-event-log
Description:this package software for UOS
deepin-camera is a tool to view camera, and also a smart take photo and video in life.
38 changes: 18 additions & 20 deletions src/src/imageitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,25 @@ void ImageItem::updatePicPath(const QString &filePath)
if (fileInfo.suffix() == "webm" || fileInfo.suffix() == "mp4") {
m_bVideo = true;
if (DataManager::instance()->encodeEnv() == FFmpeg_Env) {
if (getLoadLibsInstance()->m_video_thumbnailer) {
video_thumbnailer *m_video_thumbnailer = getLoadLibsInstance()->m_video_thumbnailer();
image_data *m_image_data = getLoadLibsInstance()->m_video_thumbnailer_create_image_data();

try {
//thumber.generateThumbnail(m_path.toUtf8().toStdString(), ThumbnailerImageType::Png, buf);//异常视频这里老崩,给上游提交bug的出处
getLoadLibsInstance()->m_video_thumbnailer_generate_thumbnail_to_buffer(m_video_thumbnailer, m_path.toUtf8().data(), m_image_data);
QImage img = QImage::fromData(m_image_data->image_data_ptr, static_cast<int>(m_image_data->image_data_size), "png");
img.scaled(THUMBNAIL_PIXMAP_SIZE, THUMBNAIL_PIXMAP_SIZE, Qt::KeepAspectRatioByExpanding);
pix = QPixmap::fromImage(img);
malloc_trim(0);
} catch (...) {
qWarning() << "generateThumbnail failed";
}

getLoadLibsInstance()->m_video_thumbnailer_destroy_image_data(m_image_data);
getLoadLibsInstance()->m_video_thumbnailer_destroy(m_video_thumbnailer);

m_image_data = nullptr;
m_video_thumbnailer = nullptr;
video_thumbnailer *m_video_thumbnailer = getLoadLibsInstance()->m_video_thumbnailer();
image_data *m_image_data = getLoadLibsInstance()->m_video_thumbnailer_create_image_data();

try {
//thumber.generateThumbnail(m_path.toUtf8().toStdString(), ThumbnailerImageType::Png, buf);//异常视频这里老崩,给上游提交bug的出处
getLoadLibsInstance()->m_video_thumbnailer_generate_thumbnail_to_buffer(m_video_thumbnailer, m_path.toUtf8().data(), m_image_data);
QImage img = QImage::fromData(m_image_data->image_data_ptr, static_cast<int>(m_image_data->image_data_size), "png");
img.scaled(THUMBNAIL_PIXMAP_SIZE, THUMBNAIL_PIXMAP_SIZE, Qt::KeepAspectRatioByExpanding);
pix = QPixmap::fromImage(img);
malloc_trim(0);
} catch (...) {
qWarning() << "generateThumbnail failed";
}

getLoadLibsInstance()->m_video_thumbnailer_destroy_image_data(m_image_data);
getLoadLibsInstance()->m_video_thumbnailer_destroy(m_video_thumbnailer);

m_image_data = nullptr;
m_video_thumbnailer = nullptr;
}
} else if (fileInfo.suffix() == "jpg") {
m_bVideo = false;
Expand Down

0 comments on commit be33ea8

Please sign in to comment.