Release 1.1.4
[platform/upstream/gst-plugins-good.git] / gst / audiofx / gstscaletempo.h
1 /*
2  * GStreamer
3  * Copyright (C) 2008 Rov Juvano <rovjuvano@users.sourceforge.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GST_SCALETEMPO_H__
22 #define __GST_SCALETEMPO_H__
23
24 #include <gst/gst.h>
25 #include <gst/base/gstbasetransform.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_TYPE_SCALETEMPO            (gst_scaletempo_get_type())
30 #define GST_SCALETEMPO(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_SCALETEMPO, GstScaletempo))
31 #define GST_SCALETEMPO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  GST_TYPE_SCALETEMPO, GstScaletempoClass))
32 #define GST_IS_SCALETEMPO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_SCALETEMPO))
33 #define GST_IS_SCALETEMPO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GST_TYPE_SCALETEMPO))
34
35 typedef struct _GstScaletempo GstScaletempo;
36 typedef struct _GstScaletempoClass GstScaletempoClass;
37 typedef struct _GstScaletempoPrivate GstScaletempoPrivate;
38
39 struct _GstScaletempo
40 {
41   GstBaseTransform element;
42
43   gdouble scale;
44
45   /* parameters */
46   guint ms_stride;
47   gdouble percent_overlap;
48   guint ms_search;
49
50   /* caps */
51   gboolean use_int;
52   guint samples_per_frame;      /* AKA number of channels */
53   guint bytes_per_sample;
54   guint bytes_per_frame;
55   guint sample_rate;
56
57   /* stride */
58   gdouble frames_stride_scaled;
59   gdouble frames_stride_error;
60   guint bytes_stride;
61   gdouble bytes_stride_scaled;
62   guint bytes_queue_max;
63   guint bytes_queued;
64   guint bytes_to_slide;
65   gint8 *buf_queue;
66
67   /* overlap */
68   guint samples_overlap;
69   guint samples_standing;
70   guint bytes_overlap;
71   guint bytes_standing;
72   gpointer buf_overlap;
73   gpointer table_blend;
74   void (*output_overlap) (GstScaletempo * scaletempo, gpointer out_buf, guint bytes_off);
75
76   /* best overlap */
77   guint frames_search;
78   gpointer buf_pre_corr;
79   gpointer table_window;
80   guint (*best_overlap_offset) (GstScaletempo * scaletempo);
81
82   /* gstreamer */
83   gint64 segment_start;
84   GstClockTime latency;
85
86   /* threads */
87   gboolean reinit_buffers;
88 };
89
90 struct _GstScaletempoClass
91 {
92   GstBaseTransformClass parent_class;
93 };
94
95 GType gst_scaletempo_get_type (void);
96
97 G_END_DECLS
98 #endif /* __GST_SCALETEMPO_H__ */