2 * Copyright (C) <2011> Stefan Kost <ensonic@users.sf.net>
4 * gstbasescope.c: base class for audio visualisation elements
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef __GST_BASE_SCOPE_H__
22 #define __GST_BASE_SCOPE_H__
25 #include <gst/base/gstbasetransform.h>
27 #include <gst/video/video.h>
28 #include <gst/audio/audio.h>
29 #include <gst/base/gstadapter.h>
32 #define GST_TYPE_BASE_SCOPE (gst_base_scope_get_type())
33 #define GST_BASE_SCOPE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_SCOPE,GstBaseScope))
34 #define GST_BASE_SCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_SCOPE,GstBaseScopeClass))
35 #define GST_IS_SYNAESTHESIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_SCOPE))
36 #define GST_IS_SYNAESTHESIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_SCOPE))
37 typedef struct _GstBaseScope GstBaseScope;
38 typedef struct _GstBaseScopeClass GstBaseScopeClass;
45 GstPad *srcpad, *sinkpad;
50 guint64 next_ts; /* the timestamp of the next frame */
51 guint64 frame_duration;
52 guint bps; /* bytes per sample */
53 guint spf; /* samples per video frame */
56 GstVideoFormat video_format;
67 struct _GstBaseScopeClass
69 GstElementClass parent_class;
71 /* virtual function, called whenever the format changes */
72 gboolean (*setup) (GstBaseScope * scope);
74 /* virtual function for rendering a frame */
75 gboolean (*render) (GstBaseScope * scope, GstBuffer * audio, GstBuffer * video);
78 GType gst_base_scope_get_type (void);
81 #endif /* __GST_BASE_SCOPE_H__ */