summaryrefslogtreecommitdiff
path: root/src/post/visualizations
diff options
context:
space:
mode:
Diffstat (limited to 'src/post/visualizations')
-rw-r--r--src/post/visualizations/Makefile.am11
-rw-r--r--src/post/visualizations/fft.c14
-rw-r--r--src/post/visualizations/fft.h3
-rw-r--r--src/post/visualizations/fftgraph.c38
-rw-r--r--src/post/visualizations/fftscope.c38
-rw-r--r--src/post/visualizations/fooviz.c40
-rw-r--r--src/post/visualizations/oscope.c38
-rw-r--r--src/post/visualizations/visualizations.c14
-rw-r--r--src/post/visualizations/visualizations.h6
9 files changed, 56 insertions, 146 deletions
diff --git a/src/post/visualizations/Makefile.am b/src/post/visualizations/Makefile.am
index dc7679103..bea89ac49 100644
--- a/src/post/visualizations/Makefile.am
+++ b/src/post/visualizations/Makefile.am
@@ -1,15 +1,14 @@
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
EXTRA_DIST = fooviz.c
-libdir = $(XINE_PLUGINDIR)/post
+noinst_HEADERS = fft.h visualizations.h
-lib_LTLIBRARIES = xineplug_post_visualizations.la
+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 = -avoid-version -module
-
-noinst_HEADERS = fft.h visualizations.h
diff --git a/src/post/visualizations/fft.c b/src/post/visualizations/fft.c
index fba3cb8ad..01044987b 100644
--- a/src/post/visualizations/fft.c
+++ b/src/post/visualizations/fft.c
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* FFT code by Steve Haehnichen, originally licensed under GPL v1
* modified by Thibaut Mattern (tmattern@noos.fr) to remove global vars
@@ -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 1ab501be5..1600430bc 100644
--- a/src/post/visualizations/fft.h
+++ b/src/post/visualizations/fft.h
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*/
#ifndef 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 669a4bc94..c31c529f2 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -15,13 +15,10 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* FftGraph Visualization Post Plugin For xine
* by Thibaut Mattern (tmattern@noos.fr)
- *
- * $Id: fftgraph.c,v 1.15 2006/12/02 22:35:18 miguelfreitas Exp $
- *
*/
#include <stdio.h>
@@ -29,9 +26,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"
@@ -197,7 +194,7 @@ static int fftgraph_rewire_video(xine_post_out_t *output_gen, void *data)
return 0;
/* register our stream at the new output port */
old_port->close(old_port, XINE_ANON_STREAM);
- new_port->open(new_port, XINE_ANON_STREAM);
+ (new_port->open) (new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -232,7 +229,7 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
this->data_idx = 0;
this->sample_counter = 0;
- this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
+ (this->vo_port->open) (this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
this->fft = fft_new(FFT_BITS);
@@ -284,7 +281,7 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
}
}
- return port->original_port->open(port->original_port, stream, bits, rate, mode );
+ return (port->original_port->open) (port->original_port, stream, bits, rate, mode );
}
static void fftgraph_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream ) {
@@ -455,21 +452,6 @@ 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)
{
@@ -479,9 +461,9 @@ void *fftgraph_init_plugin(xine_t *xine, void *data)
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 aef517c59..dd474bd6f 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -15,23 +15,20 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* Fast Fourier Transform Visualization Post Plugin For xine
* by Mike Melanson (melanson@pcisys.net)
*
* FFT code by Steve Haehnichen, originally licensed under GPL v1
- *
- * $Id: fftscope.c,v 1.30 2006/12/02 22:35:18 miguelfreitas Exp $
- *
*/
#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"
@@ -261,7 +258,7 @@ static int fftscope_rewire_video(xine_post_out_t *output_gen, void *data)
return 0;
/* register our stream at the new output port */
old_port->close(old_port, XINE_ANON_STREAM);
- new_port->open(new_port, XINE_ANON_STREAM);
+ (new_port->open) (new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -292,7 +289,7 @@ static int fftscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
this->sample_counter = 0;
this->fft = fft_new(FFT_BITS);
- this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
+ (this->vo_port->open) (this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
for (c = 0; c < this->channels; c++) {
@@ -305,7 +302,7 @@ static int fftscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
}
}
- return port->original_port->open(port->original_port, stream, bits, rate, mode );
+ return (port->original_port->open) (port->original_port, stream, bits, rate, mode );
}
static void fftscope_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream ) {
@@ -476,21 +473,6 @@ 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)
{
@@ -500,9 +482,9 @@ void *fftscope_init_plugin(xine_t *xine, void *data)
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 9e69fefab..2cf77cadc 100644
--- a/src/post/visualizations/fooviz.c
+++ b/src/post/visualizations/fooviz.c
@@ -15,23 +15,20 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* Reference Visualization Post Plugin For xine
* by Mike Melanson (melanson@pcisys.net)
* This is an example/template for the xine visualization post plugin
* process. It simply paints the screen a solid color and rotates through
* colors on each iteration.
- *
- * $Id: fooviz.c,v 1.28 2006/12/02 22:35:18 miguelfreitas Exp $
- *
*/
#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
@@ -94,7 +91,7 @@ static int fooviz_rewire_video(xine_post_out_t *output_gen, void *data)
return 0;
/* register our stream at the new output port */
old_port->close(old_port, XINE_ANON_STREAM);
- new_port->open(new_port, XINE_ANON_STREAM);
+ (new_port->open) (new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -120,10 +117,10 @@ static int fooviz_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
this->data_idx = 0;
this->sample_counter = 0;
- this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
+ (this->vo_port->open) (this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
- return port->original_port->open(port->original_port, stream, bits, rate, mode );
+ return (port->original_port->open) (port->original_port, stream, bits, rate, mode );
}
static void fooviz_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream ) {
@@ -287,21 +284,6 @@ 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)
{
@@ -311,9 +293,9 @@ static void *fooviz_init_plugin(xine_t *xine, void *data)
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;
@@ -325,6 +307,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 483fc39ab..1d498980a 100644
--- a/src/post/visualizations/oscope.c
+++ b/src/post/visualizations/oscope.c
@@ -15,20 +15,17 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* Basic Oscilloscope Visualization Post Plugin For xine
* by Mike Melanson (melanson@pcisys.net)
- *
- * $Id: oscope.c,v 1.21 2006/12/02 22:35:18 miguelfreitas Exp $
- *
*/
#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
@@ -164,7 +161,7 @@ static int oscope_rewire_video(xine_post_out_t *output_gen, void *data)
if (!data)
return 0;
old_port->close(old_port, XINE_ANON_STREAM);
- new_port->open(new_port, XINE_ANON_STREAM);
+ (new_port->open) (new_port, XINE_ANON_STREAM);
/* reconnect ourselves */
this->vo_port = new_port;
return 1;
@@ -194,10 +191,10 @@ static int oscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
this->sample_counter = 0;
init_yuv_planes(&this->yuv, OSCOPE_WIDTH, OSCOPE_HEIGHT);
- this->vo_port->open(this->vo_port, XINE_ANON_STREAM);
+ (this->vo_port->open) (this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
- return port->original_port->open(port->original_port, stream, bits, rate, mode );
+ return (port->original_port->open) (port->original_port, stream, bits, rate, mode );
}
static void oscope_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream ) {
@@ -358,21 +355,6 @@ 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)
{
@@ -382,9 +364,9 @@ void *oscope_init_plugin(xine_t *xine, void *data)
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 befd8ca4c..17c8491d5 100644
--- a/src/post/visualizations/visualizations.c
+++ b/src/post/visualizations/visualizations.c
@@ -15,19 +15,17 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* This file contains plugin entries for several visualization post plugins.
- *
- * $Id: visualizations.c,v 1.14 2006/07/10 22:08:44 dgp85 Exp $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
#include "visualizations.h"
@@ -48,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 967d98c35..c72a1ad77 100644
--- a/src/post/visualizations/visualizations.h
+++ b/src/post/visualizations/visualizations.h
@@ -15,14 +15,12 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* This file contains plugin entries for several visualization post plugins.
- *
- * $Id: visualizations.h,v 1.1 2003/10/30 22:40:53 mroi Exp $
*/
-#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);