Initial release
[adaptation/ap_samsung/gst-plugins-s5pc2xx.git] / camerasrc / src / include / gstcamerasrccolorbalance.h
1 /*
2  * camerasrc
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jeongmo Yang <jm80.yang@samsung.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24 #ifndef __GST_CAMERASRC_COLOR_BALANCE_H__
25 #define __GST_CAMERASRC_COLOR_BALANCE_H__
26
27 #include <gst/gst.h>
28 #include <gst/interfaces/colorbalance.h>
29 #include "gstcamerasrc.h"
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_CAMERASRC_COLOR_BALANCE_CHANNEL (gst_camerasrc_color_balance_channel_get_type ())
34 #define GST_CAMERASRC_COLOR_BALANCE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CAMERASRC_COLOR_BALANCE_CHANNEL, GstCameraSrcColorBalanceChannel))
35 #define GST_CAMERASRC_COLOR_BALANCE_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CAMERASRC_COLOR_BALANCE_CHANNEL, GstCameraSrcColorBalanceChannelClass))
36 #define GST_IS_CAMERASRC_COLOR_BALANCE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CAMERASRC_COLOR_BALANCE_CHANNEL))
37 #define GST_IS_CAMERASRC_COLOR_BALANCE_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CAMERASRC_COLOR_BALANCE_CHANNEL))
38
39 typedef struct _GstCameraSrcColorBalanceChannel {
40   GstColorBalanceChannel parent;
41
42   guint32 id;
43 } GstCameraSrcColorBalanceChannel;
44
45 typedef struct _GstCameraSrcColorBalanceChannelClass {
46   GstColorBalanceChannelClass parent;
47 } GstCameraSrcColorBalanceChannelClass;
48
49 GType gst_camerasrc_color_balance_channel_get_type( void );
50
51 const GList *gst_camerasrc_color_balance_list_channels( GstCameraSrc* camerasrc );
52 void gst_camerasrc_color_balance_set_value( GstCameraSrc* camerasrc, GstColorBalanceChannel* color_channel, gint value );
53 gint gst_camerasrc_color_balance_get_value( GstCameraSrc* camerasrc, GstColorBalanceChannel* color_channel );
54
55 #define GST_IMPLEMENT_CAMERASRC_COLOR_BALANCE_METHODS( Type, interface_as_function ) \
56  \
57 static const GList* \
58 interface_as_function ## _color_balance_list_channels( GstColorBalance* balance ) \
59 { \
60         Type *this = (Type*) balance; \
61         return gst_camerasrc_color_balance_list_channels( this ); \
62 } \
63  \
64 static void \
65 interface_as_function ## _color_balance_set_value( GstColorBalance* balance, \
66                                                  GstColorBalanceChannel* color_channel, \
67                                                  gint value ) \
68 { \
69         Type *this = (Type*) balance; \
70         return gst_camerasrc_color_balance_set_value( this, color_channel, value ); \
71 } \
72  \
73 static gint \
74 interface_as_function ## _color_balance_get_value( GstColorBalance* balance, \
75                                                  GstColorBalanceChannel* color_channel )\
76 { \
77         Type *this = (Type*) balance; \
78         return gst_camerasrc_color_balance_get_value( this, color_channel ); \
79 } \
80  \
81 void \
82 interface_as_function ## _color_balance_interface_init( GstColorBalanceClass* klass ) \
83 { \
84         GST_COLOR_BALANCE_TYPE( klass ) = GST_COLOR_BALANCE_HARDWARE; \
85  \
86         /* default virtual functions */ \
87         klass->list_channels = interface_as_function ## _color_balance_list_channels; \
88         klass->set_value = interface_as_function ## _color_balance_set_value; \
89         klass->get_value = interface_as_function ## _color_balance_get_value; \
90 }
91
92 #endif /* __GST_CAMERASRC_COLOR_BALANCE_H__ */
93