thumbnailers: check if video_thumbnailer has prefer_embedded_metadata member

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-20 15:32:12 +02:00
parent 5656ab78ae
commit 8ba3a521a3
3 changed files with 17 additions and 1 deletions

View file

@ -1,7 +1,8 @@
project(ffmpegthumbs) project(ffmpegthumbs)
include(CheckSymbolExists)
include(CMakePushCheckState) include(CMakePushCheckState)
include(CheckSymbolExists)
include(CheckStructHasMember)
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
@ -16,6 +17,13 @@ check_symbol_exists(
"libffmpegthumbnailer/videothumbnailerc.h" "libffmpegthumbnailer/videothumbnailerc.h"
HAVE_VIDEO_THUMBNAILER_SET_SIZE HAVE_VIDEO_THUMBNAILER_SET_SIZE
) )
check_struct_has_member(
"struct video_thumbnailer"
"prefer_embedded_metadata"
"libffmpegthumbnailer/videothumbnailerc.h"
HAVE_PREFER_EMBEDDED_METADATA
)
cmake_reset_check_state() cmake_reset_check_state()
configure_file ( configure_file (

View file

@ -1,2 +1,5 @@
/* Defines if you have video_thumbnailer_set_size() */ /* Defines if you have video_thumbnailer_set_size() */
#cmakedefine HAVE_VIDEO_THUMBNAILER_SET_SIZE 1 #cmakedefine HAVE_VIDEO_THUMBNAILER_SET_SIZE 1
/* Defines if video_thumbnailer has prefer_embedded_metadata member */
#cmakedefine HAVE_PREFER_EMBEDDED_METADATA 1

View file

@ -90,7 +90,9 @@ bool FFMpegThumbnailer::create(const QString &path, int width, int heigth, QImag
#endif #endif
ffmpegthumb->seek_percentage = 20; ffmpegthumb->seek_percentage = 20;
ffmpegthumb->overlay_film_strip = ffmpegthumbssettings->film_strip(); ffmpegthumb->overlay_film_strip = ffmpegthumbssettings->film_strip();
#if defined(HAVE_PREFER_EMBEDDED_METADATA)
ffmpegthumb->prefer_embedded_metadata = ffmpegthumbssettings->prefer_embedded_metadata(); ffmpegthumb->prefer_embedded_metadata = ffmpegthumbssettings->prefer_embedded_metadata();
#endif
ffmpegthumb->workaround_bugs = ffmpegthumbssettings->workaround_bugs(); ffmpegthumb->workaround_bugs = ffmpegthumbssettings->workaround_bugs();
ffmpegthumb->thumbnail_image_type = ThumbnailerImageType::Png; ffmpegthumb->thumbnail_image_type = ThumbnailerImageType::Png;
@ -136,6 +138,9 @@ QWidget *FFMpegThumbnailer::createConfigurationWidget()
ffmpegthumbsformwidget->filmStripCheckBox->setChecked(ffmpegthumbssettings->film_strip()); ffmpegthumbsformwidget->filmStripCheckBox->setChecked(ffmpegthumbssettings->film_strip());
ffmpegthumbsformwidget->preferEmbeddedMetadataCheckBox->setChecked(ffmpegthumbssettings->prefer_embedded_metadata()); ffmpegthumbsformwidget->preferEmbeddedMetadataCheckBox->setChecked(ffmpegthumbssettings->prefer_embedded_metadata());
ffmpegthumbsformwidget->workaroundBugsCheckBox->setChecked(ffmpegthumbssettings->workaround_bugs()); ffmpegthumbsformwidget->workaroundBugsCheckBox->setChecked(ffmpegthumbssettings->workaround_bugs());
#if !defined(HAVE_PREFER_EMBEDDED_METADATA)
ffmpegthumbsformwidget->preferEmbeddedMetadataCheckBox->setVisible(false);
#endif
return ffmpegthumbsformwidget; return ffmpegthumbsformwidget;
} }