4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
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)
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.
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
24 #ifndef __GST_CAMERASRC_CONTROL_H__
25 #define __GST_CAMERASRC_CONTROL_H__
28 #include <gst/interfaces/cameracontrol.h>
29 #include "gstcamerasrc.h"
33 #define GST_TYPE_CAMERASRC_CONTROL_CHANNEL (gst_camerasrc_control_channel_get_type ())
34 #define GST_CAMERASRC_CONTROL_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CAMERASRC_CONTROL_CHANNEL, GstCamerasrcControlChannel))
35 #define GST_CAMERASRC_CONTROL_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CAMERASRC_CONTROL_CHANNEL, GstCamerasrcControlChannelClass))
36 #define GST_IS_CAMERASRC_CONTROL_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CAMERASRC_CONTROL_CHANNEL))
37 #define GST_IS_CAMERASRC_CONTROL_CHANNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CAMERASRC_CONTROL_CHANNEL))
39 typedef struct _GstCamerasrcControlChannel {
40 GstCameraControlChannel parent;
42 } GstCamerasrcControlChannel;
44 typedef struct _GstCamerasrcControlChannelClass {
45 GstCameraControlChannelClass parent;
46 } GstCamerasrcControlChannelClass;
48 GType gst_camerasrc_control_channel_get_type( void );
50 const GList*gst_camerasrc_control_list_channels( GstCameraSrc* camera_src );
52 gboolean gst_camerasrc_control_set_value ( GstCameraSrc* camera_src, GstCameraControlChannel* control_channel, gint value );
53 gboolean gst_camerasrc_control_get_value ( GstCameraSrc* camera_src, GstCameraControlChannel* control_channel, gint* value );
54 gboolean gst_camerasrc_control_set_exposure ( GstCameraSrc* camera_src, gint type, gint value1, gint value2 );
55 gboolean gst_camerasrc_control_get_exposure ( GstCameraSrc* camera_src, gint type, gint* value1, gint* value2 );
56 gboolean gst_camerasrc_control_set_capture_mode ( GstCameraSrc* camera_src, gint type, gint value );
57 gboolean gst_camerasrc_control_get_capture_mode ( GstCameraSrc* camera_src, gint type, gint* value );
58 gboolean gst_camerasrc_control_set_strobe ( GstCameraSrc* camera_src, gint type, gint value );
59 gboolean gst_camerasrc_control_get_strobe ( GstCameraSrc* camera_src, gint type, gint *value );
60 gboolean gst_camerasrc_control_set_detect ( GstCameraSrc* camera_src, gint type, gint value );
61 gboolean gst_camerasrc_control_get_detect ( GstCameraSrc* camera_src, gint type, gint* value );
62 gboolean gst_camerasrc_control_set_zoom ( GstCameraSrc* camera_src, gint type, gint value );
63 gboolean gst_camerasrc_control_get_zoom ( GstCameraSrc* camera_src, gint type, gint* value );
64 gboolean gst_camerasrc_control_set_focus ( GstCameraSrc* camera_src, gint mode, gint range );
65 gboolean gst_camerasrc_control_get_focus ( GstCameraSrc* camera_src, gint* mode, gint* range );
66 gboolean gst_camerasrc_control_start_auto_focus ( GstCameraSrc* camera_src );
67 gboolean gst_camerasrc_control_stop_auto_focus ( GstCameraSrc* camera_src );
68 gboolean gst_camerasrc_control_set_focus_level ( GstCameraSrc* camera_src, gint manual_level );
69 gboolean gst_camerasrc_control_get_focus_level ( GstCameraSrc* camera_src, gint* manual_level );
70 gboolean gst_camerasrc_control_set_auto_focus_area( GstCameraSrc* camera_src, GstCameraControlRectType rect );
71 gboolean gst_camerasrc_control_get_auto_focus_area( GstCameraSrc* camera_src, GstCameraControlRectType* rect );
72 gboolean gst_camerasrc_control_set_wdr ( GstCameraSrc* camera_src, gint value );
73 gboolean gst_camerasrc_control_get_wdr ( GstCameraSrc* camera_src, gint* value );
74 gboolean gst_camerasrc_control_set_ahs ( GstCameraSrc* camera_src, gint value );
75 gboolean gst_camerasrc_control_get_ahs ( GstCameraSrc* camera_src, gint* value );
76 gboolean gst_camerasrc_control_set_part_color ( GstCameraSrc* camera_src, gint type, gint value );
77 gboolean gst_camerasrc_control_get_part_color ( GstCameraSrc* camera_src, gint type, gint* value );
78 gboolean gst_camerasrc_control_get_exif_info ( GstCameraSrc* camera_src, GstCameraControlExifInfo* info );
79 gboolean gst_camerasrc_control_get_basic_dev_info ( GstCameraSrc* camera_src, gint dev_id, GstCameraControlCapsInfoType* info );
80 gboolean gst_camerasrc_control_get_misc_dev_info ( GstCameraSrc* camera_src, gint dev_id, GstCameraControlCtrlListInfoType* info );
81 gboolean gst_camerasrc_control_get_extra_dev_info ( GstCameraSrc* camera_src, gint dev_id, GstCameraControlExtraInfoType* info );
82 void gst_camerasrc_control_set_capture_command( GstCameraSrc* camera_src, GstCameraControlCaptureCommand cmd );
84 #define GST_IMPLEMENT_CAMERASRC_CONTROL_METHODS(Type, interface_as_function) \
87 interface_as_function ## _control_list_channels( GstCameraControl* control ) \
89 Type* this = (Type*) control; \
90 return gst_camerasrc_control_list_channels( this ); \
94 interface_as_function ## _control_set_value( GstCameraControl* control, \
95 GstCameraControlChannel* control_channel, gint value ) \
97 Type* this = (Type*)control; \
98 return gst_camerasrc_control_set_value( this, control_channel, value ); \
102 interface_as_function ## _control_get_value( GstCameraControl* control, \
103 GstCameraControlChannel* control_channel, gint* value ) \
105 Type* this = (Type*)control; \
106 return gst_camerasrc_control_get_value( this, control_channel, value ); \
110 interface_as_function ## _control_set_exposure( GstCameraControl* control, \
111 gint type, gint value1, gint value2 ) \
113 Type* this = (Type*)control; \
114 return gst_camerasrc_control_set_exposure( this, type, value1, value2 ); \
118 interface_as_function ## _control_get_exposure( GstCameraControl* control, \
119 gint type, gint* value1, gint* value2 ) \
121 Type* this = (Type*)control; \
122 return gst_camerasrc_control_get_exposure( this, type, value1, value2 ); \
126 interface_as_function ## _control_set_capture_mode( GstCameraControl* control, \
127 gint type, gint value ) \
129 Type* this = (Type*)control; \
130 return gst_camerasrc_control_set_capture_mode( this, type, value ); \
134 interface_as_function ## _control_get_capture_mode( GstCameraControl* control, \
135 gint type, gint* value ) \
137 Type* this = (Type*)control; \
138 return gst_camerasrc_control_get_capture_mode( this, type, value ); \
142 interface_as_function ## _control_set_strobe( GstCameraControl* control, \
143 gint type, gint value ) \
145 Type* this = (Type*)control; \
146 return gst_camerasrc_control_set_strobe( this, type, value ); \
150 interface_as_function ## _control_get_strobe( GstCameraControl* control, \
151 gint type, gint* value ) \
153 Type* this = (Type*)control; \
154 return gst_camerasrc_control_get_strobe( this, type, value ); \
158 interface_as_function ## _control_set_detect( GstCameraControl* control, \
159 gint type, gint value ) \
161 Type* this = (Type*)control; \
162 return gst_camerasrc_control_set_detect( this, type, value ); \
166 interface_as_function ## _control_get_detect( GstCameraControl* control, \
167 gint type, gint* value ) \
169 Type* this = (Type*)control; \
170 return gst_camerasrc_control_get_detect( this, type, value ); \
174 interface_as_function ## _control_set_zoom( GstCameraControl* control, \
175 gint type, gint value ) \
177 Type* this = (Type*)control; \
178 return gst_camerasrc_control_set_zoom( this, type, value ); \
182 interface_as_function ## _control_get_zoom( GstCameraControl* control, \
183 gint type, gint* value ) \
185 Type* this = (Type*)control; \
186 return gst_camerasrc_control_get_zoom( this, type, value ); \
190 interface_as_function ## _control_set_focus( GstCameraControl* control, \
191 gint focus_mode, gint focus_range ) \
193 Type* this = (Type*)control; \
194 return gst_camerasrc_control_set_focus( this, focus_mode, focus_range ); \
198 interface_as_function ## _control_get_focus( GstCameraControl* control, \
199 gint* focus_mode, gint* focus_range ) \
201 Type* this = (Type*)control; \
202 return gst_camerasrc_control_get_focus( this, focus_mode, focus_range ); \
206 interface_as_function ## _control_start_auto_focus( GstCameraControl* control) \
208 Type* this = (Type*)control; \
209 return gst_camerasrc_control_start_auto_focus( this ); \
213 interface_as_function ## _control_stop_auto_focus( GstCameraControl* control) \
215 Type* this = (Type*)control; \
216 return gst_camerasrc_control_stop_auto_focus( this ); \
220 interface_as_function ## _control_set_focus_level( GstCameraControl* control, \
223 Type* this = (Type*)control; \
224 return gst_camerasrc_control_set_focus_level( this, focus_level ); \
228 interface_as_function ## _control_get_focus_level( GstCameraControl* control, \
229 gint* focus_level ) \
231 Type* this = (Type*)control; \
232 return gst_camerasrc_control_get_focus_level( this, focus_level ); \
236 interface_as_function ## _control_set_auto_focus_area( GstCameraControl* control, \
237 GstCameraControlRectType rect ) \
239 Type* this = (Type*)control; \
240 return gst_camerasrc_control_set_auto_focus_area( this, rect ); \
244 interface_as_function ## _control_get_auto_focus_area( GstCameraControl* control, \
245 GstCameraControlRectType* rect ) \
247 Type* this = (Type*)control; \
248 return gst_camerasrc_control_get_auto_focus_area( this, rect ); \
252 interface_as_function ## _control_set_wdr( GstCameraControl* control, \
255 Type* this = (Type*)control; \
256 return gst_camerasrc_control_set_wdr( this, value ); \
260 interface_as_function ## _control_get_wdr( GstCameraControl* control, \
263 Type* this = (Type*)control; \
264 return gst_camerasrc_control_get_wdr( this, value ); \
268 interface_as_function ## _control_set_ahs( GstCameraControl* control, \
271 Type* this = (Type*)control; \
272 return gst_camerasrc_control_set_ahs( this, value ); \
276 interface_as_function ## _control_get_ahs( GstCameraControl* control, \
279 Type* this = (Type*)control; \
280 return gst_camerasrc_control_get_ahs( this, value ); \
284 interface_as_function ## _control_set_part_color( GstCameraControl* control, \
285 gint type, gint value ) \
287 Type* this = (Type*)control; \
288 return gst_camerasrc_control_set_part_color( this, type, value ); \
292 interface_as_function ## _control_get_part_color( GstCameraControl* control, \
293 gint type, gint* value ) \
295 Type* this = (Type*)control; \
296 return gst_camerasrc_control_get_part_color( this, type, value ); \
300 interface_as_function ## _control_get_exif_info( GstCameraControl* control, \
301 GstCameraControlExifInfo* info ) \
303 Type* this = (Type*)control; \
304 return gst_camerasrc_control_get_exif_info( this, info); \
308 interface_as_function ## _control_get_basic_dev_info( GstCameraControl* control, \
310 GstCameraControlCapsInfoType* info ) \
312 Type* this = (Type*)control; \
313 return gst_camerasrc_control_get_basic_dev_info( this, dev_id, info); \
317 interface_as_function ## _control_get_misc_dev_info( GstCameraControl* control, \
319 GstCameraControlCtrlListInfoType* info ) \
321 Type* this = (Type*)control; \
322 return gst_camerasrc_control_get_misc_dev_info( this, dev_id, info); \
326 interface_as_function ## _control_get_extra_dev_info( GstCameraControl* control, \
328 GstCameraControlExtraInfoType* info ) \
330 Type* this = (Type*)control; \
331 return gst_camerasrc_control_get_extra_dev_info( this, dev_id, info); \
335 interface_as_function ## _control_set_capture_command( GstCameraControl* control, \
336 GstCameraControlCaptureCommand cmd ) \
338 Type* this = (Type*)control; \
339 gst_camerasrc_control_set_capture_command( this, cmd ); \
344 interface_as_function ## _control_interface_init( GstCameraControlClass *klass ) \
346 GST_CAMERA_CONTROL_TYPE( klass ) = GST_CAMERA_CONTROL_HARDWARE; \
348 /* default virtual functions */ \
349 klass->list_channels = interface_as_function ## _control_list_channels; \
350 klass->set_value = interface_as_function ## _control_set_value; \
351 klass->get_value = interface_as_function ## _control_get_value; \
352 klass->set_exposure = interface_as_function ## _control_set_exposure; \
353 klass->get_exposure = interface_as_function ## _control_get_exposure; \
354 klass->set_capture_mode = interface_as_function ## _control_set_capture_mode; \
355 klass->get_capture_mode = interface_as_function ## _control_get_capture_mode; \
356 klass->set_strobe = interface_as_function ## _control_set_strobe; \
357 klass->get_strobe = interface_as_function ## _control_get_strobe; \
358 klass->set_detect = interface_as_function ## _control_set_detect; \
359 klass->get_detect = interface_as_function ## _control_get_detect; \
360 klass->set_zoom = interface_as_function ## _control_set_zoom; \
361 klass->get_zoom = interface_as_function ## _control_get_zoom; \
362 klass->set_focus = interface_as_function ## _control_set_focus; \
363 klass->get_focus = interface_as_function ## _control_get_focus; \
364 klass->start_auto_focus = interface_as_function ## _control_start_auto_focus; \
365 klass->stop_auto_focus = interface_as_function ## _control_stop_auto_focus; \
366 klass->set_focus_level = interface_as_function ## _control_set_focus_level; \
367 klass->get_focus_level = interface_as_function ## _control_get_focus_level; \
368 klass->set_auto_focus_area = interface_as_function ## _control_set_auto_focus_area; \
369 klass->get_auto_focus_area = interface_as_function ## _control_get_auto_focus_area; \
370 klass->set_wdr = interface_as_function ## _control_set_wdr; \
371 klass->get_wdr = interface_as_function ## _control_get_wdr; \
372 klass->set_ahs = interface_as_function ## _control_set_ahs; \
373 klass->get_ahs = interface_as_function ## _control_get_ahs; \
374 klass->set_part_color = interface_as_function ## _control_set_part_color; \
375 klass->get_part_color = interface_as_function ## _control_get_part_color; \
376 klass->get_exif_info = interface_as_function ## _control_get_exif_info; \
377 klass->get_basic_dev_info = interface_as_function ## _control_get_basic_dev_info; \
378 klass->get_misc_dev_info = interface_as_function ## _control_get_misc_dev_info; \
379 klass->get_extra_dev_info = interface_as_function ## _control_get_extra_dev_info; \
380 klass->set_capture_command = interface_as_function ## _control_set_capture_command; \
384 #endif /* __GST_CAMERASRC_CONTROL_H__ */