mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
audiovisualizers: merge audiovisualizer base classes
These plugins now use the audiovisualizer base class in pbutils https://bugzilla.gnome.org/show_bug.cgi?id=742875
This commit is contained in:
parent
83c2262849
commit
9e97267ca0
8 changed files with 10 additions and 1576 deletions
|
@ -112,7 +112,6 @@ EXTRA_HFILES = \
|
|||
$(top_srcdir)/gst/aiff/aiffparse.h \
|
||||
$(top_srcdir)/gst/aiff/aiffmux.h \
|
||||
$(top_srcdir)/gst/autoconvert/gstautoconvert.h \
|
||||
$(top_srcdir)/gst/audiovisualizers/gstaudiovisualizer.h \
|
||||
$(top_srcdir)/gst/audiovisualizers/gstspacescope.h \
|
||||
$(top_srcdir)/gst/audiovisualizers/gstspectrascope.h \
|
||||
$(top_srcdir)/gst/audiovisualizers/gstsynaescope.h \
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
plugin_LTLIBRARIES = libgstaudiovisualizers.la
|
||||
|
||||
libgstaudiovisualizers_la_SOURCES = plugin.c \
|
||||
gstaudiovisualizer.c gstaudiovisualizer.h \
|
||||
gstspacescope.c gstspacescope.h \
|
||||
gstspectrascope.c gstspectrascope.h \
|
||||
gstsynaescope.c gstsynaescope.h \
|
||||
|
@ -13,9 +12,12 @@ libgstaudiovisualizers_la_CFLAGS = $(GST_PLUGINS_BAD_CFLAGS) \
|
|||
libgstaudiovisualizers_la_LIBADD = \
|
||||
$(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_API_VERSION) \
|
||||
-lgstvideo-$(GST_API_VERSION) -lgstfft-$(GST_API_VERSION) \
|
||||
$(GST_BASE_LIBS) $(GST_LIBS) $(LIBM)
|
||||
-lgstpbutils-$(GST_API_VERSION) $(GST_BASE_LIBS) $(GST_LIBS) $(LIBM)
|
||||
libgstaudiovisualizers_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
libgstaudiovisualizers_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
|
||||
|
||||
noinst_HEADERS = gstaudiovisualizer.h gstdrawhelpers.h \
|
||||
gstspacescope.h gstspectrascope.h gstsynaescope.h gstwavescope.h
|
||||
+noinst_HEADERS = gstdrawhelpers.h \
|
||||
gstspacescope.h \
|
||||
gstspectrascope.h \
|
||||
gstsynaescope.h \
|
||||
gstwavescope.h
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,108 +0,0 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) <2011> Stefan Kost <ensonic@users.sf.net>
|
||||
* Copyright (C) <2015> Luis de Bethencourt <luis@debethencourt.com>
|
||||
*
|
||||
* gstaudiovisualizer.c: base class for audio visualisation elements
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GST_AUDIO_VISUALIZER_H__
|
||||
#define __GST_AUDIO_VISUALIZER_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <gst/base/gstbasetransform.h>
|
||||
|
||||
#include <gst/video/video.h>
|
||||
#include <gst/audio/audio.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_AUDIO_VISUALIZER (gst_audio_visualizer_get_type())
|
||||
#define GST_AUDIO_VISUALIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_VISUALIZER,GstAudioVisualizer))
|
||||
#define GST_AUDIO_VISUALIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_VISUALIZER,GstAudioVisualizerClass))
|
||||
#define GST_AUDIO_VISUALIZER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_AUDIO_VISUALIZER,GstAudioVisualizerClass))
|
||||
#define GST_IS_AUDIO_VISUALIZER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_VISUALIZER))
|
||||
#define GST_IS_AUDIO_VISUALIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_VISUALIZER))
|
||||
|
||||
typedef struct _GstAudioVisualizer GstAudioVisualizer;
|
||||
typedef struct _GstAudioVisualizerClass GstAudioVisualizerClass;
|
||||
typedef struct _GstAudioVisualizerPrivate GstAudioVisualizerPrivate;
|
||||
|
||||
typedef void (*GstAudioVisualizerShaderFunc)(GstAudioVisualizer *scope, const GstVideoFrame *s, GstVideoFrame *d);
|
||||
|
||||
/**
|
||||
* GstAudioVisualizerShader:
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_NONE: no shading
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE: plain fading
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_UP: fade and move up
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_DOWN: fade and move down
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_LEFT: fade and move left
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT: fade and move right
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT: fade and move horizontally out
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN: fade and move horizontally in
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT: fade and move vertically out
|
||||
* @GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN: fade and move vertically in
|
||||
*
|
||||
* Different types of supported background shading functions.
|
||||
*/
|
||||
typedef enum {
|
||||
GST_AUDIO_VISUALIZER_SHADER_NONE,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_UP,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_DOWN,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_LEFT,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_RIGHT,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_OUT,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_HORIZ_IN,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_OUT,
|
||||
GST_AUDIO_VISUALIZER_SHADER_FADE_AND_MOVE_VERT_IN
|
||||
} GstAudioVisualizerShader;
|
||||
|
||||
struct _GstAudioVisualizer
|
||||
{
|
||||
GstElement parent;
|
||||
|
||||
guint req_spf; /* min samples per frame wanted by the subclass */
|
||||
|
||||
/* video state */
|
||||
GstVideoInfo vinfo;
|
||||
|
||||
/* audio state */
|
||||
GstAudioInfo ainfo;
|
||||
|
||||
/* <private> */
|
||||
GstAudioVisualizerPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GstAudioVisualizerClass
|
||||
{
|
||||
GstElementClass parent_class;
|
||||
|
||||
/* virtual function, called whenever the format changes */
|
||||
gboolean (*setup) (GstAudioVisualizer * scope);
|
||||
|
||||
/* virtual function for rendering a frame */
|
||||
gboolean (*render) (GstAudioVisualizer * scope, GstBuffer * audio, GstVideoFrame * video);
|
||||
|
||||
gboolean (*decide_allocation) (GstAudioVisualizer * scope, GstQuery *query);
|
||||
};
|
||||
|
||||
GType gst_audio_visualizer_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_AUDIO_VISUALIZER_H__ */
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef __GST_SPACE_SCOPE_H__
|
||||
#define __GST_SPACE_SCOPE_H__
|
||||
|
||||
#include "gstaudiovisualizer.h"
|
||||
#include "gst/pbutils/gstaudiovisualizer.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GST_TYPE_SPACE_SCOPE (gst_space_scope_get_type())
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef __GST_SPECTRA_SCOPE_H__
|
||||
#define __GST_SPECTRA_SCOPE_H__
|
||||
|
||||
#include "gstaudiovisualizer.h"
|
||||
#include "gst/pbutils/gstaudiovisualizer.h"
|
||||
#include <gst/fft/gstffts16.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef __GST_SYNAE_SCOPE_H__
|
||||
#define __GST_SYNAE_SCOPE_H__
|
||||
|
||||
#include "gstaudiovisualizer.h"
|
||||
#include "gst/pbutils/gstaudiovisualizer.h"
|
||||
#include <gst/fft/gstffts16.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef __GST_WAVE_SCOPE_H__
|
||||
#define __GST_WAVE_SCOPE_H__
|
||||
|
||||
#include "gstaudiovisualizer.h"
|
||||
#include "gst/pbutils/gstaudiovisualizer.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define GST_TYPE_WAVE_SCOPE (gst_wave_scope_get_type())
|
||||
|
|
Loading…
Reference in a new issue