Git init
[framework/multimedia/gstreamer0.10.git] / libs / gst / controller / gstinterpolationcontrolsource.h
1 /* GStreamer
2  *
3  * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
4  *
5  * gstinterpolationcontrolsource.h: Control source that provides several
6  *                                  interpolation methods
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __GST_INTERPOLATION_CONTROL_SOURCE_H__
25 #define __GST_INTERPOLATION_CONTROL_SOURCE_H__
26
27 #include <glib-object.h>
28 #include <gst/gst.h>
29
30 #include <gst/controller/gstcontrolsource.h>
31
32 G_BEGIN_DECLS
33
34 #define GST_TYPE_INTERPOLATION_CONTROL_SOURCE \
35   (gst_interpolation_control_source_get_type ())
36 #define GST_INTERPOLATION_CONTROL_SOURCE(obj) \
37   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_INTERPOLATION_CONTROL_SOURCE, GstInterpolationControlSource))
38 #define GST_INTERPOLATION_CONTROL_SOURCE_CLASS(vtable) \
39   (G_TYPE_CHECK_CLASS_CAST ((vtable), GST_TYPE_INTERPOLATION_CONTROL_SOURCE, GstInterpolationControlSourceClass))
40 #define GST_IS_INTERPOLATION_CONTROL_SOURCE(obj) \
41   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_INTERPOLATION_CONTROL_SOURCE))
42 #define GST_IS_INTERPOLATION_CONTROL_SOURCE_CLASS(vtable) \
43   (G_TYPE_CHECK_CLASS_TYPE ((vtable), GST_TYPE_INTERPOLATION_CONTROL_SOURCE))
44 #define GST_INTERPOLATION_CONTROL_SOURCE_GET_CLASS(inst) \
45   (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_INTERPOLATION_CONTROL_SOURCE, GstInterpolationControlSourceClass))
46
47 typedef struct _GstInterpolationControlSource GstInterpolationControlSource;
48 typedef struct _GstInterpolationControlSourceClass GstInterpolationControlSourceClass;
49 typedef struct _GstInterpolationControlSourcePrivate GstInterpolationControlSourcePrivate;
50
51 /**
52  * GstInterpolateMode:
53  * @GST_INTERPOLATE_NONE: steps-like interpolation, default
54  * @GST_INTERPOLATE_TRIGGER: returns the default value of the property,
55  * except for times with specific values
56  * @GST_INTERPOLATE_LINEAR: linear interpolation
57  * @GST_INTERPOLATE_QUADRATIC: square interpolation (deprecated, maps to cubic)
58  * @GST_INTERPOLATE_CUBIC: cubic interpolation
59  * @GST_INTERPOLATE_USER: user-provided interpolation (not yet available)
60  *
61  * The various interpolation modes available.
62  */
63 typedef enum
64 {
65   GST_INTERPOLATE_NONE,
66   GST_INTERPOLATE_TRIGGER,
67   GST_INTERPOLATE_LINEAR,
68   GST_INTERPOLATE_QUADRATIC,
69   GST_INTERPOLATE_CUBIC,
70   GST_INTERPOLATE_USER
71 } GstInterpolateMode;
72
73 /**
74  * GstInterpolationControlSource:
75  *
76  * The instance structure of #GstControlSource.
77  */
78 struct _GstInterpolationControlSource {
79   GstControlSource parent;
80
81   /* <private> */
82   GMutex *lock;
83   GstInterpolationControlSourcePrivate *priv;
84   gpointer _gst_reserved[GST_PADDING];
85 };
86
87 struct _GstInterpolationControlSourceClass {
88   GstControlSourceClass parent_class;
89   
90   /*< private >*/
91   gpointer _gst_reserved[GST_PADDING];
92 };
93
94 GType gst_interpolation_control_source_get_type (void);
95
96 /* Functions */
97
98 GstInterpolationControlSource *gst_interpolation_control_source_new (void);
99 gboolean gst_interpolation_control_source_set_interpolation_mode (GstInterpolationControlSource *self, GstInterpolateMode mode);
100 gboolean gst_interpolation_control_source_set (GstInterpolationControlSource * self, GstClockTime timestamp, const GValue * value);
101 gboolean gst_interpolation_control_source_set_from_list (GstInterpolationControlSource * self, const GSList * timedvalues);
102 gboolean gst_interpolation_control_source_unset (GstInterpolationControlSource * self, GstClockTime timestamp);
103 void gst_interpolation_control_source_unset_all (GstInterpolationControlSource *self);
104 GList *gst_interpolation_control_source_get_all (GstInterpolationControlSource * self);
105 gint gst_interpolation_control_source_get_count (GstInterpolationControlSource * self);
106
107 G_END_DECLS
108
109 #endif /* __GST_INTERPOLATION_CONTROL_SOURCE_H__ */