2005-08-25 09:32:22 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2005 Wim Taymans <wim@fluendo.com>
|
|
|
|
*
|
|
|
|
* gstsignalprocessor.h:
|
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_SIGNAL_PROCESSOR_H__
|
|
|
|
#define __GST_SIGNAL_PROCESSOR_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2006-08-04 11:38:54 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_SIGNAL_PROCESSOR_CLASS_FLAG_CAN_PROCESS_IN_PLACE = 1<<0
|
|
|
|
} GstSignalProcessorClassFlags;
|
|
|
|
|
|
|
|
#define GST_SIGNAL_PROCESSOR_CLASS_CAN_PROCESS_IN_PLACE(klass) \
|
|
|
|
(GST_SIGNAL_PROCESSOR_CLASS (klass)->flags & \
|
|
|
|
GST_SIGNAL_PROCESSOR_CLASS_FLAG_CAN_PROCESS_IN_PLACE)
|
|
|
|
#define GST_SIGNAL_PROCESSOR_CLASS_SET_CAN_PROCESS_IN_PLACE(klass) \
|
|
|
|
GST_SIGNAL_PROCESSOR_CLASS (klass)->flags |= \
|
|
|
|
GST_SIGNAL_PROCESSOR_CLASS_FLAG_CAN_PROCESS_IN_PLACE
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_SIGNAL_PROCESSOR_STATE_NULL,
|
|
|
|
GST_SIGNAL_PROCESSOR_STATE_INITIALIZED,
|
|
|
|
GST_SIGNAL_PROCESSOR_STATE_RUNNING
|
|
|
|
} GstSignalProcessorState;
|
|
|
|
|
|
|
|
|
2006-04-08 18:25:55 +00:00
|
|
|
#define GST_TYPE_SIGNAL_PROCESSOR (gst_signal_processor_get_type())
|
|
|
|
#define GST_SIGNAL_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SIGNAL_PROCESSOR,GstSignalProcessor))
|
|
|
|
#define GST_SIGNAL_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SIGNAL_PROCESSOR,GstSignalProcessorClass))
|
2005-08-25 09:32:22 +00:00
|
|
|
#define GST_SIGNAL_PROCESSOR_GET_CLASS(obj) \
|
2005-12-06 19:44:48 +00:00
|
|
|
(G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_SIGNAL_PROCESSOR,GstSignalProcessorClass))
|
2006-04-08 18:25:55 +00:00
|
|
|
#define GST_IS_SIGNAL_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SIGNAL_PROCESSOR))
|
|
|
|
#define GST_IS_SIGNAL_PROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SIGNAL_PROCESSOR))
|
2005-08-25 09:32:22 +00:00
|
|
|
|
2006-08-04 11:38:54 +00:00
|
|
|
#define GST_SIGNAL_PROCESSOR_IS_INITIALIZED(obj) \
|
|
|
|
(GST_SIGNAL_PROCESSOR (obj)->state >= GST_SIGNAL_PROCESSOR_STATE_INITIALIZED)
|
|
|
|
#define GST_SIGNAL_PROCESSOR_IS_RUNNING(obj) \
|
|
|
|
(GST_SIGNAL_PROCESSOR (obj)->state == GST_SIGNAL_PROCESSOR_STATE_RUNNING)
|
2005-08-25 09:32:22 +00:00
|
|
|
|
|
|
|
typedef struct _GstSignalProcessor GstSignalProcessor;
|
|
|
|
typedef struct _GstSignalProcessorClass GstSignalProcessorClass;
|
|
|
|
|
|
|
|
|
|
|
|
struct _GstSignalProcessor {
|
2005-12-06 19:44:48 +00:00
|
|
|
GstElement element;
|
2005-08-25 09:32:22 +00:00
|
|
|
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
guint sample_rate;
|
|
|
|
|
2006-08-04 11:38:54 +00:00
|
|
|
GstSignalProcessorState state;
|
|
|
|
|
|
|
|
GstFlowReturn flow_state;
|
2005-08-25 09:32:22 +00:00
|
|
|
|
|
|
|
GstActivateMode mode;
|
|
|
|
|
2009-03-25 21:04:13 +00:00
|
|
|
/* pending inputs before processing can take place */
|
2005-08-25 09:32:22 +00:00
|
|
|
guint pending_in;
|
2009-03-25 21:04:13 +00:00
|
|
|
/* panding outputs to be filled */
|
2005-08-25 09:32:22 +00:00
|
|
|
guint pending_out;
|
|
|
|
|
|
|
|
gfloat *control_in;
|
|
|
|
gfloat **audio_in;
|
|
|
|
gfloat *control_out;
|
|
|
|
gfloat **audio_out;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstSignalProcessorClass {
|
|
|
|
GstElementClass parent_class;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
guint num_control_in;
|
|
|
|
guint num_audio_in;
|
|
|
|
guint num_control_out;
|
|
|
|
guint num_audio_out;
|
|
|
|
|
2006-08-04 11:38:54 +00:00
|
|
|
guint flags;
|
|
|
|
|
2005-08-25 09:32:22 +00:00
|
|
|
/* virtual methods for subclasses */
|
|
|
|
|
2005-12-06 19:44:48 +00:00
|
|
|
gboolean (*setup) (GstSignalProcessor *self, guint sample_rate);
|
2005-08-25 09:32:22 +00:00
|
|
|
gboolean (*start) (GstSignalProcessor *self);
|
2005-12-06 19:44:48 +00:00
|
|
|
void (*stop) (GstSignalProcessor *self);
|
|
|
|
void (*cleanup) (GstSignalProcessor *self);
|
|
|
|
void (*process) (GstSignalProcessor *self, guint num_frames);
|
2005-08-25 09:32:22 +00:00
|
|
|
gboolean (*event) (GstSignalProcessor *self, GstEvent *event);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
GType gst_signal_processor_get_type (void);
|
|
|
|
void gst_signal_processor_class_add_pad_template (GstSignalProcessorClass *klass,
|
|
|
|
const gchar *name, GstPadDirection direction, guint index);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GST_SIGNAL_PROCESSOR_H__ */
|