3
* Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4
* 2006 Edgard Lima <edgard.lima@indt.org.br>
6
* gstv4l2colorbalance.c: 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., 59 Temple Place - Suite 330,
21
* Boston, MA 02111-1307, USA.
29
#include "gstv4l2colorbalance.h"
30
#include "gstv4l2object.h"
32
GST_BOILERPLATE (GstV4l2ColorBalanceChannel,
33
gst_v4l2_color_balance_channel,
34
GstColorBalanceChannel, GST_TYPE_COLOR_BALANCE_CHANNEL);
37
gst_v4l2_color_balance_channel_base_init (gpointer g_class)
42
gst_v4l2_color_balance_channel_class_init (GstV4l2ColorBalanceChannelClass *
48
gst_v4l2_color_balance_channel_init (GstV4l2ColorBalanceChannel * channel,
49
GstV4l2ColorBalanceChannelClass * klass)
51
channel->id = (guint32) - 1;
54
static G_GNUC_UNUSED gboolean
55
gst_v4l2_color_balance_contains_channel (GstV4l2Object * v4l2object,
56
GstV4l2ColorBalanceChannel * v4l2channel)
60
for (item = v4l2object->colors; item != NULL; item = item->next)
61
if (item->data == v4l2channel)
68
gst_v4l2_color_balance_list_channels (GstV4l2Object * v4l2object)
70
return v4l2object->colors;
74
gst_v4l2_color_balance_set_value (GstV4l2Object * v4l2object,
75
GstColorBalanceChannel * channel, gint value)
78
GstV4l2ColorBalanceChannel *v4l2channel =
79
GST_V4L2_COLOR_BALANCE_CHANNEL (channel);
81
/* assert that we're opened and that we're using a known item */
82
g_return_if_fail (GST_V4L2_IS_OPEN (v4l2object));
83
g_return_if_fail (gst_v4l2_color_balance_contains_channel (v4l2object,
86
gst_v4l2_set_attribute (v4l2object, v4l2channel->id, value);
90
gst_v4l2_color_balance_get_value (GstV4l2Object * v4l2object,
91
GstColorBalanceChannel * channel)
93
GstV4l2ColorBalanceChannel *v4l2channel =
94
GST_V4L2_COLOR_BALANCE_CHANNEL (channel);
97
/* assert that we're opened and that we're using a known item */
98
g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2object), 0);
99
g_return_val_if_fail (gst_v4l2_color_balance_contains_channel (v4l2object,
102
if (!gst_v4l2_get_attribute (v4l2object, v4l2channel->id, &value))