diff options
Diffstat (limited to 'src/post')
59 files changed, 312 insertions, 699 deletions
diff --git a/src/post/Makefile.am b/src/post/Makefile.am index 8408c3f3a..f6706f221 100644 --- a/src/post/Makefile.am +++ b/src/post/Makefile.am @@ -1,4 +1,4 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_srcdir)/misc/Makefile.common -SUBDIRS = \ - planar goom visualizations mosaico deinterlace audio +SUBDIRS = planar goom visualizations mosaico deinterlace audio diff --git a/src/post/audio/Makefile.am b/src/post/audio/Makefile.am index 78b94cd43..a359310e6 100644 --- a/src/post/audio/Makefile.am +++ b/src/post/audio/Makefile.am @@ -1,13 +1,15 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) +AM_LDFLAGS = $(xineplug_ldflags) + noinst_HEADERS = dsp.h filter.h window.h audio_filters.h xinepost_LTLIBRARIES = xineplug_post_audio_filters.la xineplug_post_audio_filters_la_SOURCES = \ upmix.c upmix_mono.c filter.c window.c stretch.c volnorm.c audio_filters.c -xineplug_post_audio_filters_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm -xineplug_post_audio_filters_la_CFLAGS = $(VISIBILITY_FLAG) -xineplug_post_audio_filters_la_LDFLAGS = $(xineplug_ldflags) - +xineplug_post_audio_filters_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing +xineplug_post_audio_filters_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) -lm diff --git a/src/post/audio/audio_filters.c b/src/post/audio/audio_filters.c index eb90d38cb..78f495ca6 100644 --- a/src/post/audio/audio_filters.c +++ b/src/post/audio/audio_filters.c @@ -24,9 +24,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "audio_filters.h" @@ -39,9 +39,9 @@ static const post_info_t volnorm_special_info = { XINE_POST_TYPE_AUDIO_FILTER const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 9, "upmix", XINE_VERSION_CODE, &upmix_special_info, &upmix_init_plugin }, - { PLUGIN_POST, 9, "upmix_mono", XINE_VERSION_CODE, &upmix_mono_special_info, &upmix_mono_init_plugin }, - { PLUGIN_POST, 9, "stretch", XINE_VERSION_CODE, &stretch_special_info, &stretch_init_plugin }, - { PLUGIN_POST, 9, "volnorm", XINE_VERSION_CODE, &volnorm_special_info, &volnorm_init_plugin }, - { PLUGIN_NONE, 0, "", 0, NULL, NULL } + { PLUGIN_POST, 10, "upmix", XINE_VERSION_CODE, &upmix_special_info, &upmix_init_plugin }, + { PLUGIN_POST, 10, "upmix_mono", XINE_VERSION_CODE, &upmix_mono_special_info, &upmix_mono_init_plugin }, + { PLUGIN_POST, 10, "stretch", XINE_VERSION_CODE, &stretch_special_info, &stretch_init_plugin }, + { PLUGIN_POST, 10, "volnorm", XINE_VERSION_CODE, &volnorm_special_info, &volnorm_init_plugin }, + { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/post/audio/audio_filters.h b/src/post/audio/audio_filters.h index c2bf88cf8..144e85836 100644 --- a/src/post/audio/audio_filters.h +++ b/src/post/audio/audio_filters.h @@ -20,7 +20,7 @@ * catalog for audio filter plugins */ -#include "xine_internal.h" +#include <xine/xine_internal.h> void *upmix_init_plugin(xine_t *xine, void *data); diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c index e315b11a8..1f130eff8 100644 --- a/src/post/audio/stretch.c +++ b/src/post/audio/stretch.c @@ -26,11 +26,11 @@ #include <stdio.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "dsp.h" -#include "resample.h" +#include <xine/resample.h> #include "audio_filters.h" @@ -663,33 +663,18 @@ static post_plugin_t *stretch_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *stretch_get_identifier(post_class_t *class_gen) -{ - return "stretch"; -} - -static char *stretch_get_description(post_class_t *class_gen) -{ - return "Time stretch by a given factor, optionally preserving pitch"; -} - -static void stretch_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *stretch_init_plugin(xine_t *xine, void *data) { - post_class_stretch_t *class = (post_class_stretch_t *)malloc(sizeof(post_class_stretch_t)); + post_class_stretch_t *class = (post_class_stretch_t *)xine_xmalloc(sizeof(post_class_stretch_t)); if (!class) return NULL; class->post_class.open_plugin = stretch_open_plugin; - class->post_class.get_identifier = stretch_get_identifier; - class->post_class.get_description = stretch_get_description; - class->post_class.dispose = stretch_class_dispose; + class->post_class.identifier = "stretch"; + class->post_class.description = N_("Time stretch by a given factor, optionally preserving pitch"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c index f4ea9544a..97edd47dd 100644 --- a/src/post/audio/upmix.c +++ b/src/post/audio/upmix.c @@ -30,9 +30,9 @@ #include <stdio.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "dsp.h" #include "audio_filters.h" @@ -420,33 +420,18 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *upmix_get_identifier(post_class_t *class_gen) -{ - return "upmix"; -} - -static char *upmix_get_description(post_class_t *class_gen) -{ - return "upmix"; -} - -static void upmix_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *upmix_init_plugin(xine_t *xine, void *data) { - post_class_upmix_t *class = (post_class_upmix_t *)malloc(sizeof(post_class_upmix_t)); + post_class_upmix_t *class = (post_class_upmix_t *)xine_xmalloc(sizeof(post_class_upmix_t)); if (!class) return NULL; class->post_class.open_plugin = upmix_open_plugin; - class->post_class.get_identifier = upmix_get_identifier; - class->post_class.get_description = upmix_get_description; - class->post_class.dispose = upmix_class_dispose; + class->post_class.identifier = "upmix"; + class->post_class.description = N_("upmix"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c index 1e5e05549..7fb6c7bd9 100644 --- a/src/post/audio/upmix_mono.c +++ b/src/post/audio/upmix_mono.c @@ -35,8 +35,8 @@ #define LOG */ -#include "xineutils.h" -#include "post.h" +#include <xine/xineutils.h> +#include <xine/post.h> #include "audio_filters.h" @@ -333,33 +333,18 @@ static post_plugin_t *upmix_mono_open_plugin(post_class_t *class_gen, int inputs return &this->post; } -static char *upmix_mono_get_identifier(post_class_t *class_gen) -{ - return "upmix_mono"; -} - -static char *upmix_mono_get_description(post_class_t *class_gen) -{ - return "converts Mono into Stereo"; -} - -static void upmix_mono_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *upmix_mono_init_plugin(xine_t *xine, void *data) { - post_class_upmix_mono_t *class = (post_class_upmix_mono_t *)malloc(sizeof(post_class_upmix_mono_t)); + post_class_upmix_mono_t *class = (post_class_upmix_mono_t *)xine_xmalloc(sizeof(post_class_upmix_mono_t)); if (!class) return NULL; class->post_class.open_plugin = upmix_mono_open_plugin; - class->post_class.get_identifier = upmix_mono_get_identifier; - class->post_class.get_description = upmix_mono_get_description; - class->post_class.dispose = upmix_mono_class_dispose; + class->post_class.identifier = "upmix_mono"; + class->post_class.description = N_("converts Mono into Stereo"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c index 945fd2505..dda38fa5f 100644 --- a/src/post/audio/volnorm.c +++ b/src/post/audio/volnorm.c @@ -29,9 +29,9 @@ #include <stdio.h> #include <math.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "dsp.h" #include "audio_filters.h" @@ -449,33 +449,18 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *volnorm_get_identifier(post_class_t *class_gen) -{ - return "volnorm"; -} - -static char *volnorm_get_description(post_class_t *class_gen) -{ - return "Normalize volume"; -} - -static void volnorm_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *volnorm_init_plugin(xine_t *xine, void *data) { - post_class_volnorm_t *class = (post_class_volnorm_t *)malloc(sizeof(post_class_volnorm_t)); + post_class_volnorm_t *class = (post_class_volnorm_t *)xine_xmalloc(sizeof(post_class_volnorm_t)); if (!class) return NULL; class->post_class.open_plugin = volnorm_open_plugin; - class->post_class.get_identifier = volnorm_get_identifier; - class->post_class.get_description = volnorm_get_description; - class->post_class.dispose = volnorm_class_dispose; + class->post_class.identifier = "volnorm"; + class->post_class.description = N_("Normalize volume"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/deinterlace/Makefile.am b/src/post/deinterlace/Makefile.am index 079ed5baf..cde794988 100644 --- a/src/post/deinterlace/Makefile.am +++ b/src/post/deinterlace/Makefile.am @@ -1,19 +1,18 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common -SUBDIRS = plugins +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) +AM_LDFLAGS = $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS) -EXTRA_DIST = +SUBDIRS = plugins xinepost_LTLIBRARIES = xineplug_post_tvtime.la xineplug_post_tvtime_la_SOURCES = xine_plugin.c \ deinterlace.c pulldown.c speedy.c tvtime.c +xineplug_post_tvtime_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(PTHREAD_LIBS) \ $(top_builddir)/src/post/deinterlace/plugins/libdeinterlaceplugins.la -xineplug_post_tvtime_la_CFLAGS = $(VISIBILITY_FLAG) -xineplug_post_tvtime_la_LDFLAGS = $(xineplug_ldflags) \ - @IMPURE_TEXT_LDFLAGS@ - noinst_HEADERS = deinterlace.h pulldown.h speedtools.h speedy.h tvtime.h diff --git a/src/post/deinterlace/deinterlace.c b/src/post/deinterlace/deinterlace.c index 8e4a3bb00..5c0356c55 100644 --- a/src/post/deinterlace/deinterlace.c +++ b/src/post/deinterlace/deinterlace.c @@ -31,7 +31,7 @@ */ #include "deinterlace.h" -#include "xine_internal.h" +#include <xine/xine_internal.h> typedef struct methodlist_item_s methodlist_item_t; diff --git a/src/post/deinterlace/plugins/Makefile.am b/src/post/deinterlace/plugins/Makefile.am index 5e50c25f4..800e6b0fa 100644 --- a/src/post/deinterlace/plugins/Makefile.am +++ b/src/post/deinterlace/plugins/Makefile.am @@ -1,3 +1,4 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_srcdir)/misc/Makefile.common # plugins/Makefile.am distributes the plugins that come with tvtime. @@ -17,6 +18,11 @@ include $(top_srcdir)/misc/Makefile.common # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# libpostproc is here so we can use their nice mangle.h +AM_CFLAGS = $(VISIBILITY_FLAG) +AM_CPPFLAGS = -I$(top_srcdir)/src/post/deinterlace \ + -I$(top_srcdir)/src/xine-utils + EXTRA_DIST = greedy2frame_template.c greedyh.asm \ tomsmocomp/SearchLoop0A.inc tomsmocomp/SearchLoopBottom.inc \ tomsmocomp/SearchLoopEdgeA.inc tomsmocomp/SearchLoopEdgeA8.inc \ @@ -28,27 +34,26 @@ EXTRA_DIST = greedy2frame_template.c greedyh.asm \ tomsmocomp/TomsMoCompAll2.inc tomsmocomp/WierdBob.inc \ tomsmocomp/tomsmocompmacros.h x86-64_macros.inc -# libpostproc is here so we can use their nice mangle.h -AM_CFLAGS = -I$(top_srcdir)/src/post/deinterlace \ - -I$(top_srcdir)/src/xine-utils - -# Avoid "can't find register" failures with -O0, -O2, -O3 (gcc 4.0) -libdeinterlaceplugins_la-kdetv_greedyh.o libdeinterlaceplugins_la-kdetv_greedyh.lo: CFLAGS=$(shell echo @CFLAGS@ | sed -e 's/$$/ -O1/') - -noinst_LTLIBRARIES = libdeinterlaceplugins.la - -libdeinterlaceplugins_la_SOURCES = \ - double.c \ - greedy.c \ - linear.c \ - linearblend.c \ - vfir.c \ - weave.c \ - greedy2frame.c \ - scalerbob.c \ - kdetv_greedyh.c \ - kdetv_tomsmocomp.c -libdeinterlaceplugins_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -libdeinterlaceplugins_la_LDFLAGS = $(xineplug_ldflags) - noinst_HEADERS = plugins.h greedyhmacros.h + +if DEBUG_BUILD +debug_sources = greedy2frame.c +nodebug_sources = +else +debug_sources = +nodebug_sources = greedy2frame.c +endif + +# per-object CFLAGS -- drop optimization on kdetv_greedyh.c so that gcc +# doesn't run out of general registers trying to compile it. + +noinst_LTLIBRARIES = libdeinterlacepluginsO1.la libdeinterlaceplugins.la +libdeinterlacepluginsO1_la_SOURCES = kdetv_greedyh.c $(debug_sources) +libdeinterlacepluginsO1_la_CFLAGS = $(O1_CFLAGS) $(AM_CFLAGS) + +libdeinterlaceplugins_la_SOURCES = double.c greedy.c linear.c linearblend.c \ + vfir.c weave.c scalerbob.c kdetv_tomsmocomp.c \ + $(nodebug_sources) +libdeinterlaceplugins_la_LIBADD = $(XINE_LIB) libdeinterlacepluginsO1.la +libdeinterlaceplugins_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS) $(AVUTIL_CFLAGS) +libdeinterlaceplugins_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags) diff --git a/src/post/deinterlace/plugins/greedy.c b/src/post/deinterlace/plugins/greedy.c index 925779224..ee401dba6 100644 --- a/src/post/deinterlace/plugins/greedy.c +++ b/src/post/deinterlace/plugins/greedy.c @@ -32,8 +32,9 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> +#include "xine_mmx.h" #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/greedy2frame.c b/src/post/deinterlace/plugins/greedy2frame.c index 57e3228ac..af27d76ee 100644 --- a/src/post/deinterlace/plugins/greedy2frame.c +++ b/src/post/deinterlace/plugins/greedy2frame.c @@ -31,8 +31,8 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/greedy2frame_template.c b/src/post/deinterlace/plugins/greedy2frame_template.c index 7fe52519f..1f4df9161 100644 --- a/src/post/deinterlace/plugins/greedy2frame_template.c +++ b/src/post/deinterlace/plugins/greedy2frame_template.c @@ -100,8 +100,6 @@ static int64_t qwGreedyTwoFrameThreshold; #endif -#include <mangle.h> - #if defined(IS_SSE) static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride, deinterlace_frame_data_t *data, diff --git a/src/post/deinterlace/plugins/greedyh.asm b/src/post/deinterlace/plugins/greedyh.asm index 11b28ca76..c96bfbf2c 100644 --- a/src/post/deinterlace/plugins/greedyh.asm +++ b/src/post/deinterlace/plugins/greedyh.asm @@ -17,7 +17,6 @@ ///////////////////////////////////////////////////////////////////////////// #include "x86-64_macros.inc" -#include <mangle.h> #if !defined(MASKS_DEFINED) #define MASKS_DEFINED diff --git a/src/post/deinterlace/plugins/kdetv_greedyh.c b/src/post/deinterlace/plugins/kdetv_greedyh.c index 5ec48e4a2..2207772ca 100644 --- a/src/post/deinterlace/plugins/kdetv_greedyh.c +++ b/src/post/deinterlace/plugins/kdetv_greedyh.c @@ -31,8 +31,8 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/kdetv_tomsmocomp.c b/src/post/deinterlace/plugins/kdetv_tomsmocomp.c index ae0fa0363..0f87b913f 100644 --- a/src/post/deinterlace/plugins/kdetv_tomsmocomp.c +++ b/src/post/deinterlace/plugins/kdetv_tomsmocomp.c @@ -31,8 +31,8 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> #include "deinterlace.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/plugins/linearblend.c b/src/post/deinterlace/plugins/linearblend.c index c594f41dd..fe230685b 100644 --- a/src/post/deinterlace/plugins/linearblend.c +++ b/src/post/deinterlace/plugins/linearblend.c @@ -31,8 +31,9 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> +#include "xine_mmx.h" #include "speedtools.h" #include "speedy.h" #include "deinterlace.h" diff --git a/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc b/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc index a3b139691..d3ee46a20 100644 --- a/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc +++ b/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc @@ -21,8 +21,6 @@ // See www.eff.org for details ///////////////////////////////////////////////////////////////////////////// -#include <mangle.h> - #if !defined(MASKS_DEFINED) #define MASKS_DEFINED static const int64_t __attribute__((__used__)) Max_Mov = 0x0404040404040404ull; diff --git a/src/post/deinterlace/plugins/vfir.c b/src/post/deinterlace/plugins/vfir.c index e66d7c789..89ea1d0e5 100644 --- a/src/post/deinterlace/plugins/vfir.c +++ b/src/post/deinterlace/plugins/vfir.c @@ -34,8 +34,9 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> +#include "xine_mmx.h" #include "speedy.h" #include "deinterlace.h" #include "plugins.h" diff --git a/src/post/deinterlace/speedy.c b/src/post/deinterlace/speedy.c index 32c8b03e3..6af2c3b88 100644 --- a/src/post/deinterlace/speedy.c +++ b/src/post/deinterlace/speedy.c @@ -62,8 +62,9 @@ #include <stdint.h> #endif -#include "attributes.h" -#include "xineutils.h" +#include <xine/attributes.h> +#include <xine/xineutils.h> +#include "xine_mmx.h" #include "speedtools.h" #include "speedy.h" diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c index c9d451b4f..3cce42400 100644 --- a/src/post/deinterlace/xine_plugin.c +++ b/src/post/deinterlace/xine_plugin.c @@ -31,10 +31,10 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" -#include "xine_buffer.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> +#include <xine/xine_buffer.h> #include <pthread.h> #include "tvtime.h" @@ -51,7 +51,7 @@ static const post_info_t deinterlace_special_info = { XINE_POST_TYPE_VIDEO_FILTE const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 9, "tvtime", XINE_VERSION_CODE, &deinterlace_special_info, &deinterlace_init_plugin }, + { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 10, "tvtime", XINE_VERSION_CODE, &deinterlace_special_info, &deinterlace_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -60,8 +60,8 @@ typedef struct post_plugin_deinterlace_s post_plugin_deinterlace_t; #define MAX_NUM_METHODS 30 static const char *enum_methods[MAX_NUM_METHODS]; -static char *enum_pulldown[] = { "none", "vektor", NULL }; -static char *enum_framerate[] = { "full", "half_top", "half_bottom", NULL }; +static const char *const enum_pulldown[] = { "none", "vektor", NULL }; +static const char *const enum_framerate[] = { "full", "half_top", "half_bottom", NULL }; static void *help_string; @@ -280,8 +280,6 @@ static xine_post_api_t post_api = { static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *deinterlace_get_identifier(post_class_t *class_gen); -static char *deinterlace_get_description(post_class_t *class_gen); static void deinterlace_class_dispose(post_class_t *class_gen); /* plugin instance functions */ @@ -311,8 +309,8 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data) return NULL; class->class.open_plugin = deinterlace_open_plugin; - class->class.get_identifier = deinterlace_get_identifier; - class->class.get_description = deinterlace_get_description; + class->class.identifier = "tvtime"; + class->class.description = N_("advanced deinterlacer plugin with pulldown detection"); class->class.dispose = deinterlace_class_dispose; @@ -425,16 +423,6 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input return &this->post; } -static char *deinterlace_get_identifier(post_class_t *class_gen) -{ - return "tvtime"; -} - -static char *deinterlace_get_description(post_class_t *class_gen) -{ - return "advanced deinterlacer plugin with pulldown detection"; -} - static void deinterlace_class_dispose(post_class_t *class_gen) { xine_buffer_free(help_string); diff --git a/src/post/goom/Makefile.am b/src/post/goom/Makefile.am index 386c0b351..8453213e3 100644 --- a/src/post/goom/Makefile.am +++ b/src/post/goom/Makefile.am @@ -1,37 +1,17 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common -EXTRA_DIST = mmx.c xmmx.c ppc_drawings.s ppc_zoom_ultimate.s diff_against_release.patch \ - gfontrle.c mathtools.c - -## -fomit-frame-pointer segfaults here -## Use -O2 if -Os is stripped or x86 does not build -#CFLAGS = `echo @CFLAGS@ | sed -e 's/-fomit-frame-pointer//g;s/-Os/-O2/g'` -CFLAGS = `echo @CFLAGS@ | sed -e 's/-Os/-O2/g'` - -# Avoid errors with -O0 -xineplug_post_goom_la-xmmx.o xineplug_post_goom_la-xmmx.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'` - -xinepost_LTLIBRARIES = xineplug_post_goom.la +AM_CFLAGS = $(VISIBILITY_FLAG) ## doesn't work -#if PPC_ARCH +#if ARCH_PPC #extra_files = ppc_drawings.s ppc_zoom_ultimate.s #AM_CPPFLAGS = -DCPU_POWERPC #endif -if HAVE_MMX -extra_files = mmx.c xmmx.c -endif - -xineplug_post_goom_la_SOURCES = $(extra_files) xine_goom.c \ - config_param.c convolve_fx.c cpu_info.c drawmethods.c filters.c flying_stars_fx.c \ - gfontlib.c goom_core.c goom_tools.c goomsl.c goomsl_hash.c goomsl_heap.c \ - goomsl_lex.c goomsl_yacc.c graphic.c ifs.c lines.c \ - plugin_info.c sound_tester.c surf3d.c tentacle3d.c v3d.c -xineplug_post_goom_la_LIBADD = $(XINE_LIB) $(GOOM_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) -lm -xineplug_post_goom_la_CFLAGS = $(VISIBILITY_FLAG) -xineplug_post_goom_la_LDFLAGS = $(xineplug_ldflags) +EXTRA_DIST = mmx.c xmmx.c ppc_drawings.s ppc_zoom_ultimate.s diff_against_release.patch \ + gfontrle.c mathtools.c noinst_HEADERS = cpu_info.h default_scripts.h drawmethods.h gfontlib.h goom.h \ goom_config.h goom_config_param.h goom_filters.h goom_fx.h goom_graphic.h \ @@ -39,3 +19,21 @@ noinst_HEADERS = cpu_info.h default_scripts.h drawmethods.h gfontlib.h goom.h \ goomsl_heap.h goomsl_private.h goomsl_yacc.h ifs.h lines.h mathtools.h mmx.h \ ppc_drawings.h ppc_zoom_ultimate.h sound_tester.h surf3d.h tentacle3d.h v3d.h \ motif_goom1.h motif_goom2.h + +noinst_LTLIBRARIES = libpost_goom_asm.la +libpost_goom_asm_la_SOURCES = xmmx.c +if DEBUG_BUILD +libpost_goom_asm_la_CFLAGS = $(O1_CFLAGS) $(AM_CFLAGS) +else +libpost_goom_asm_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS) +endif + +xinepost_LTLIBRARIES = xineplug_post_goom.la +xineplug_post_goom_la_SOURCES = mmx.c xine_goom.c \ + config_param.c convolve_fx.c cpu_info.c drawmethods.c filters.c flying_stars_fx.c \ + gfontlib.c goom_core.c goom_tools.c goomsl.c goomsl_hash.c goomsl_heap.c \ + goomsl_lex.c goomsl_yacc.c graphic.c ifs.c lines.c \ + plugin_info.c sound_tester.c surf3d.c tentacle3d.c v3d.c +xineplug_post_goom_la_LIBADD = $(XINE_LIB) $(GOOM_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(noinst_LTLIBRARIES) +xineplug_post_goom_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS) +xineplug_post_goom_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags) diff --git a/src/post/goom/gfontlib.c b/src/post/goom/gfontlib.c index f538aad34..f538aad34 100644..100755 --- a/src/post/goom/gfontlib.c +++ b/src/post/goom/gfontlib.c diff --git a/src/post/goom/gfontlib.h b/src/post/goom/gfontlib.h index 0520b7da9..0520b7da9 100644..100755 --- a/src/post/goom/gfontlib.h +++ b/src/post/goom/gfontlib.h diff --git a/src/post/goom/gfontrle.c b/src/post/goom/gfontrle.c index a22545a1e..a22545a1e 100644..100755 --- a/src/post/goom/gfontrle.c +++ b/src/post/goom/gfontrle.c diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c index 62d9a27b6..7d40c0f86 100644 --- a/src/post/goom/goom_core.c +++ b/src/post/goom/goom_core.c @@ -26,7 +26,7 @@ #include "goom_fx.h" #include "goomsl.h" -#include "xine_internal.h" +#include <xine/xine_internal.h> /* #define VERBOSE */ diff --git a/src/post/goom/mathtools.h b/src/post/goom/mathtools.h index 165fc66b0..165fc66b0 100644..100755 --- a/src/post/goom/mathtools.h +++ b/src/post/goom/mathtools.h diff --git a/src/post/goom/mmx.h b/src/post/goom/mmx.h index b650d8b12..6861b7cfe 100644 --- a/src/post/goom/mmx.h +++ b/src/post/goom/mmx.h @@ -31,6 +31,8 @@ # include "config.h" #endif +#include <xine/attributes.h> + #include "goom_graphic.h" /* Warning: at this writing, the version of GAS packaged @@ -58,7 +60,7 @@ typedef union { char b[8]; /* 8 Byte (8-bit) values */ unsigned char ub[8]; /* 8 Unsigned Byte */ float s[2]; /* Single-precision (32-bit) value */ -} __attribute__ ((aligned (8))) mmx_t; /* On an 8-byte (64-bit) boundary */ +} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */ diff --git a/src/post/goom/surf3d.c b/src/post/goom/surf3d.c index ba8c69094..ba8c69094 100644..100755 --- a/src/post/goom/surf3d.c +++ b/src/post/goom/surf3d.c diff --git a/src/post/goom/surf3d.h b/src/post/goom/surf3d.h index 482b6a090..482b6a090 100644..100755 --- a/src/post/goom/surf3d.h +++ b/src/post/goom/surf3d.h diff --git a/src/post/goom/tentacle3d.c b/src/post/goom/tentacle3d.c index e1e2157e7..e1e2157e7 100644..100755 --- a/src/post/goom/tentacle3d.c +++ b/src/post/goom/tentacle3d.c diff --git a/src/post/goom/tentacle3d.h b/src/post/goom/tentacle3d.h index ad0858fad..ad0858fad 100644..100755 --- a/src/post/goom/tentacle3d.h +++ b/src/post/goom/tentacle3d.h diff --git a/src/post/goom/v3d.h b/src/post/goom/v3d.h index 7690847f2..7690847f2 100644..100755 --- a/src/post/goom/v3d.h +++ b/src/post/goom/v3d.h diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c index 72692ffe1..7cf1a9325 100644 --- a/src/post/goom/xine_goom.c +++ b/src/post/goom/xine_goom.c @@ -35,9 +35,9 @@ */ #include "config.h" -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "goom.h" @@ -116,7 +116,7 @@ static const post_info_t goom_special_info = { const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 9, "goom", XINE_VERSION_CODE, &goom_special_info, &goom_init_plugin }, + { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 10, "goom", XINE_VERSION_CODE, &goom_special_info, &goom_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -125,8 +125,6 @@ const plugin_info_t xine_plugin_info[] EXPORTED = { static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *goom_get_identifier(post_class_t *class_gen); -static char *goom_get_description(post_class_t *class_gen); static void goom_class_dispose(post_class_t *class_gen); /* plugin instance functions */ @@ -194,8 +192,8 @@ static void *goom_init_plugin(xine_t *xine, void *data) return NULL; this->class.open_plugin = goom_open_plugin; - this->class.get_identifier = goom_get_identifier; - this->class.get_description = goom_get_description; + this->class.identifier = "goom"; + this->class.description = N_("What a GOOM"); this->class.dispose = goom_class_dispose; this->ip = NULL; this->xine = xine; @@ -307,16 +305,6 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *goom_get_identifier(post_class_t *class_gen) -{ - return "goom"; -} - -static char *goom_get_description(post_class_t *class_gen) -{ - return "What a GOOM"; -} - static void goom_class_dispose(post_class_t *class_gen) { post_class_goom_t *this = (post_class_goom_t*) class_gen; diff --git a/src/post/mosaico/Makefile.am b/src/post/mosaico/Makefile.am index 83f2b8f2a..cbe5faa9c 100644 --- a/src/post/mosaico/Makefile.am +++ b/src/post/mosaico/Makefile.am @@ -1,14 +1,14 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) +AM_LDFLAGS = $(xineplug_ldflags) + xinepost_LTLIBRARIES = xineplug_post_mosaico.la xineplug_post_switch.la xineplug_post_mosaico_la_SOURCES = mosaico.c xineplug_post_mosaico_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -xineplug_post_mosaico_la_CFLAGS = $(VISIBILITY_FLAG) -xineplug_post_mosaico_la_LDFLAGS = $(xineplug_ldflags) xineplug_post_switch_la_SOURCES = switch.c xineplug_post_switch_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -xineplug_post_switch_la_CFLAGS = $(VISIBILITY_FLAG) -xineplug_post_switch_la_LDFLAGS = $(xineplug_ldflags) diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c index 9a9a9911c..79272e8db 100644 --- a/src/post/mosaico/mosaico.c +++ b/src/post/mosaico/mosaico.c @@ -32,8 +32,8 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/post.h> /* FIXME: This plugin needs to handle overlays as well. */ @@ -45,7 +45,7 @@ static const post_info_t mosaico_special_info = { XINE_POST_TYPE_VIDEO_COMPOSE } const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 9, "mosaico", XINE_VERSION_CODE, &mosaico_special_info, &mosaico_init_plugin }, + { PLUGIN_POST, 10, "mosaico", XINE_VERSION_CODE, &mosaico_special_info, &mosaico_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -100,9 +100,6 @@ struct post_mosaico_s { static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *mosaico_get_identifier(post_class_t *class_gen); -static char *mosaico_get_description(post_class_t *class_gen); -static void mosaico_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void mosaico_dispose(post_plugin_t *this_gen); @@ -132,9 +129,9 @@ static void *mosaico_init_plugin(xine_t *xine, void *data) return NULL; this->class.open_plugin = mosaico_open_plugin; - this->class.get_identifier = mosaico_get_identifier; - this->class.get_description = mosaico_get_description; - this->class.dispose = mosaico_class_dispose; + this->class.identifier = "mosaico"; + this->class.description = N_("Mosaico is a picture in picture (pip) post plugin"); + this->class.dispose = default_post_class_dispose; this->xine = xine; return &this->class; @@ -205,22 +202,6 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *mosaico_get_identifier(post_class_t *class_gen) -{ - return "mosaico"; -} - -static char *mosaico_get_description(post_class_t *class_gen) -{ - return "Mosaico is a picture in picture (pip) post plugin"; -} - -static void mosaico_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void mosaico_dispose(post_plugin_t *this_gen) { post_mosaico_t *this = (post_mosaico_t *)this_gen; diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c index 7cba7c998..1bc9058ae 100644 --- a/src/post/mosaico/switch.c +++ b/src/post/mosaico/switch.c @@ -28,8 +28,8 @@ #define LOG */ -#include "xine_internal.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/post.h> /* FIXME: This plugin needs to handle overlays as well. */ @@ -41,7 +41,7 @@ static const post_info_t switch_special_info = { XINE_POST_TYPE_VIDEO_COMPOSE }; const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 9, "switch", XINE_VERSION_CODE, &switch_special_info, &switch_init_plugin }, + { PLUGIN_POST, 10, "switch", XINE_VERSION_CODE, &switch_special_info, &switch_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -82,9 +82,6 @@ struct post_switch_s { static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *switch_get_identifier(post_class_t *class_gen); -static char *switch_get_description(post_class_t *class_gen); -static void switch_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void switch_dispose(post_plugin_t *this_gen); @@ -107,9 +104,9 @@ static void *switch_init_plugin(xine_t *xine, void *data) return NULL; this->class.open_plugin = switch_open_plugin; - this->class.get_identifier = switch_get_identifier; - this->class.get_description = switch_get_description; - this->class.dispose = switch_class_dispose; + this->class.identifier = "switch"; + this->class.description = N_("Switch is a post plugin able to switch at any time between different streams"); + this->class.dispose = default_post_class_dispose; this->xine = xine; return &this->class; @@ -168,22 +165,6 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *switch_get_identifier(post_class_t *class_gen) -{ - return "switch"; -} - -static char *switch_get_description(post_class_t *class_gen) -{ - return "Switch is a post plugin able to switch at any time between different streams"; -} - -static void switch_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void switch_dispose(post_plugin_t *this_gen) { post_switch_t *this = (post_switch_t *)this_gen; diff --git a/src/post/planar/Makefile.am b/src/post/planar/Makefile.am index 319152cba..d5d122ce3 100644 --- a/src/post/planar/Makefile.am +++ b/src/post/planar/Makefile.am @@ -1,35 +1,20 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common -POSTPROC_INT_LIB = $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la +AM_CFLAGS = $(VISIBILITY_FLAG) +AM_CPPFLAGS = +AM_LDFLAGS = -if HAVE_FFMPEG -postproc_lib = $(FFMPEG_POSTPROC_LIBS) -ff_cflags = $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS) -else -ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec -postproc_lib = $(POSTPROC_INT_LIB) -postproc_dep = $(postproc_lib) -endif - -# -fomit-frame-pointer is always needed. it might cause debug to not -# work, but at least it compiles. -AM_CFLAGS = $(ff_cflags) -fomit-frame-pointer - -# Avoid errors with -O0 -xineplug_post_planar_la-eq.o xineplug_post_planar_la-eq.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'` -xineplug_post_planar_la-eq2.o xineplug_post_planar_la-eq2.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'` -xineplug_post_planar_la-noise.o xineplug_post_planar_la-noise.lo: CFLAGS=`echo @CFLAGS@ | sed -e 's/-O0\?\s/-Os /g'` +noinst_LTLIBRARIES = libpost_planar_asm.la +libpost_planar_asm_la_SOURCES = eq.c eq2.c noise.c +libpost_planar_asm_la_CFLAGS = $(O1_CFLAGS) -fomit-frame-pointer $(AM_CFLAGS) $(AVUTIL_CFLAGS) +libpost_planar_asm_la_LIBADD = $(AVUTIL_LIBS) xinepost_LTLIBRARIES = xineplug_post_planar.la - xineplug_post_planar_la_SOURCES = planar.c invert.c expand.c fill.c boxblur.c \ - denoise3d.c eq.c eq2.c unsharp.c pp.c noise.c -xineplug_post_planar_la_DEPENDENCIES = $(postproc_dep) -xineplug_post_planar_la_LIBADD = $(XINE_LIB) $(postproc_lib) -lm $(PTHREAD_LIBS) $(LTLIBINTL) -xineplug_post_planar_la_LDFLAGS = $(xineplug_ldflags) \ - @IMPURE_TEXT_LDFLAGS@ -xineplug_post_planar_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) - -$(POSTPROC_INT_LIB): - cd $(top_builddir)/src/libffmpeg/libavcodec/libpostproc && $(MAKE) libpostprocess.la + denoise3d.c unsharp.c pp.c +xineplug_post_planar_la_LIBADD = $(XINE_LIB) $(FFMPEG_POSTPROC_LIBS) -lm $(PTHREAD_LIBS) $(LTLIBINTL) $(noinst_LTLIBRARIES) +xineplug_post_planar_la_DEPS = $(FFMPEG_POSTPROC_DEPS) +xineplug_post_planar_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS) $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS) +xineplug_post_planar_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS) diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c index ceeba3b40..ea3085ffd 100644 --- a/src/post/planar/boxblur.c +++ b/src/post/planar/boxblur.c @@ -25,9 +25,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #include <pthread.h> /* plugin class initialization function */ @@ -124,9 +124,6 @@ static xine_post_api_t post_api = { static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *boxblur_get_identifier(post_class_t *class_gen); -static char *boxblur_get_description(post_class_t *class_gen); -static void boxblur_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void boxblur_dispose(post_plugin_t *this_gen); @@ -140,15 +137,15 @@ static int boxblur_draw(vo_frame_t *frame, xine_stream_t *stream); void *boxblur_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = boxblur_open_plugin; - class->get_identifier = boxblur_get_identifier; - class->get_description = boxblur_get_description; - class->dispose = boxblur_class_dispose; + class->identifier = "boxblur"; + class->description = N_("box blur filter from mplayer"); + class->dispose = default_post_class_dispose; return class; } @@ -198,22 +195,6 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *boxblur_get_identifier(post_class_t *class_gen) -{ - return "boxblur"; -} - -static char *boxblur_get_description(post_class_t *class_gen) -{ - return "box blur filter from mplayer"; -} - -static void boxblur_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void boxblur_dispose(post_plugin_t *this_gen) { post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)this_gen; diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c index 2073151b4..793a377c7 100644 --- a/src/post/planar/denoise3d.c +++ b/src/post/planar/denoise3d.c @@ -25,9 +25,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #include <math.h> #include <pthread.h> @@ -161,9 +161,6 @@ static xine_post_api_t post_api = { static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *denoise3d_get_identifier(post_class_t *class_gen); -static char *denoise3d_get_description(post_class_t *class_gen); -static void denoise3d_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void denoise3d_dispose(post_plugin_t *this_gen); @@ -180,15 +177,15 @@ static int denoise3d_draw(vo_frame_t *frame, xine_stream_t *stream); void *denoise3d_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = denoise3d_open_plugin; - class->get_identifier = denoise3d_get_identifier; - class->get_description = denoise3d_get_description; - class->dispose = denoise3d_class_dispose; + class->identifier = "denoise3d"; + class->description = N_("3D Denoiser (variable lowpass filter)"); + class->dispose = default_post_class_dispose; return class; } @@ -241,22 +238,6 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *denoise3d_get_identifier(post_class_t *class_gen) -{ - return "denoise3d"; -} - -static char *denoise3d_get_description(post_class_t *class_gen) -{ - return "3D Denoiser (variable lowpass filter)"; -} - -static void denoise3d_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void denoise3d_dispose(post_plugin_t *this_gen) { post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)this_gen; diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c index 73607b8a1..dcf9b47fb 100644 --- a/src/post/planar/eq.c +++ b/src/post/planar/eq.c @@ -25,9 +25,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #include <pthread.h> @@ -212,9 +212,6 @@ static xine_post_api_t post_api = { static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *eq_get_identifier(post_class_t *class_gen); -static char *eq_get_description(post_class_t *class_gen); -static void eq_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void eq_dispose(post_plugin_t *this_gen); @@ -232,15 +229,15 @@ static int eq_draw(vo_frame_t *frame, xine_stream_t *stream); void *eq_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = eq_open_plugin; - class->get_identifier = eq_get_identifier; - class->get_description = eq_get_description; - class->dispose = eq_class_dispose; + class->identifier = "eq"; + class->description = N_("soft video equalizer"); + class->dispose = default_post_class_dispose; return class; } @@ -296,22 +293,6 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *eq_get_identifier(post_class_t *class_gen) -{ - return "eq"; -} - -static char *eq_get_description(post_class_t *class_gen) -{ - return "soft video equalizer"; -} - -static void eq_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void eq_dispose(post_plugin_t *this_gen) { post_plugin_eq_t *this = (post_plugin_eq_t *)this_gen; diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c index 542ea7bad..a3e1acac1 100644 --- a/src/post/planar/eq2.c +++ b/src/post/planar/eq2.c @@ -29,9 +29,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #include <math.h> #include <pthread.h> @@ -393,9 +393,6 @@ static xine_post_api_t post_api = { static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *eq2_get_identifier(post_class_t *class_gen); -static char *eq2_get_description(post_class_t *class_gen); -static void eq2_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void eq2_dispose(post_plugin_t *this_gen); @@ -413,15 +410,15 @@ static int eq2_draw(vo_frame_t *frame, xine_stream_t *stream); void *eq2_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = eq2_open_plugin; - class->get_identifier = eq2_get_identifier; - class->get_description = eq2_get_description; - class->dispose = eq2_class_dispose; + class->identifier = "eq2"; + class->description = N_("Software video equalizer"); + class->dispose = default_post_class_dispose; return class; } @@ -480,22 +477,6 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *eq2_get_identifier(post_class_t *class_gen) -{ - return "eq2"; -} - -static char *eq2_get_description(post_class_t *class_gen) -{ - return "Software video equalizer"; -} - -static void eq2_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void eq2_dispose(post_plugin_t *this_gen) { post_plugin_eq2_t *this = (post_plugin_eq2_t *)this_gen; diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c index cc189118f..513def84f 100644 --- a/src/post/planar/expand.c +++ b/src/post/planar/expand.c @@ -27,8 +27,8 @@ * */ -#include "xine_internal.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/post.h> /* The expand trick explained: * @@ -100,9 +100,6 @@ typedef struct post_expand_s { static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *expand_get_identifier(post_class_t *class_gen); -static char *expand_get_description(post_class_t *class_gen); -static void expand_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void expand_dispose(post_plugin_t *this_gen); @@ -130,15 +127,15 @@ static int32_t expand_overlay_add_event(video_overlay_manager_t *this_gen void *expand_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = expand_open_plugin; - class->get_identifier = expand_get_identifier; - class->get_description = expand_get_description; - class->dispose = expand_class_dispose; + class->identifier = "expand"; + class->description = N_("add black borders to top and bottom of video to expand it to 4:3 aspect ratio"); + class->dispose = default_post_class_dispose; return class; } @@ -191,22 +188,6 @@ static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *expand_get_identifier(post_class_t *class_gen) -{ - return "expand"; -} - -static char *expand_get_description(post_class_t *class_gen) -{ - return "add black borders to top and bottom of video to expand it to 4:3 aspect ratio"; -} - -static void expand_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void expand_dispose(post_plugin_t *this_gen) { post_expand_t *this = (post_expand_t *)this_gen; diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c index dd8b83c82..c79033a72 100644 --- a/src/post/planar/fill.c +++ b/src/post/planar/fill.c @@ -22,8 +22,8 @@ * based on invert.c */ -#include "xine_internal.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/post.h> /* plugin class initialization function */ void *fill_init_plugin(xine_t *xine, void *); @@ -32,9 +32,6 @@ void *fill_init_plugin(xine_t *xine, void *); static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *fill_get_identifier(post_class_t *class_gen); -static char *fill_get_description(post_class_t *class_gen); -static void fill_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void fill_dispose(post_plugin_t *this_gen); @@ -48,15 +45,15 @@ static int fill_draw(vo_frame_t *frame, xine_stream_t *stream); void *fill_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = fill_open_plugin; - class->get_identifier = fill_get_identifier; - class->get_description = fill_get_description; - class->dispose = fill_class_dispose; + class->identifier = "fill"; + class->description = N_("crops left and right of video to fill 4:3 aspect ratio"); + class->dispose = default_post_class_dispose; return class; } @@ -92,21 +89,6 @@ static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs, return this; } -static char *fill_get_identifier(post_class_t *class_gen) -{ - return "fill"; -} - -static char *fill_get_description(post_class_t *class_gen) -{ - return "crops left and right of video to fill 4:3 aspect ratio"; -} - -static void fill_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - static void fill_dispose(post_plugin_t *this) { if (_x_post_dispose(this)) diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c index 820221cf5..462b8fa7b 100644 --- a/src/post/planar/invert.c +++ b/src/post/planar/invert.c @@ -22,8 +22,8 @@ * simple video inverter plugin */ -#include "xine_internal.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/post.h> /* plugin class initialization function */ @@ -33,9 +33,6 @@ void *invert_init_plugin(xine_t *xine, void *); static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *invert_get_identifier(post_class_t *class_gen); -static char *invert_get_description(post_class_t *class_gen); -static void invert_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void invert_dispose(post_plugin_t *this_gen); @@ -49,15 +46,15 @@ static int invert_draw(vo_frame_t *frame, xine_stream_t *stream); void *invert_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = invert_open_plugin; - class->get_identifier = invert_get_identifier; - class->get_description = invert_get_description; - class->dispose = invert_class_dispose; + class->identifier = "invert"; + class->description = N_("inverts the colours of every video frame"); + class->dispose = default_post_class_dispose; return class; } @@ -91,22 +88,6 @@ static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs, return this; } -static char *invert_get_identifier(post_class_t *class_gen) -{ - return "invert"; -} - -static char *invert_get_description(post_class_t *class_gen) -{ - return "inverts the colours of every video frame"; -} - -static void invert_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void invert_dispose(post_plugin_t *this) { if (_x_post_dispose(this)) diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c index 41a3a9aeb..471670fb9 100644 --- a/src/post/planar/noise.c +++ b/src/post/planar/noise.c @@ -25,12 +25,17 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #include <math.h> #include <pthread.h> +#ifdef HAVE_FFMPEG_AVUTIL_H +# include <mem.h> +#else +# include <libavutil/mem.h> +#endif #ifdef ARCH_X86_64 # define REG_a "rax" @@ -61,7 +66,6 @@ typedef struct noise_param_t { shiftptr; int8_t *noise, *prev_shift[MAX_RES][3]; - void *base; } noise_param_t; static int nonTempRandShift[MAX_RES]= {-1}; @@ -78,9 +82,8 @@ static int8_t *initNoise(noise_param_t *fp){ int pattern= fp->pattern; int8_t *noise; int i, j; - void *base; - noise = xine_xmalloc_aligned(16, MAX_NOISE*sizeof(int8_t), &base); + noise = av_mallocz(MAX_NOISE*sizeof(int8_t)); srand(123457); for(i=0,j=0; i<MAX_NOISE; i++,j++) @@ -136,7 +139,6 @@ static int8_t *initNoise(noise_param_t *fp){ } fp->noise= noise; - fp->base = base; fp->shiftptr= 0; return noise; } @@ -324,8 +326,8 @@ typedef struct noise_parameters_s { type, quality, pattern; } noise_parameters_t; -static char *enum_types[] = {"uniform", "gaussian", NULL}; -static char *enum_quality[] = {"fixed", "temporal", "averaged temporal", NULL}; +static const char *const enum_types[] = {"uniform", "gaussian", NULL}; +static const char *const enum_quality[] = {"fixed", "temporal", "averaged temporal", NULL}; /* * description of params struct @@ -435,9 +437,6 @@ static xine_post_api_t post_api = { static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *noise_get_identifier(post_class_t *class_gen); -static char *noise_get_description(post_class_t *class_gen); -static void noise_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void noise_dispose(post_plugin_t *this_gen); @@ -451,15 +450,15 @@ static int noise_draw(vo_frame_t *frame, xine_stream_t *stream); void *noise_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = noise_open_plugin; - class->get_identifier = noise_get_identifier; - class->get_description = noise_get_description; - class->dispose = noise_class_dispose; + class->identifier = "noise"; + class->description = N_("Adds noise"); + class->dispose = default_post_class_dispose; #ifdef ARCH_X86 if (xine_mm_accel() & MM_ACCEL_X86_MMX) { @@ -521,28 +520,14 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *noise_get_identifier(post_class_t *class_gen) -{ - return "noise"; -} - -static char *noise_get_description(post_class_t *class_gen) -{ - return "Adds noise"; -} - -static void noise_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void noise_dispose(post_plugin_t *this_gen) { post_plugin_noise_t *this = (post_plugin_noise_t *)this_gen; if (_x_post_dispose(this_gen)) { pthread_mutex_destroy(&this->lock); + av_free(this->params[0].noise); + av_free(this->params[1].noise); free(this); } } diff --git a/src/post/planar/planar.c b/src/post/planar/planar.c index 112ebdf0d..e2bd65846 100644 --- a/src/post/planar/planar.c +++ b/src/post/planar/planar.c @@ -24,9 +24,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> extern void *invert_init_plugin(xine_t *xine, void *); static const post_info_t invert_special_info = { XINE_POST_TYPE_VIDEO_FILTER }; @@ -60,15 +60,15 @@ static const post_info_t noise_special_info = { XINE_POST_TYPE_VIDEO_FILTER }; const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 9, "expand", XINE_VERSION_CODE, &expand_special_info, &expand_init_plugin }, - { PLUGIN_POST, 9, "fill", XINE_VERSION_CODE, &fill_special_info, &fill_init_plugin }, - { PLUGIN_POST, 9, "invert", XINE_VERSION_CODE, &invert_special_info, &invert_init_plugin }, - { PLUGIN_POST, 9, "eq", XINE_VERSION_CODE, &eq_special_info, &eq_init_plugin }, - { PLUGIN_POST, 9, "denoise3d", XINE_VERSION_CODE, &denoise3d_special_info, &denoise3d_init_plugin }, - { PLUGIN_POST, 9, "boxblur", XINE_VERSION_CODE, &boxblur_special_info, &boxblur_init_plugin }, - { PLUGIN_POST, 9, "eq2", XINE_VERSION_CODE, &eq2_special_info, &eq2_init_plugin }, - { PLUGIN_POST, 9, "unsharp", XINE_VERSION_CODE, &unsharp_special_info, &unsharp_init_plugin }, - { PLUGIN_POST, 9, "pp", XINE_VERSION_CODE, &pp_special_info, &pp_init_plugin }, - { PLUGIN_POST, 9, "noise", XINE_VERSION_CODE, &noise_special_info, &noise_init_plugin }, + { PLUGIN_POST, 10, "expand", XINE_VERSION_CODE, &expand_special_info, &expand_init_plugin }, + { PLUGIN_POST, 10, "fill", XINE_VERSION_CODE, &fill_special_info, &fill_init_plugin }, + { PLUGIN_POST, 10, "invert", XINE_VERSION_CODE, &invert_special_info, &invert_init_plugin }, + { PLUGIN_POST, 10, "eq", XINE_VERSION_CODE, &eq_special_info, &eq_init_plugin }, + { PLUGIN_POST, 10, "denoise3d", XINE_VERSION_CODE, &denoise3d_special_info, &denoise3d_init_plugin }, + { PLUGIN_POST, 10, "boxblur", XINE_VERSION_CODE, &boxblur_special_info, &boxblur_init_plugin }, + { PLUGIN_POST, 10, "eq2", XINE_VERSION_CODE, &eq2_special_info, &eq2_init_plugin }, + { PLUGIN_POST, 10, "unsharp", XINE_VERSION_CODE, &unsharp_special_info, &unsharp_init_plugin }, + { PLUGIN_POST, 10, "pp", XINE_VERSION_CODE, &pp_special_info, &pp_init_plugin }, + { PLUGIN_POST, 10, "noise", XINE_VERSION_CODE, &noise_special_info, &noise_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c index 3753c2ce2..ab1fc3a9f 100644 --- a/src/post/planar/pp.c +++ b/src/post/planar/pp.c @@ -24,16 +24,17 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" -#include <pthread.h> +#include <config.h> +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #ifdef HAVE_FFMPEG_AVUTIL_H # include <postprocess.h> #else # include <libpostproc/postprocess.h> #endif +#include <pthread.h> #if LIBPOSTPROC_VERSION_MAJOR < 52 # define pp_context pp_context_t @@ -119,20 +120,19 @@ static xine_post_api_descr_t * get_param_descr (void) { } static char * get_help (void) { - char *help1 = - _("FFmpeg libpostprocess plugin.\n" - "\n" - "Parameters\n" - "\n"); - - char *help2 = - _("\n" - "* libpostprocess (C) Michael Niedermayer\n" - ); static char *help = NULL; - if( !help ) - help = _x_asprintf("%s%s%s", help1, help2, pp_help); + if( !help ) { + help = _x_asprintf("%s%s%s", + _("FFmpeg libpostprocess plugin.\n" + "\n" + "Parameters\n" + "\n"), + pp_help, + _("\n" + "* libpostprocess (C) Michael Niedermayer\n") + ); + } return help; } @@ -149,9 +149,6 @@ static xine_post_api_t post_api = { static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *pp_get_identifier(post_class_t *class_gen); -static char *pp_get_description(post_class_t *class_gen); -static void pp_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void pp_dispose(post_plugin_t *this_gen); @@ -165,15 +162,15 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *stream); void *pp_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = pp_open_plugin; - class->get_identifier = pp_get_identifier; - class->get_description = pp_get_description; - class->dispose = pp_class_dispose; + class->identifier = "pp"; + class->description = N_("plugin for ffmpeg libpostprocess"); + class->dispose = default_post_class_dispose; return class; } @@ -235,22 +232,6 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *pp_get_identifier(post_class_t *class_gen) -{ - return "pp"; -} - -static char *pp_get_description(post_class_t *class_gen) -{ - return "plugin for ffmpeg libpostprocess"; -} - -static void pp_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - - static void pp_dispose(post_plugin_t *this_gen) { post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen; diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c index dbf723577..ffa6a39df 100644 --- a/src/post/planar/unsharp.c +++ b/src/post/planar/unsharp.c @@ -25,9 +25,9 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" -#include "xineutils.h" +#include <xine/xine_internal.h> +#include <xine/post.h> +#include <xine/xineutils.h> #include <pthread.h> /*===========================================================================*/ @@ -250,9 +250,6 @@ static xine_post_api_t post_api = { static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target); -static char *unsharp_get_identifier(post_class_t *class_gen); -static char *unsharp_get_description(post_class_t *class_gen); -static void unsharp_class_dispose(post_class_t *class_gen); /* plugin instance functions */ static void unsharp_dispose(post_plugin_t *this_gen); @@ -266,15 +263,15 @@ static int unsharp_draw(vo_frame_t *frame, xine_stream_t *stream); void *unsharp_init_plugin(xine_t *xine, void *data) { - post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t)); + post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t)); if (!class) return NULL; class->open_plugin = unsharp_open_plugin; - class->get_identifier = unsharp_get_identifier; - class->get_description = unsharp_get_description; - class->dispose = unsharp_class_dispose; + class->identifier = "unsharp"; + class->description = N_("unsharp mask & gaussian blur"); + class->dispose = default_post_class_dispose; return class; } @@ -329,21 +326,6 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *unsharp_get_identifier(post_class_t *class_gen) -{ - return "unsharp"; -} - -static char *unsharp_get_description(post_class_t *class_gen) -{ - return "unsharp mask & gaussian blur"; -} - -static void unsharp_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - static void unsharp_free_SC(post_plugin_unsharp_t *this) { int i; diff --git a/src/post/visualizations/Makefile.am b/src/post/visualizations/Makefile.am index f3a759fae..0bf5c21d0 100644 --- a/src/post/visualizations/Makefile.am +++ b/src/post/visualizations/Makefile.am @@ -1,14 +1,16 @@ +include $(top_srcdir)/misc/Makefile.quiet include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common +AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG) +AM_LDFLAGS = $(xineplug_ldflags) + EXTRA_DIST = fooviz.c +noinst_HEADERS = fft.h visualizations.h + xinepost_LTLIBRARIES = xineplug_post_visualizations.la xineplug_post_visualizations_la_SOURCES = \ visualizations.c fft.c fftscope.c oscope.c fftgraph.c xineplug_post_visualizations_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) -lm -xineplug_post_visualizations_la_CFLAGS = $(VISIBILITY_FLAG) -xineplug_post_visualizations_la_LDFLAGS = $(xineplug_ldflags) - -noinst_HEADERS = fft.h visualizations.h diff --git a/src/post/visualizations/fft.c b/src/post/visualizations/fft.c index 7e32dbbf6..8e9364400 100644 --- a/src/post/visualizations/fft.c +++ b/src/post/visualizations/fft.c @@ -184,18 +184,6 @@ double fft_amp (int n, complex_t wave[], int bits) } /* - * Calculate phase of component n in the decimated wave[] array. - */ -double fft_phase (int n, complex_t wave[], int bits) -{ - n = PERMUTE (n, bits); - if (REAL(n) != 0.0) - return (atan (IMAG(n) / REAL(n))); - else - return (0.0); -} - -/* * Scale sampled values. * Do this *before* the fft. */ diff --git a/src/post/visualizations/fft.h b/src/post/visualizations/fft.h index 651c7f15d..358cec33c 100644 --- a/src/post/visualizations/fft.h +++ b/src/post/visualizations/fft.h @@ -44,7 +44,6 @@ void fft_compute (fft_t *fft, complex_t wave[]); void fft_window (fft_t *fft, complex_t wave[]); double fft_amp (int n, complex_t wave[], int bits); -double fft_phase (int n, complex_t wave[], int bits); void fft_scale (complex_t wave[], int bits); #endif /* FFT_H */ diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c index c3f8ff9f9..2d13c4084 100644 --- a/src/post/visualizations/fftgraph.c +++ b/src/post/visualizations/fftgraph.c @@ -30,9 +30,9 @@ #include <assert.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "bswap.h" #include "visualizations.h" #include "fft.h" @@ -456,33 +456,18 @@ static post_plugin_t *fftgraph_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *fftgraph_get_identifier(post_class_t *class_gen) -{ - return "fftgraph"; -} - -static char *fftgraph_get_description(post_class_t *class_gen) -{ - return "fftgraph Visualization Post Plugin"; -} - -static void fftgraph_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *fftgraph_init_plugin(xine_t *xine, void *data) { - post_class_fftgraph_t *class = (post_class_fftgraph_t *)malloc(sizeof(post_class_fftgraph_t)); + post_class_fftgraph_t *class = (post_class_fftgraph_t *)xine_xmalloc(sizeof(post_class_fftgraph_t)); if (!class) return NULL; class->post_class.open_plugin = fftgraph_open_plugin; - class->post_class.get_identifier = fftgraph_get_identifier; - class->post_class.get_description = fftgraph_get_description; - class->post_class.dispose = fftgraph_class_dispose; + class->post_class.identifier = "fftgraph"; + class->post_class.description = N_("fftgraph Visualization Post Plugin"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c index 286c4ac38..3ec72fba8 100644 --- a/src/post/visualizations/fftscope.c +++ b/src/post/visualizations/fftscope.c @@ -30,9 +30,9 @@ #include <stdio.h> #include <math.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "bswap.h" #include "visualizations.h" #include "fft.h" @@ -477,33 +477,18 @@ static post_plugin_t *fftscope_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *fftscope_get_identifier(post_class_t *class_gen) -{ - return "FFT Scope"; -} - -static char *fftscope_get_description(post_class_t *class_gen) -{ - return "FFT Scope"; -} - -static void fftscope_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *fftscope_init_plugin(xine_t *xine, void *data) { - post_class_fftscope_t *class = (post_class_fftscope_t *)malloc(sizeof(post_class_fftscope_t)); + post_class_fftscope_t *class = (post_class_fftscope_t *)xine_xmalloc(sizeof(post_class_fftscope_t)); if (!class) return NULL; class->post_class.open_plugin = fftscope_open_plugin; - class->post_class.get_identifier = fftscope_get_identifier; - class->post_class.get_description = fftscope_get_description; - class->post_class.dispose = fftscope_class_dispose; + class->post_class.identifier = "FFT Scope"; + class->post_class.description = N_("FFT Scope"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c index ac85da304..9c8a9c1fa 100644 --- a/src/post/visualizations/fooviz.c +++ b/src/post/visualizations/fooviz.c @@ -30,9 +30,9 @@ #include <stdio.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #define FPS 20 @@ -288,33 +288,18 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *fooviz_get_identifier(post_class_t *class_gen) -{ - return "fooviz"; -} - -static char *fooviz_get_description(post_class_t *class_gen) -{ - return "fooviz"; -} - -static void fooviz_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ static void *fooviz_init_plugin(xine_t *xine, void *data) { - post_class_fooviz_t *class = (post_class_fooviz_t *)malloc(sizeof(post_class_fooviz_t)); + post_class_fooviz_t *class = (post_class_fooviz_t *)xine_xmalloc(sizeof(post_class_fooviz_t)); if (!class) return NULL; class->post_class.open_plugin = fooviz_open_plugin; - class->post_class.get_identifier = fooviz_get_identifier; - class->post_class.get_description = fooviz_get_description; - class->post_class.dispose = fooviz_class_dispose; + class->post_class.identifier = "fooviz"; + class->post_class.description = N_("fooviz"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; @@ -326,6 +311,6 @@ static const post_info_t fooviz_special_info = { XINE_POST_TYPE_AUDIO_VISUALIZAT const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 9, "fooviz", XINE_VERSION_CODE, &fooviz_special_info, &fooviz_init_plugin }, + { PLUGIN_POST, 10, "fooviz", XINE_VERSION_CODE, &fooviz_special_info, &fooviz_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c index 28d1b4cbc..ffd6f0842 100644 --- a/src/post/visualizations/oscope.c +++ b/src/post/visualizations/oscope.c @@ -27,9 +27,9 @@ #include <stdio.h> -#include "xine_internal.h" -#include "xineutils.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/xineutils.h> +#include <xine/post.h> #include "visualizations.h" #define FPS 20 @@ -359,33 +359,18 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs, return &this->post; } -static char *oscope_get_identifier(post_class_t *class_gen) -{ - return "Oscilloscope"; -} - -static char *oscope_get_description(post_class_t *class_gen) -{ - return "Oscilloscope"; -} - -static void oscope_class_dispose(post_class_t *class_gen) -{ - free(class_gen); -} - /* plugin class initialization function */ void *oscope_init_plugin(xine_t *xine, void *data) { - post_class_oscope_t *class = (post_class_oscope_t *)malloc(sizeof(post_class_oscope_t)); + post_class_oscope_t *class = (post_class_oscope_t *)xine_xmalloc(sizeof(post_class_oscope_t)); if (!class) return NULL; class->post_class.open_plugin = oscope_open_plugin; - class->post_class.get_identifier = oscope_get_identifier; - class->post_class.get_description = oscope_get_description; - class->post_class.dispose = oscope_class_dispose; + class->post_class.identifier = "Oscilloscope"; + class->post_class.description = N_("Oscilloscope"); + class->post_class.dispose = default_post_class_dispose; class->xine = xine; diff --git a/src/post/visualizations/visualizations.c b/src/post/visualizations/visualizations.c index a26f0bd5b..17c8491d5 100644 --- a/src/post/visualizations/visualizations.c +++ b/src/post/visualizations/visualizations.c @@ -24,8 +24,8 @@ #include "config.h" #endif -#include "xine_internal.h" -#include "post.h" +#include <xine/xine_internal.h> +#include <xine/post.h> #include "visualizations.h" @@ -46,8 +46,8 @@ static const post_info_t fftgraph_special_info = { XINE_POST_TYPE_AUDIO_VISUALIZ const plugin_info_t xine_plugin_info[] EXPORTED = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_POST, 9, "oscope", XINE_VERSION_CODE, &oscope_special_info, &oscope_init_plugin }, - { PLUGIN_POST, 9, "fftscope", XINE_VERSION_CODE, &fftscope_special_info, &fftscope_init_plugin }, - { PLUGIN_POST, 9, "fftgraph", XINE_VERSION_CODE, &fftgraph_special_info, &fftgraph_init_plugin }, + { PLUGIN_POST, 10, "oscope", XINE_VERSION_CODE, &oscope_special_info, &oscope_init_plugin }, + { PLUGIN_POST, 10, "fftscope", XINE_VERSION_CODE, &fftscope_special_info, &fftscope_init_plugin }, + { PLUGIN_POST, 10, "fftgraph", XINE_VERSION_CODE, &fftgraph_special_info, &fftgraph_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/post/visualizations/visualizations.h b/src/post/visualizations/visualizations.h index 39d02e1cb..c72a1ad77 100644 --- a/src/post/visualizations/visualizations.h +++ b/src/post/visualizations/visualizations.h @@ -20,7 +20,7 @@ * This file contains plugin entries for several visualization post plugins. */ -#include "xine_internal.h" +#include <xine/xine_internal.h> void *oscope_init_plugin(xine_t *xine, void *data); void *fftscope_init_plugin(xine_t *xine, void *data); |