| 9297681 by Alexander Bokovoy at 2009-10-06 |
1 |
/* |
|
2 |
* This file is part of GDigicam |
|
3 |
* |
|
4 |
* Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
5 |
* |
|
6 |
* Contact: Alexander Bokovoy <alexander.bokovoy@nokia.com> |
|
7 |
* |
|
8 |
* This library is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU Lesser General Public License |
|
10 |
* version 2.1 as published by the Free Software Foundation. |
|
11 |
* |
|
12 |
* This library is distributed in the hope that it will be useful, but |
|
13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
* Lesser General Public License for more details. |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU Lesser General Public |
|
18 |
* License along with this library; if not, write to the Free Software |
|
19 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
|
20 |
* 02110-1301 USA |
|
21 |
* |
|
22 |
*/ |
|
23 |
|
|
24 |
#ifndef __GDIGICAM_CAMERABIN_H__ |
|
25 |
#define __GDIGICAM_CAMERABIN_H__ |
|
26 |
|
|
27 |
#include <gst/gst.h> |
|
28 |
#include <glib-object.h> |
|
29 |
|
|
30 |
#include "gdigicam-manager.h" |
|
31 |
|
|
32 |
#ifdef __cplusplus |
|
33 |
extern "C" { |
|
34 |
#endif |
|
35 |
|
|
36 |
G_BEGIN_DECLS |
|
37 |
|
|
38 |
|
|
39 |
/** |
|
40 |
* GDigicamCamerabinMetadata: |
|
41 |
* @model: Device model. |
|
42 |
* @make: Device maker. |
|
43 |
* @author: Content author. |
|
44 |
* @unique_id: Unique id for a device composed of device wlan mac. |
|
45 |
* @country_name: Country name given the current geolocation |
|
46 |
* coordinates. |
|
47 |
* @city_name: Town/city name given the current geolocation |
|
48 |
* coordinates. |
|
49 |
* @suburb_name: Suburb name given the current geolocation |
|
50 |
* coordinates. |
|
51 |
* @longitude: Geolocation's longitude parameter. |
|
52 |
* @latitude: Geolocation's latitude parameter. |
|
53 |
* @altitude: Geolocation's altitude parameter. |
|
54 |
* @orientation: Content orientation. |
|
55 |
* |
|
56 |
* Data structure with metadata information to be used during the |
|
57 |
* capture operation. |
|
58 |
*/ |
|
59 |
typedef struct { |
|
60 |
gchar *model; |
|
61 |
gchar *make; |
|
62 |
gchar *author; |
|
63 |
gchar *unique_id; |
|
64 |
gchar *country_name; |
|
65 |
gchar *city_name; |
|
66 |
gchar *suburb_name; |
|
67 |
gdouble longitude; |
|
68 |
gdouble latitude; |
|
69 |
gdouble altitude; |
|
70 |
guint orientation; |
|
71 |
} GDigicamCamerabinMetadata; |
|
72 |
|
|
73 |
/*****************************************/ |
|
74 |
/* Public "CAMERABIN" operation helpers */ |
|
75 |
/*****************************************/ |
|
76 |
|
|
77 |
/** |
|
78 |
* GDigicamCamerabinModeHelper: |
|
79 |
* @mode: A #GDigicamMode indicating the camera mode; still |
|
80 |
* picture or video. |
|
81 |
* |
|
82 |
* Data structure with helper data to be used during "set_mode" |
|
83 |
* operation for 'camerabin'. |
|
84 |
*/ |
|
85 |
typedef struct { |
|
86 |
GDigicamMode mode; |
|
87 |
} GDigicamCamerabinModeHelper; |
|
88 |
|
|
89 |
/** |
|
90 |
* GDigicamCamerabinFlashModeHelper: |
|
91 |
* @flash_mode: A #GDigicamFlashmode indicating the flash mode. |
|
92 |
* |
|
93 |
* Data structure with helper data to be used during "set_flash_mode" |
|
94 |
* operation for 'camerabin'. |
|
95 |
*/ |
|
96 |
typedef struct { |
|
97 |
GDigicamFlashmode flash_mode; |
|
98 |
} GDigicamCamerabinFlashModeHelper; |
|
99 |
|
|
100 |
/** |
|
101 |
* GDigicamCamerabinFocusModeHelper: |
|
102 |
* @focus_mode: A #GDigicamFocusmode indicating the focus mode. |
|
103 |
* @macro_enabled: Wether macro mode is enabled or not. |
|
104 |
* |
|
105 |
* Data structure with helper data to be used during "set_focus_mode" |
|
106 |
* operation for 'camerabin'. |
|
107 |
*/ |
|
108 |
typedef struct { |
|
109 |
GDigicamFocusmode focus_mode; |
|
110 |
gboolean macro_enabled; |
|
111 |
} GDigicamCamerabinFocusModeHelper; |
|
112 |
|
|
113 |
/** |
|
114 |
* GDigicamCamerabinFocusRegionPatternHelper: |
|
115 |
* @focus_points: A #GDigicamFocuspoints indicating the focus points |
|
116 |
* array shape. |
|
117 |
* @active_points: The active points in the focus points array. |
|
118 |
* |
|
119 |
* Data structure with helper data and functions to be used |
|
120 |
* during "set_focus_region_pattern" operation for 'camerabin'. |
|
121 |
*/ |
|
122 |
typedef struct { |
|
123 |
GDigicamFocuspoints focus_points; |
|
124 |
guint64 active_points; |
|
125 |
} GDigicamCamerabinFocusRegionPatternHelper; |
|
126 |
|
|
127 |
/** |
|
128 |
* GDigicamCamerabinExposureModeHelper: |
|
129 |
* @exposure_mode: A #GDigicamExposuremode indicating the exposure |
|
130 |
* mode. |
|
131 |
* |
|
132 |
* Data structure with helper data to be used during |
|
133 |
* "set_exposure_mode" operation for 'camerabin'. |
|
134 |
*/ |
|
135 |
typedef struct { |
|
136 |
GDigicamExposuremode exposure_mode; |
|
137 |
} GDigicamCamerabinExposureModeHelper; |
|
138 |
|
|
139 |
/** |
|
140 |
* GDigicamCamerabinExposureCompHelper: |
|
141 |
* @exposure_comp: The exposure compenastion level. |
|
142 |
* |
|
143 |
* Data structure with helper data to be used during |
|
144 |
* "set_exposure_comp" operation for 'camerabin'. |
|
145 |
*/ |
|
146 |
typedef struct { |
|
147 |
gdouble exposure_comp; |
|
148 |
} GDigicamCamerabinExposureCompHelper; |
|
149 |
|
|
150 |
/** |
|
151 |
* GDigicamCamerabinIsoSensitivityHelper |
|
152 |
* @iso_sensitivity_mode: A #GDigicamIsosensitivitymode indicating the |
|
153 |
* ISO mode. |
|
154 |
* @iso_value: The ISO level in case of auto mode. |
|
155 |
* |
|
156 |
* Data structure with helper data to be used during |
|
157 |
* "set_iso_sensitivity_mode" operation for 'camerabin'. |
|
158 |
*/ |
|
159 |
typedef struct { |
|
160 |
GDigicamIsosensitivitymode iso_sensitivity_mode; |
|
161 |
guint iso_value; |
|
162 |
} GDigicamCamerabinIsoSensitivityHelper; |
|
163 |
|
|
164 |
/** |
|
165 |
* GDigicamCamerabinWhitebalanceModeHelper: |
|
166 |
* @wb_mode: A #GDigicamWhitebalanceMode indicating the white balance |
|
167 |
* mode. |
|
168 |
* |
|
169 |
* Data structure with helper data and functions to be used during |
|
170 |
* "set_white_balance_mode" operation for 'camerabin'. |
|
171 |
*/ |
|
172 |
typedef struct { |
|
173 |
GDigicamWhitebalancemode wb_mode; |
|
174 |
} GDigicamCamerabinWhitebalanceModeHelper; |
|
175 |
|
|
176 |
/** |
|
177 |
* GDigicamCamerabinQualityHelper: |
|
178 |
* @quality: A #GDigicamQuality indicating the quality level. |
|
179 |
* |
|
180 |
* Data structure with helper data to be used during "set_quality" |
|
181 |
* operation for 'camerabin'. |
|
182 |
*/ |
|
183 |
typedef struct { |
|
184 |
GDigicamQuality quality; |
|
185 |
} GDigicamCamerabinQualityHelper; |
|
186 |
|
|
187 |
/** |
|
188 |
* GDigicamCamerabinAspectRatioResolutionHelper: |
|
189 |
* @aspect_ratio: A #GDigicamAspectratio indicating the aspect_ratio. |
|
190 |
* @resolution: A #GDigicamResolution indicating the resolution. |
|
191 |
* @preview_mode: A #GDigicamPreview indicating the preview mode. |
|
192 |
* |
|
193 |
* Data structure with helper data to be used during |
|
194 |
* "set_aspect_ratio" and "set_resolution" operation for 'camerabin'. |
|
195 |
*/ |
|
196 |
typedef struct { |
|
197 |
GDigicamAspectratio aspect_ratio; |
|
198 |
GDigicamResolution resolution; |
|
199 |
GDigicamPreview preview_mode; |
|
200 |
} GDigicamCamerabinAspectRatioResolutionHelper; |
|
201 |
|
|
202 |
/** |
|
203 |
* GDigicamCamerabinLocksHelper: |
|
204 |
* @locks: A #GDigicamLock indicating the locks. |
|
205 |
* |
|
206 |
* Data structure with helper data to be used during "set_locks" |
|
207 |
* operation for 'camerabin'. |
|
208 |
*/ |
|
209 |
typedef struct { |
|
210 |
GDigicamLock locks; |
|
211 |
} GDigicamCamerabinLocksHelper; |
|
212 |
|
|
213 |
/** |
|
214 |
* GDigicamCamerabinZoomHelper: |
|
215 |
* @value: The zoom value. |
|
216 |
* |
|
217 |
* Data structure with helper data to be used during "set_zoom" |
|
218 |
* operation for 'camerabin'. |
|
219 |
*/ |
|
220 |
typedef struct { |
|
221 |
gdouble value; |
|
222 |
} GDigicamCamerabinZoomHelper; |
|
223 |
|
|
224 |
/** |
|
225 |
* GDigicamCamerabinPictureHelper: |
|
226 |
* @file_path: Filename in which store the taken picture. |
|
227 |
* @metadata: A #GDigicamCamerabinMetadata with the metadata |
|
228 |
* information to add to the taken picture. |
|
229 |
* |
|
230 |
* Data structure with helper data and functions to be used |
|
231 |
* during "set_focus_region_pattern" operation for 'camerabin'. |
|
232 |
*/ |
|
233 |
typedef struct { |
|
234 |
const gchar *file_path; |
|
235 |
GDigicamCamerabinMetadata *metadata; |
|
236 |
} GDigicamCamerabinPictureHelper; |
|
237 |
|
|
238 |
/** |
|
239 |
* GDigicamCamerabinVideoHelper: |
|
240 |
* @file_path: Filename in which store the recorded video. |
|
241 |
* @metadata: A #GDigicamCamerabinMetadata with the metadata |
|
242 |
* information to add to the recorded video. |
|
243 |
* @resume: If used in pause/resume function, wether it is pause or |
|
244 |
* resume. |
|
245 |
* @audio: A #GDigicamAudio indicating the audio mode. |
|
246 |
* |
|
247 |
* Data structure with helper data and functions to be used |
|
248 |
* during "start/pause/stop_recording_video" operation for 'camerabin'. |
|
249 |
*/ |
|
250 |
typedef struct { |
|
251 |
const gchar *file_path; |
|
252 |
GDigicamCamerabinMetadata *metadata; |
|
253 |
gboolean resume; |
|
254 |
GDigicamAudio audio; |
|
255 |
} GDigicamCamerabinVideoHelper; |
|
256 |
|
|
257 |
/** |
|
258 |
* GDigicamCamerabinPreviewHelper: |
|
259 |
* @mode: A #GDigicamPreview indicating the preview mode. |
|
260 |
* |
|
261 |
* Data structure with helper data and functions to be used during the |
|
262 |
* preview related operations for 'camerabin'. |
|
263 |
*/ |
|
264 |
typedef struct { |
|
265 |
GDigicamPreview mode; |
|
266 |
} GDigicamCamerabinPreviewHelper; |
|
267 |
|
|
268 |
/********************/ |
|
269 |
/* Public functions */ |
|
270 |
/********************/ |
|
271 |
|
|
272 |
GDigicamDescriptor *g_digicam_camerabin_descriptor_new (const GstElement *gst_camera_bin); |
|
273 |
GstElement *g_digicam_camerabin_element_new (const gchar *videosrc, |
|
274 |
const gchar *videoenc, |
|
275 |
const gchar *videomux, |
|
276 |
const gchar *audiosrc, |
|
277 |
const gchar *audioenc, |
|
278 |
const gchar *imageenc, |
|
279 |
const gchar *imagepp, |
|
280 |
const gchar *ximagesink, |
|
281 |
gint *colorkey); |
|
282 |
|
|
283 |
G_END_DECLS |
|
284 |
|
|
285 |
#ifdef __cplusplus |
|
286 |
} /* extern "C" */ |
|
287 |
#endif |
|
288 |
|
|
289 |
#endif /* __GDIGICAM_CAMERABIN_H__ */ |