Stefan Kost | 074e7b0 | 2006-09-02 14:28:55 +0000 | [diff] [blame] | 1 | /* GStreamer |
| 2 | * |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 3 | * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net> |
Edgard Lima | 8635258 | 2017-02-25 21:47:03 -0300 | [diff] [blame] | 4 | * 2006 Edgard Lima <edgard.lima@gmail.com> |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 5 | * |
| 6 | * gstv4l2colorbalance.h: color balance interface implementation for V4L2 |
| 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 |
Tim-Philipp Müller | 230cf41 | 2012-11-04 00:07:18 +0000 | [diff] [blame] | 20 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 21 | * Boston, MA 02110-1301, USA. |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 22 | */ |
| 23 | |
| 24 | #ifndef __GST_V4L2_COLOR_BALANCE_H__ |
| 25 | #define __GST_V4L2_COLOR_BALANCE_H__ |
| 26 | |
| 27 | #include <gst/gst.h> |
Wim Taymans | 7104911 | 2011-11-29 19:10:58 +0100 | [diff] [blame] | 28 | #include <gst/video/colorbalance.h> |
Nicolas Dufresne | bec0385 | 2017-07-12 20:49:47 -0400 | [diff] [blame] | 29 | |
| 30 | #include "gstv4l2object.h" |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 31 | |
| 32 | G_BEGIN_DECLS |
Johan Dahlin | 5acffea | 2004-03-15 16:32:54 +0000 | [diff] [blame] | 33 | |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 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, \ |
Wim Taymans | 5580571 | 2009-09-09 10:27:55 +0200 | [diff] [blame] | 38 | GstV4l2ColorBalanceChannel)) |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 39 | #define GST_V4L2_COLOR_BALANCE_CHANNEL_CLASS(klass) \ |
| 40 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL, \ |
Wim Taymans | 5580571 | 2009-09-09 10:27:55 +0200 | [diff] [blame] | 41 | GstV4l2ColorBalanceChannelClass)) |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 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)) |
Johan Dahlin | 5acffea | 2004-03-15 16:32:54 +0000 | [diff] [blame] | 46 | |
| 47 | typedef struct _GstV4l2ColorBalanceChannel { |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 48 | GstColorBalanceChannel parent; |
| 49 | |
Edgard Lima | 51b1537 | 2006-03-25 05:31:28 +0000 | [diff] [blame] | 50 | guint32 id; |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 51 | } GstV4l2ColorBalanceChannel; |
| 52 | |
Johan Dahlin | 5acffea | 2004-03-15 16:32:54 +0000 | [diff] [blame] | 53 | typedef struct _GstV4l2ColorBalanceChannelClass { |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 54 | GstColorBalanceChannelClass parent; |
| 55 | } GstV4l2ColorBalanceChannelClass; |
| 56 | |
Wim Taymans | 5580571 | 2009-09-09 10:27:55 +0200 | [diff] [blame] | 57 | GType gst_v4l2_color_balance_channel_get_type (void); |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 58 | |
Wim Taymans | 5580571 | 2009-09-09 10:27:55 +0200 | [diff] [blame] | 59 | const GList * gst_v4l2_color_balance_list_channels (GstV4l2Object * v4l2object); |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 60 | |
Wim Taymans | 5580571 | 2009-09-09 10:27:55 +0200 | [diff] [blame] | 61 | void gst_v4l2_color_balance_set_value (GstV4l2Object * v4l2object, |
| 62 | GstColorBalanceChannel * channel, |
| 63 | gint value); |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 64 | |
Wim Taymans | 5580571 | 2009-09-09 10:27:55 +0200 | [diff] [blame] | 65 | gint gst_v4l2_color_balance_get_value (GstV4l2Object * v4l2object, |
| 66 | GstColorBalanceChannel * channel); |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 67 | |
| 68 | #define GST_IMPLEMENT_V4L2_COLOR_BALANCE_METHODS(Type, interface_as_function) \ |
| 69 | \ |
| 70 | static const GList * \ |
| 71 | interface_as_function ## _color_balance_list_channels (GstColorBalance * balance) \ |
| 72 | { \ |
| 73 | Type *this = (Type*) balance; \ |
| 74 | return gst_v4l2_color_balance_list_channels(this->v4l2object); \ |
| 75 | } \ |
| 76 | \ |
| 77 | static void \ |
| 78 | interface_as_function ## _color_balance_set_value (GstColorBalance * balance, \ |
| 79 | GstColorBalanceChannel * channel, \ |
| 80 | gint value) \ |
| 81 | { \ |
| 82 | Type *this = (Type*) balance; \ |
Brian Cameron | a973a4f | 2008-01-21 19:35:58 +0000 | [diff] [blame] | 83 | gst_v4l2_color_balance_set_value(this->v4l2object, channel, value); \ |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 84 | } \ |
| 85 | \ |
| 86 | static gint \ |
| 87 | interface_as_function ## _color_balance_get_value (GstColorBalance * balance, \ |
| 88 | GstColorBalanceChannel * channel) \ |
| 89 | { \ |
| 90 | Type *this = (Type*) balance; \ |
| 91 | return gst_v4l2_color_balance_get_value(this->v4l2object, channel); \ |
| 92 | } \ |
| 93 | \ |
Sebastian Dröge | 3299f39 | 2012-03-02 10:13:08 +0100 | [diff] [blame] | 94 | static GstColorBalanceType \ |
| 95 | interface_as_function ## _color_balance_get_balance_type (GstColorBalance * balance) \ |
| 96 | { \ |
| 97 | return GST_COLOR_BALANCE_HARDWARE; \ |
| 98 | } \ |
| 99 | \ |
Benjamin Otte | 3342b16 | 2010-03-17 18:23:00 +0100 | [diff] [blame] | 100 | static void \ |
Stefan Sauer | 2468492 | 2011-10-21 14:51:23 +0200 | [diff] [blame] | 101 | interface_as_function ## _color_balance_interface_init (GstColorBalanceInterface * iface) \ |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 102 | { \ |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 103 | /* default virtual functions */ \ |
Stefan Sauer | 2468492 | 2011-10-21 14:51:23 +0200 | [diff] [blame] | 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; \ |
Sebastian Dröge | 3299f39 | 2012-03-02 10:13:08 +0100 | [diff] [blame] | 107 | iface->get_balance_type = interface_as_function ## _color_balance_get_balance_type; \ |
Edgard Lima | 9edc0c0 | 2006-05-11 17:59:59 +0000 | [diff] [blame] | 108 | } \ |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 109 | |
Michael Jones | fa95cec | 2012-05-31 10:15:43 +0200 | [diff] [blame] | 110 | G_END_DECLS |
Ronald S. Bultje | 862d28a | 2003-10-10 12:47:42 +0000 | [diff] [blame] | 111 | #endif /* __GST_V4L2_COLOR_BALANCE_H__ */ |