From ea06f348d9ace8a9d1bfa7ba779a579cac0f7fdc Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Mon, 9 Oct 2023 15:31:26 +0200 Subject: [PATCH] modify FFMPEG hevc plugin names to match existing style --- CMakeLists.txt | 8 ++++---- libheif/plugin_registry.cc | 4 ++-- libheif/plugins/CMakeLists.txt | 6 +++--- .../{heif_decoder_ffmpeg.cc => decoder_ffmpeg_hevc.cc} | 6 +++--- .../{heif_decoder_ffmpeg.h => decoder_ffmpeg_hevc.h} | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename libheif/plugins/{heif_decoder_ffmpeg.cc => decoder_ffmpeg_hevc.cc} (99%) rename libheif/plugins/{heif_decoder_ffmpeg.h => decoder_ffmpeg_hevc.h} (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8363c1ae16..144de0c590 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,13 +110,13 @@ plugin_option(OpenJPEG_DECODER OpenJPEG "OpenJPEG_Decoder" "JPEG2000 decoder" OF # FFMPEG detection works slightly differently. We cannot use plugin_option(). -option(WITH_FFMPEG_DECODER "Build FFMPEG HEVC decoder (HW accelerated)" OFF) -option(WITH_FFMPEG_DECODER_PLUGIN "Build FFMPEG HEVC decoder as a plugin" OFF) -if (WITH_FFMPEG_DECODER) +option(WITH_FFMPEG_HEVC_DECODER "Build FFMPEG HEVC decoder (HW accelerated)" OFF) +option(WITH_FFMPEG_HEVC_DECODER_PLUGIN "Build FFMPEG HEVC decoder as a plugin" OFF) +if (WITH_FFMPEG_HEVC_DECODER) find_package(FFMPEG COMPONENTS avcodec) endif () -if (FFMPEG_avcodec_FOUND AND WITH_FFMPEG_DECODER_PLUGIN AND PLUGIN_LOADING_SUPPORTED_AND_ENABLED) +if (FFMPEG_avcodec_FOUND AND WITH_FFMPEG_HEVC_DECODER_PLUGIN AND PLUGIN_LOADING_SUPPORTED_AND_ENABLED) set(msg "found plugin") elseif (FFMPEG_avcodec_FOUND) set(msg " found built-in") diff --git a/libheif/plugin_registry.cc b/libheif/plugin_registry.cc index 0e88e10820..1504bd9fe6 100644 --- a/libheif/plugin_registry.cc +++ b/libheif/plugin_registry.cc @@ -58,7 +58,7 @@ #include "libheif/plugins/encoder_svt.h" #endif -#if HAVE_FFMPEG_DECODER +#if HAVE_FFMPEG_HEVC_DECODER #include "libheif/plugins/heif_decoder_ffmpeg.h" #endif @@ -151,7 +151,7 @@ void register_default_plugins() register_encoder(get_encoder_plugin_svt()); #endif -#if HAVE_FFMPEG_DECODER +#if HAVE_FFMPEG_HEVC_DECODER register_decoder(get_decoder_plugin_ffmpeg()); #endif diff --git a/libheif/plugins/CMakeLists.txt b/libheif/plugins/CMakeLists.txt index 1cfbdbbc1f..9b8b732df7 100644 --- a/libheif/plugins/CMakeLists.txt +++ b/libheif/plugins/CMakeLists.txt @@ -87,9 +87,9 @@ set(KVAZAAR_sources encoder_kvazaar.cc encoder_kvazaar.h) set(KVAZAAR_extra_plugin_sources) plugin_compilation(kvazaar KVAZAAR KVAZAAR KVAZAAR) -set(FFMPEG_DECODER_sources heif_decoder_ffmpeg.cc heif_decoder_ffmpeg.h) -set(FFMPEG_DECODER_extra_plugin_sources ../heif_image.cc ../error.cc) -plugin_compilation(ffmpegdec FFMPEG FFMPEG_DECODER FFMPEG_DECODER) +set(FFMPEG_HEVC_DECODER_sources decoder_ffmpeg_hevc.cc decoder_ffmpeg_hevc.h) +set(FFMPEG_HEVC_DECODER_extra_plugin_sources ../error.cc) +plugin_compilation(ffmpeg_hevc_dec FFMPEG FFMPEG_HEVC_DECODER FFMPEG_HEVC_DECODER) target_sources(heif PRIVATE encoder_mask.h diff --git a/libheif/plugins/heif_decoder_ffmpeg.cc b/libheif/plugins/decoder_ffmpeg_hevc.cc similarity index 99% rename from libheif/plugins/heif_decoder_ffmpeg.cc rename to libheif/plugins/decoder_ffmpeg_hevc.cc index 81870a8a86..8b3520097c 100644 --- a/libheif/plugins/heif_decoder_ffmpeg.cc +++ b/libheif/plugins/decoder_ffmpeg_hevc.cc @@ -20,7 +20,7 @@ #include "libheif/heif.h" #include "libheif/heif_plugin.h" -#include "heif_decoder_ffmpeg.h" +#include "decoder_ffmpeg_hevc.h" #if defined(HAVE_CONFIG_H) #include "config.h" @@ -479,7 +479,7 @@ static const struct heif_decoder_plugin decoder_ffmpeg ffmpeg_v1_push_data, ffmpeg_v1_decode_image, ffmpeg_set_strict_decoding, - "ffmpeg" + "ffmpeg-hevc" }; const struct heif_decoder_plugin* get_decoder_plugin_ffmpeg() @@ -487,7 +487,7 @@ const struct heif_decoder_plugin* get_decoder_plugin_ffmpeg() return &decoder_ffmpeg; } -#if PLUGIN_FFMPEG_DECODER +#if PLUGIN_FFMPEG_HEVC_DECODER heif_plugin_info plugin_info{ 1, heif_plugin_type_decoder, diff --git a/libheif/plugins/heif_decoder_ffmpeg.h b/libheif/plugins/decoder_ffmpeg_hevc.h similarity index 97% rename from libheif/plugins/heif_decoder_ffmpeg.h rename to libheif/plugins/decoder_ffmpeg_hevc.h index 51612ab5fa..6651f5c025 100644 --- a/libheif/plugins/heif_decoder_ffmpeg.h +++ b/libheif/plugins/decoder_ffmpeg_hevc.h @@ -25,7 +25,7 @@ const struct heif_decoder_plugin* get_decoder_plugin_ffmpeg(); -#if PLUGIN_FFMPEG_DECODER +#if PLUGIN_FFMPEG_HEVC_DECODER extern "C" { MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; }