From e3179ad680908ebbca34bf096811fc2f0e8a101f Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Mon, 15 Mar 2021 20:58:21 -0500 Subject: [PATCH] Merge vmfx module into core --- CMakeLists.txt | 5 -- docs/install.txt | 1 - src/modules/CMakeLists.txt | 4 -- src/modules/plus/CMakeLists.txt | 12 ++++- src/modules/plus/Makefile | 5 ++ src/modules/plus/factory.c | 23 +++++++-- src/modules/{vmfx => plus}/filter_chroma.c | 0 src/modules/{vmfx => plus}/filter_chroma.yml | 0 .../{vmfx => plus}/filter_chroma_hold.c | 0 .../{vmfx => plus}/filter_chroma_hold.yml | 0 src/modules/{vmfx => plus}/filter_shape.c | 0 src/modules/{vmfx => plus}/filter_shape.yml | 0 .../filter_mono.c => plus/filter_threshold.c} | 4 +- .../filter_threshold.yml} | 0 src/modules/{vmfx => plus}/producer_pgm.c | 0 src/modules/{vmfx => plus}/producer_pgm.yml | 0 src/modules/vmfx/CMakeLists.txt | 25 --------- src/modules/vmfx/Makefile | 39 -------------- src/modules/vmfx/factory.c | 51 ------------------- 19 files changed, 37 insertions(+), 132 deletions(-) rename src/modules/{vmfx => plus}/filter_chroma.c (100%) rename src/modules/{vmfx => plus}/filter_chroma.yml (100%) rename src/modules/{vmfx => plus}/filter_chroma_hold.c (100%) rename src/modules/{vmfx => plus}/filter_chroma_hold.yml (100%) rename src/modules/{vmfx => plus}/filter_shape.c (100%) rename src/modules/{vmfx => plus}/filter_shape.yml (100%) rename src/modules/{vmfx/filter_mono.c => plus/filter_threshold.c} (94%) rename src/modules/{vmfx/filter_mono.yml => plus/filter_threshold.yml} (100%) rename src/modules/{vmfx => plus}/producer_pgm.c (100%) rename src/modules/{vmfx => plus}/producer_pgm.yml (100%) delete mode 100644 src/modules/vmfx/CMakeLists.txt delete mode 100644 src/modules/vmfx/Makefile delete mode 100644 src/modules/vmfx/factory.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b12bf73e..1f1602154 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,6 @@ option(MOD_SDL1 "Enable SDL1 module" ON) option(MOD_SDL2 "Enable SDL2 module" ON) option(MOD_SOX "Enable SoX module" ON) option(MOD_VIDSTAB "Enable vid.stab module" ON) -option(MOD_VMFX "Enable vmfx module" ON) option(MOD_VORBIS "Enable Vorbis module" ON) option(MOD_XINE "Enable xine module" ON) option(MOD_XML "Enable XML module" ON) @@ -340,10 +339,6 @@ if(MOD_VIDSTAB) endif() endif() -if(MOD_VMFX) - list(APPEND MLT_SUPPORTED_COMPONENTS vmfx) -endif() - if(MOD_VORBIS) pkg_check_modules(vorbis IMPORTED_TARGET vorbis) pkg_check_modules(vorbisfile IMPORTED_TARGET vorbisfile) diff --git a/docs/install.txt b/docs/install.txt index 234d7642c..6c6c9ebe1 100644 --- a/docs/install.txt +++ b/docs/install.txt @@ -41,7 +41,6 @@ Last Revision: 2013-09-07 * sdl - SDL dependent services * sox - !SoX dependent audio filters * vid.stab - video stabilization filters (*) - * vmfx - services contributed by (defunct) Visual Media FX * vorbis - vorbis dependenent services * xine - Xine-derived sources (*) * xml - XML (de)serialization services diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index b78c671b0..c2e551a37 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -84,10 +84,6 @@ if(MOD_VIDSTAB) add_subdirectory(vid.stab) endif() -if(MOD_VMFX) - add_subdirectory(vmfx) -endif() - if(MOD_VORBIS) add_subdirectory(vorbis) endif() diff --git a/src/modules/plus/CMakeLists.txt b/src/modules/plus/CMakeLists.txt index b65477735..1141f0ff1 100644 --- a/src/modules/plus/CMakeLists.txt +++ b/src/modules/plus/CMakeLists.txt @@ -3,6 +3,8 @@ add_library(mltplus MODULE factory.c filter_affine.c filter_charcoal.c + filter_chroma_hold.c + filter_chroma.c filter_dynamictext.c filter_dynamic_loudness.c filter_invert.c @@ -13,12 +15,15 @@ add_library(mltplus MODULE filter_pillar_echo.c filter_rgblut.c filter_sepia.c + filter_shape.c filter_spot_remover.c + filter_strobe.c filter_text.c + filter_threshold.c filter_timer.c - filter_strobe.c producer_blipflash.c producer_count.c + producer_pgm.c transition_affine.c ) @@ -49,6 +54,8 @@ install(FILES consumer_blipflash.yml filter_affine.yml filter_charcoal.yml + filter_chroma_hold.yml + filter_chroma.yml filter_dynamic_loudness.yml filter_dynamictext.yml filter_invert.yml @@ -59,12 +66,15 @@ install(FILES filter_pillar_echo.yml filter_rgblut.yml filter_sepia.yml + filter_shape.yml filter_spot_remover.yml filter_strobe.yml filter_text.yml + filter_threshold.yml filter_timer.yml producer_blipflash.yml producer_count.yml + producer_pgm.yml transition_affine.yml DESTINATION ${MLT_INSTALL_DATA_DIR}/plus ) diff --git a/src/modules/plus/Makefile b/src/modules/plus/Makefile index e5643d884..2f9de7ea2 100644 --- a/src/modules/plus/Makefile +++ b/src/modules/plus/Makefile @@ -11,6 +11,8 @@ OBJS = consumer_blipflash.o \ factory.o \ filter_affine.o \ filter_charcoal.o \ + filter_chroma.o \ + filter_chroma_hold.o \ filter_dynamictext.o \ filter_dynamic_loudness.o \ filter_invert.o \ @@ -23,10 +25,13 @@ OBJS = consumer_blipflash.o \ filter_sepia.o \ filter_spot_remover.o \ filter_text.o \ + filter_threshold.o \ filter_timer.o \ + filter_shape.o \ filter_strobe.o \ producer_blipflash.o \ producer_count.o \ + producer_pgm.o \ transition_affine.o ifdef USE_FFTW diff --git a/src/modules/plus/factory.c b/src/modules/plus/factory.c index e383da075..d139e4ecd 100644 --- a/src/modules/plus/factory.c +++ b/src/modules/plus/factory.c @@ -24,22 +24,27 @@ extern mlt_consumer consumer_blipflash_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_charcoal_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_chroma_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_dynamictext_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_dynamic_loudness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_invert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_lift_gamma_gain_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_loudness_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_loudness_meter_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_lumakey_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_pillar_echo_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); -extern mlt_filter filter_invert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_rgblut_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_sepia_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_spot_remover_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_strobe_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_text_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); +extern mlt_filter filter_threshold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_filter filter_timer_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); -extern mlt_filter filter_strobe_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_producer producer_blipflash_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_producer producer_count_init( const char *arg ); +extern mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_transition transition_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); #ifdef USE_FFTW @@ -59,6 +64,8 @@ MLT_REPOSITORY MLT_REGISTER( mlt_service_consumer_type, "blipflash", consumer_blipflash_init ); MLT_REGISTER( mlt_service_filter_type, "affine", filter_affine_init ); MLT_REGISTER( mlt_service_filter_type, "charcoal", filter_charcoal_init ); + MLT_REGISTER( mlt_service_filter_type, "chroma", filter_chroma_init ); + MLT_REGISTER( mlt_service_filter_type, "chroma_hold", filter_chroma_hold_init ); MLT_REGISTER( mlt_service_filter_type, "dynamictext", filter_dynamictext_init ); MLT_REGISTER( mlt_service_filter_type, "dynamic_loudness", filter_dynamic_loudness_init ); MLT_REGISTER( mlt_service_filter_type, "invert", filter_invert_init ); @@ -69,12 +76,15 @@ MLT_REPOSITORY MLT_REGISTER( mlt_service_filter_type, "pillar_echo", filter_pillar_echo_init ); MLT_REGISTER( mlt_service_filter_type, "rgblut", filter_rgblut_init ); MLT_REGISTER( mlt_service_filter_type, "sepia", filter_sepia_init ); + MLT_REGISTER( mlt_service_filter_type, "shape", filter_shape_init ); MLT_REGISTER( mlt_service_filter_type, "spot_remover", filter_spot_remover_init ); + MLT_REGISTER( mlt_service_filter_type, "strobe", filter_strobe_init ); MLT_REGISTER( mlt_service_filter_type, "text", filter_text_init ); + MLT_REGISTER( mlt_service_filter_type, "threshold", filter_threshold_init ); MLT_REGISTER( mlt_service_filter_type, "timer", filter_timer_init ); - MLT_REGISTER( mlt_service_filter_type, "strobe", filter_strobe_init ); MLT_REGISTER( mlt_service_producer_type, "blipflash", producer_blipflash_init ); MLT_REGISTER( mlt_service_producer_type, "count", producer_count_init ); + MLT_REGISTER( mlt_service_producer_type, "pgm", producer_pgm_init ); MLT_REGISTER( mlt_service_transition_type, "affine", transition_affine_init ); #ifdef USE_FFTW MLT_REGISTER( mlt_service_filter_type, "dance", filter_dance_init ); @@ -84,6 +94,8 @@ MLT_REPOSITORY MLT_REGISTER_METADATA( mlt_service_consumer_type, "blipflash", metadata, "consumer_blipflash.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "affine", metadata, "filter_affine.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "charcoal", metadata, "filter_charcoal.yml" ); + MLT_REGISTER_METADATA( mlt_service_filter_type, "chroma", metadata, "filter_chroma.yml" ); + MLT_REGISTER_METADATA( mlt_service_filter_type, "chroma_hold", metadata, "filter_chroma_hold.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "dynamictext", metadata, "filter_dynamictext.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "dynamic_loudness", metadata, "filter_dynamic_loudness.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "invert", metadata, "filter_invert.yml" ); @@ -94,12 +106,15 @@ MLT_REPOSITORY MLT_REGISTER_METADATA( mlt_service_filter_type, "pillar_echo", metadata, "filter_pillar_echo.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "rgblut", metadata, "filter_rgblut.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "sepia", metadata, "filter_sepia.yml" ); + MLT_REGISTER_METADATA( mlt_service_filter_type, "shape", metadata, "filter_shape.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "spot_remover", metadata, "filter_spot_remover.yml" ); + MLT_REGISTER_METADATA( mlt_service_filter_type, "strobe", metadata, "filter_strobe.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "text", metadata, "filter_text.yml" ); + MLT_REGISTER_METADATA( mlt_service_filter_type, "threshold", metadata, "filter_threshold.yml" ); MLT_REGISTER_METADATA( mlt_service_filter_type, "timer", metadata, "filter_timer.yml" ); - MLT_REGISTER_METADATA( mlt_service_filter_type, "strobe", metadata, "filter_strobe.yml" ); MLT_REGISTER_METADATA( mlt_service_producer_type, "blipflash", metadata, "producer_blipflash.yml" ); MLT_REGISTER_METADATA( mlt_service_producer_type, "count", metadata, "producer_count.yml" ); + MLT_REGISTER_METADATA( mlt_service_producer_type, "pgm", metadata, "producer_pgm.yml" ); MLT_REGISTER_METADATA( mlt_service_transition_type, "affine", metadata, "transition_affine.yml" ); #ifdef USE_FFTW MLT_REGISTER_METADATA( mlt_service_filter_type, "dance", metadata, "filter_dance.yml" ); diff --git a/src/modules/vmfx/filter_chroma.c b/src/modules/plus/filter_chroma.c similarity index 100% rename from src/modules/vmfx/filter_chroma.c rename to src/modules/plus/filter_chroma.c diff --git a/src/modules/vmfx/filter_chroma.yml b/src/modules/plus/filter_chroma.yml similarity index 100% rename from src/modules/vmfx/filter_chroma.yml rename to src/modules/plus/filter_chroma.yml diff --git a/src/modules/vmfx/filter_chroma_hold.c b/src/modules/plus/filter_chroma_hold.c similarity index 100% rename from src/modules/vmfx/filter_chroma_hold.c rename to src/modules/plus/filter_chroma_hold.c diff --git a/src/modules/vmfx/filter_chroma_hold.yml b/src/modules/plus/filter_chroma_hold.yml similarity index 100% rename from src/modules/vmfx/filter_chroma_hold.yml rename to src/modules/plus/filter_chroma_hold.yml diff --git a/src/modules/vmfx/filter_shape.c b/src/modules/plus/filter_shape.c similarity index 100% rename from src/modules/vmfx/filter_shape.c rename to src/modules/plus/filter_shape.c diff --git a/src/modules/vmfx/filter_shape.yml b/src/modules/plus/filter_shape.yml similarity index 100% rename from src/modules/vmfx/filter_shape.yml rename to src/modules/plus/filter_shape.yml diff --git a/src/modules/vmfx/filter_mono.c b/src/modules/plus/filter_threshold.c similarity index 94% rename from src/modules/vmfx/filter_mono.c rename to src/modules/plus/filter_threshold.c index fd030a820..c3421c0e7 100644 --- a/src/modules/vmfx/filter_mono.c +++ b/src/modules/plus/filter_threshold.c @@ -1,5 +1,5 @@ /* - * filter_mono.c -- Arbitrary alpha channel shaping + * filter_threshold.c -- Arbitrary alpha channel shaping * Copyright (C) 2005 Visual Media Fx Inc. * Author: Charles Yates * @@ -90,7 +90,7 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame ) /** Constructor for the filter. */ -mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) +mlt_filter filter_threshold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { mlt_filter filter = mlt_filter_new( ); if ( filter != NULL ) diff --git a/src/modules/vmfx/filter_mono.yml b/src/modules/plus/filter_threshold.yml similarity index 100% rename from src/modules/vmfx/filter_mono.yml rename to src/modules/plus/filter_threshold.yml diff --git a/src/modules/vmfx/producer_pgm.c b/src/modules/plus/producer_pgm.c similarity index 100% rename from src/modules/vmfx/producer_pgm.c rename to src/modules/plus/producer_pgm.c diff --git a/src/modules/vmfx/producer_pgm.yml b/src/modules/plus/producer_pgm.yml similarity index 100% rename from src/modules/vmfx/producer_pgm.yml rename to src/modules/plus/producer_pgm.yml diff --git a/src/modules/vmfx/CMakeLists.txt b/src/modules/vmfx/CMakeLists.txt deleted file mode 100644 index a9e6101dd..000000000 --- a/src/modules/vmfx/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -add_library(mltvmfx MODULE - factory.c - filter_chroma_hold.c - filter_chroma.c - filter_mono.c - filter_shape.c - producer_pgm.c -) - -target_compile_options(mltvmfx PRIVATE ${MLT_COMPILE_OPTIONS}) - -target_link_libraries(mltvmfx PRIVATE mlt) - -set_target_properties(mltvmfx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${MLT_MODULE_OUTPUT_DIRECTORY}") - -install(TARGETS mltvmfx LIBRARY DESTINATION ${MLT_INSTALL_MODULE_DIR}) - -install(FILES - filter_chroma_hold.yml - filter_chroma.yml - filter_mono.yml - filter_shape.yml - producer_pgm.yml - DESTINATION ${MLT_INSTALL_DATA_DIR}/vmfx -) diff --git a/src/modules/vmfx/Makefile b/src/modules/vmfx/Makefile deleted file mode 100644 index 2343ec94a..000000000 --- a/src/modules/vmfx/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -CFLAGS += -I../.. - -LDFLAGS += -L../../framework -lmlt - -include ../../../config.mak - -TARGET = ../libmltvmfx$(LIBSUF) - -OBJS = factory.o \ - filter_chroma.o \ - filter_chroma_hold.o \ - filter_mono.o \ - filter_shape.o \ - producer_pgm.o - -SRCS := $(OBJS:.o=.c) - -all: $(TARGET) - -$(TARGET): $(OBJS) - $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS) - -depend: $(SRCS) - $(CC) -MM $(CFLAGS) $^ 1>.depend - -distclean: clean - rm -f .depend - -clean: - rm -f $(OBJS) $(TARGET) - -install: all - install -m 755 $(TARGET) "$(DESTDIR)$(moduledir)" - install -d "$(DESTDIR)$(mltdatadir)/vmfx" - install -m 644 *.yml "$(DESTDIR)$(mltdatadir)/vmfx" - -ifneq ($(wildcard .depend),) -include .depend -endif diff --git a/src/modules/vmfx/factory.c b/src/modules/vmfx/factory.c deleted file mode 100644 index 5b8b30f16..000000000 --- a/src/modules/vmfx/factory.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * factory.c -- the factory method interfaces - * Copyright (C) 2005 Visual Media Fx Inc. - * Author: Charles Yates - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include -#include -#include - -extern mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); -extern mlt_filter filter_chroma_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); -extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); -extern mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); -extern mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); - -static mlt_properties metadata( mlt_service_type type, const char *id, void *data ) -{ - char file[ PATH_MAX ]; - snprintf( file, PATH_MAX, "%s/vmfx/%s", mlt_environment( "MLT_DATA" ), (char*) data ); - return mlt_properties_parse_yaml( file ); -} - -MLT_REPOSITORY -{ - MLT_REGISTER( mlt_service_filter_type, "chroma", filter_chroma_init ); - MLT_REGISTER( mlt_service_filter_type, "chroma_hold", filter_chroma_hold_init ); - MLT_REGISTER( mlt_service_filter_type, "threshold", filter_mono_init ); - MLT_REGISTER( mlt_service_filter_type, "shape", filter_shape_init ); - MLT_REGISTER( mlt_service_producer_type, "pgm", producer_pgm_init ); - - MLT_REGISTER_METADATA( mlt_service_filter_type, "chroma", metadata, "filter_chroma.yml" ); - MLT_REGISTER_METADATA( mlt_service_filter_type, "chroma_hold", metadata, "filter_chroma_hold.yml" ); - MLT_REGISTER_METADATA( mlt_service_filter_type, "threshold", metadata, "filter_mono.yml" ); - MLT_REGISTER_METADATA( mlt_service_filter_type, "shape", metadata, "filter_shape.yml" ); - MLT_REGISTER_METADATA( mlt_service_producer_type, "pgm", metadata, "producer_pgm.yml" ); -}