3 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4 * 2006 Edgard Lima <edgard.lima@gmail.com>
6 * gstv4l2colorbalance.h: color balance interface implementation for V4L2
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.
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.
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., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
24 #ifndef __GST_V4L2_COLOR_BALANCE_H__
25 #define __GST_V4L2_COLOR_BALANCE_H__
28 #include <gst/video/colorbalance.h>
30 #include "gstv4l2object.h"
34 #define GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL \
35 (gst_v4l2_color_balance_channel_get_type ())
36 #define GST_V4L2_COLOR_BALANCE_CHANNEL(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL, \
38 GstV4l2ColorBalanceChannel))
39 #define GST_V4L2_COLOR_BALANCE_CHANNEL_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL, \
41 GstV4l2ColorBalanceChannelClass))
42 #define GST_IS_V4L2_COLOR_BALANCE_CHANNEL(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL))
44 #define GST_IS_V4L2_COLOR_BALANCE_CHANNEL_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL))
47 typedef struct _GstV4l2ColorBalanceChannel {
48 GstColorBalanceChannel parent;
51 } GstV4l2ColorBalanceChannel;
53 typedef struct _GstV4l2ColorBalanceChannelClass {
54 GstColorBalanceChannelClass parent;
55 } GstV4l2ColorBalanceChannelClass;
57 GType gst_v4l2_color_balance_channel_get_type (void);
59 const GList * gst_v4l2_color_balance_list_channels (GstV4l2Object * v4l2object);
61 void gst_v4l2_color_balance_set_value (GstV4l2Object * v4l2object,
62 GstColorBalanceChannel * channel,
65 gint gst_v4l2_color_balance_get_value (GstV4l2Object * v4l2object,
66 GstColorBalanceChannel * channel);
68 #define GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS(Type, interface_as_function) \
70 static const GList * \
71 interface_as_function ## _color_balance_list_channels (GstColorBalance * balance) \
73 Type *this = (Type*) balance; \
74 return gst_v4l2_color_balance_list_channels(this->v4l2object); \
78 interface_as_function ## _color_balance_set_value (GstColorBalance * balance, \
79 GstColorBalanceChannel * channel, \
82 Type *this = (Type*) balance; \
83 gst_v4l2_color_balance_set_value(this->v4l2object, channel, value); \
87 interface_as_function ## _color_balance_get_value (GstColorBalance * balance, \
88 GstColorBalanceChannel * channel) \
90 Type *this = (Type*) balance; \
91 return gst_v4l2_color_balance_get_value(this->v4l2object, channel); \
94 static GstColorBalanceType \
95 interface_as_function ## _color_balance_get_balance_type (GstColorBalance * balance) \
97 return GST_COLOR_BALANCE_HARDWARE; \
101 interface_as_function ## _color_balance_interface_init (GstColorBalanceInterface * iface) \
103 /* default virtual functions */ \
104 iface->list_channels = interface_as_function ## _color_balance_list_channels; \
105 iface->set_value = interface_as_function ## _color_balance_set_value; \
106 iface->get_value = interface_as_function ## _color_balance_get_value; \
107 iface->get_balance_type = interface_as_function ## _color_balance_get_balance_type; \
111 #endif /* __GST_V4L2_COLOR_BALANCE_H__ */