summaryrefslogtreecommitdiff
path: root/src/post/planar
diff options
context:
space:
mode:
Diffstat (limited to 'src/post/planar')
-rw-r--r--src/post/planar/Makefile.am5
-rw-r--r--src/post/planar/boxblur.c6
-rw-r--r--src/post/planar/denoise3d.c6
-rw-r--r--src/post/planar/eq.c6
-rw-r--r--src/post/planar/eq2.c37
-rw-r--r--src/post/planar/expand.c2
-rw-r--r--src/post/planar/fill.c2
-rw-r--r--src/post/planar/invert.c2
-rw-r--r--src/post/planar/noise.c6
-rw-r--r--src/post/planar/planar.c4
-rw-r--r--src/post/planar/pp.c22
-rw-r--r--src/post/planar/unsharp.c13
12 files changed, 63 insertions, 48 deletions
diff --git a/src/post/planar/Makefile.am b/src/post/planar/Makefile.am
index 4ba6bfa41..751ea390a 100644
--- a/src/post/planar/Makefile.am
+++ b/src/post/planar/Makefile.am
@@ -1,12 +1,13 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
POSTPROC_INT_LIB = $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la
if HAVE_FFMPEG
postproc_lib = $(FFMPEG_POSTPROC_LIBS)
-ff_cflags = $(FFMPEG_POSTPROC_CFLAGS)
+ff_cflags = $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
else
-ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec/libpostproc
+ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec
postproc_lib = $(POSTPROC_INT_LIB)
postproc_dep = $(postproc_lib)
endif
diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c
index b7a6f524f..517cec489 100644
--- a/src/post/planar/boxblur.c
+++ b/src/post/planar/boxblur.c
@@ -21,6 +21,10 @@
* Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -154,7 +158,7 @@ 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)
{
- post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)xine_xmalloc(sizeof(post_plugin_boxblur_t));
+ post_plugin_boxblur_t *this = calloc(1, sizeof(post_plugin_boxblur_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c
index fb3c1102b..21b58dbf9 100644
--- a/src/post/planar/denoise3d.c
+++ b/src/post/planar/denoise3d.c
@@ -21,6 +21,10 @@
* Copyright (C) 2003 Daniel Moreno <comac@comac.darktech.org>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -194,7 +198,7 @@ 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)
{
- post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)xine_xmalloc(sizeof(post_plugin_denoise3d_t));
+ post_plugin_denoise3d_t *this = calloc(1, sizeof(post_plugin_denoise3d_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c
index b2cf6e50f..45bc43463 100644
--- a/src/post/planar/eq.c
+++ b/src/post/planar/eq.c
@@ -21,6 +21,10 @@
* Copyright (C) Richard Felker
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -246,7 +250,7 @@ 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)
{
- post_plugin_eq_t *this = (post_plugin_eq_t *)xine_xmalloc(sizeof(post_plugin_eq_t));
+ post_plugin_eq_t *this = calloc(1, sizeof(post_plugin_eq_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c
index 6b277c347..1a301fdab 100644
--- a/src/post/planar/eq2.c
+++ b/src/post/planar/eq2.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2006 the xine project
+ * Copyright (C) 2000-2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -25,6 +25,10 @@
* Richard Felker (original MMX contrast/brightness code (vf_eq.c))
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -427,13 +431,11 @@ 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)
{
- post_plugin_eq2_t *this = (post_plugin_eq2_t *)xine_xmalloc(sizeof(post_plugin_eq2_t));
+ post_plugin_eq2_t *this = calloc(1, sizeof(post_plugin_eq2_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
- vf_eq2_t *eq2;
- int i;
if (!this || !video_target || !video_target[0]) {
free(this);
@@ -442,26 +444,15 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
_x_post_init(&this->post, 0, 1);
- eq2 = &this->eq2;
- for (i = 0; i < 3; i++) {
- eq2->buf[i] = NULL;
- eq2->buf_w[i] = 0;
- eq2->buf_h[i] = 0;
-
- eq2->param[i].adjust = NULL;
- eq2->param[i].c = 1.0;
- eq2->param[i].b = 0.0;
- eq2->param[i].g = 1.0;
- eq2->param[i].lut_clean = 0;
- }
+ memset(&this->eq2, 0, sizeof(this->eq2));
- eq2->gamma = this->params.gamma = 1.0;
- eq2->contrast = this->params.contrast = 1.0;
- eq2->brightness = this->params.brightness = 0.0;
- eq2->saturation = this->params.saturation = 1.0;
- eq2->rgamma = this->params.rgamma = 1.0;
- eq2->ggamma = this->params.ggamma = 1.0;
- eq2->bgamma = this->params.bgamma = 1.0;
+ this->eq2.gamma = this->params.gamma = 1.0;
+ this->eq2.contrast = this->params.contrast = 1.0;
+ this->eq2.brightness = this->params.brightness = 0.0;
+ this->eq2.saturation = this->params.saturation = 1.0;
+ this->eq2.rgamma = this->params.rgamma = 1.0;
+ this->eq2.ggamma = this->params.ggamma = 1.0;
+ this->eq2.bgamma = this->params.bgamma = 1.0;
pthread_mutex_init(&this->lock, NULL);
diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c
index 67d449153..52bc2b37a 100644
--- a/src/post/planar/expand.c
+++ b/src/post/planar/expand.c
@@ -148,7 +148,7 @@ 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)
{
- post_expand_t *this = (post_expand_t *)xine_xmalloc(sizeof(post_expand_t));
+ post_expand_t *this = calloc(1, sizeof(post_expand_t));
post_in_t *input;
xine_post_in_t *input_param;
post_out_t *output;
diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c
index 32a9d5dfb..98c572777 100644
--- a/src/post/planar/fill.c
+++ b/src/post/planar/fill.c
@@ -66,7 +66,7 @@ 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)
{
- post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t));
+ post_plugin_t *this = calloc(1, sizeof(post_plugin_t));
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c
index 1aa5c2a2e..d1f0c8d4e 100644
--- a/src/post/planar/invert.c
+++ b/src/post/planar/invert.c
@@ -67,7 +67,7 @@ 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)
{
- post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t));
+ post_plugin_t *this = calloc(1, sizeof(post_plugin_t));
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c
index 8c04f2e72..f639fce76 100644
--- a/src/post/planar/noise.c
+++ b/src/post/planar/noise.c
@@ -21,6 +21,10 @@
* is copyright 2002 Michael Niedermayer <michaelni@gmx.at>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -471,7 +475,7 @@ 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)
{
- post_plugin_noise_t *this = (post_plugin_noise_t *)xine_xmalloc(sizeof(post_plugin_noise_t));
+ post_plugin_noise_t *this = calloc(1, sizeof(post_plugin_noise_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/planar.c b/src/post/planar/planar.c
index 5907d58e5..e1c9681ab 100644
--- a/src/post/planar/planar.c
+++ b/src/post/planar/planar.c
@@ -20,6 +20,10 @@
* catalog for planar post plugins
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c
index e13119311..1ce45e381 100644
--- a/src/post/planar/pp.c
+++ b/src/post/planar/pp.c
@@ -20,12 +20,21 @@
* plugin for ffmpeg libpostprocess
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
-#include "postprocess.h"
#include <pthread.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <postprocess.h>
+#else
+# include <libpostproc/postprocess.h>
+#endif
+
#define PP_STRING_SIZE 256 /* size of pp mode string (including all options) */
/* plugin class initialization function */
@@ -114,12 +123,9 @@ static char * get_help (void) {
);
static char *help = NULL;
- if( !help ) {
- help = malloc( strlen(help1) + strlen(help2) + strlen(pp_help) + 1);
- strcpy(help, help1);
- strcat(help, pp_help);
- strcat(help, help2);
- }
+ if( !help )
+ asprintf(&help, "%s%s%s", help1, help2, pp_help);
+
return help;
}
@@ -169,7 +175,7 @@ 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)
{
- post_plugin_pp_t *this = (post_plugin_pp_t *)xine_xmalloc(sizeof(post_plugin_pp_t));
+ post_plugin_pp_t *this = calloc(1, sizeof(post_plugin_pp_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c
index b9b791a8e..6fac727ce 100644
--- a/src/post/planar/unsharp.c
+++ b/src/post/planar/unsharp.c
@@ -21,18 +21,15 @@
* Copyright (C) 2002 Rémi Guyomarch <rguyom@pobox.com>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
#include <pthread.h>
-#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
/*===========================================================================*/
#define MIN_MATRIX_SIZE 3
@@ -287,7 +284,7 @@ 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)
{
- post_plugin_unsharp_t *this = (post_plugin_unsharp_t *)xine_xmalloc(sizeof(post_plugin_unsharp_t));
+ post_plugin_unsharp_t *this = calloc(1, sizeof(post_plugin_unsharp_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;