4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_CAMCORDER_INTERNAL_H__
23 #define __MM_CAMCORDER_INTERNAL_H__
25 /*=======================================================================================
27 ========================================================================================*/
32 #include <semaphore.h>
36 #include <mm_attrs_private.h>
37 #include <mm_message.h>
41 #include <gst/video/video-format.h>
43 #include "mm_camcorder.h"
46 /* camcorder sub module */
47 #include "mm_camcorder_attribute.h"
48 #include "mm_camcorder_platform.h"
49 #include "mm_camcorder_stillshot.h"
50 #include "mm_camcorder_videorec.h"
51 #include "mm_camcorder_audiorec.h"
52 #include "mm_camcorder_gstcommon.h"
53 #include "mm_camcorder_exifinfo.h"
54 #include "mm_camcorder_util.h"
55 #include "mm_camcorder_configure.h"
56 #include "mm_camcorder_sound.h"
62 /*=======================================================================================
64 ========================================================================================*/
65 #define _mmcam_dbg_verb(fmt, args...) mmf_debug(MMF_DEBUG_VERBOSE,"[%05d][%s]: " fmt "\n", __LINE__, __func__, ##args);
66 #define _mmcam_dbg_log(fmt, args...) mmf_debug(MMF_DEBUG_LOG,"[%05d][%s]: " fmt "\n", __LINE__, __func__, ##args);
67 #define _mmcam_dbg_warn(fmt, args...) mmf_debug(MMF_DEBUG_WARNING,"[%05d][%s]: " fmt "\n", __LINE__, __func__, ##args);
68 #define _mmcam_dbg_err(fmt, args...) mmf_debug(MMF_DEBUG_ERROR,"[%05d][%s]: " fmt "\n", __LINE__, __func__, ##args);
69 #define _mmcam_dbg_crit(fmt, args...) mmf_debug(MMF_DEBUG_CRITICAL,"[%05d][%s]: " fmt "\n", __LINE__, __func__, ##args);
72 * Macro for checking validity and debugging
74 #define mmf_return_if_fail( expr ) \
78 _mmcam_dbg_err( "failed [%s]", #expr); \
83 * Macro for checking validity and debugging
85 #define mmf_return_val_if_fail( expr, val ) \
89 _mmcam_dbg_err("failed [%s]", #expr); \
95 * Macro for getting array size
97 #define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
100 /* gstreamer element creation macro */
101 #define _MMCAMCORDER_PIPELINE_MAKE(sub_context, eid, name /*char* */, err) \
102 if (sub_context->element[eid].gst != NULL) { \
103 _mmcam_dbg_err("The element(Pipeline) is existed. element_id=[%d], name=[%s]", eid, name); \
104 gst_object_unref(sub_context->element[eid].gst); \
106 sub_context->element[eid].id = eid; \
107 sub_context->element[eid].gst = gst_pipeline_new(name); \
108 if (sub_context->element[eid].gst == NULL) { \
109 _mmcam_dbg_err("Pipeline creation fail. element_id=[%d], name=[%s]", eid, name); \
110 err = MM_ERROR_CAMCORDER_RESOURCE_CREATION; \
111 goto pipeline_creation_error; \
113 g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \
116 #define _MMCAMCORDER_BIN_MAKE(sub_context, eid, name /*char* */, err) \
117 if (sub_context->element[eid].gst != NULL) { \
118 _mmcam_dbg_err("The element(Bin) is existed. element_id=[%d], name=[%s]", eid, name); \
119 gst_object_unref(sub_context->element[eid].gst); \
121 sub_context->element[eid].id = eid; \
122 sub_context->element[eid].gst = gst_bin_new(name); \
123 if (sub_context->element[eid].gst == NULL) { \
124 _mmcam_dbg_err("Bin creation fail. element_id=[%d], name=[%s]\n", eid, name); \
125 err = MM_ERROR_CAMCORDER_RESOURCE_CREATION; \
126 goto pipeline_creation_error; \
128 g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \
131 #define _MMCAMCORDER_ELEMENT_MAKE(sub_context, eid, name /*char* */, nickname /*char* */, elist, err) \
132 if (sub_context->element[eid].gst != NULL) { \
133 _mmcam_dbg_err("The element is existed. element_id=[%d], name=[%s]", eid, name); \
134 gst_object_unref(sub_context->element[eid].gst); \
136 sub_context->element[eid].gst = gst_element_factory_make(name, nickname); \
137 if (sub_context->element[eid].gst == NULL) { \
138 _mmcam_dbg_err("Element creation fail. element_id=[%d], name=[%s]", eid, name); \
139 err = MM_ERROR_CAMCORDER_RESOURCE_CREATION; \
140 goto pipeline_creation_error; \
142 _mmcam_dbg_log("Element creation done. element_id=[%d], name=[%s]", eid, name); \
143 sub_context->element[eid].id = eid; \
144 g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \
145 err = MM_ERROR_NONE; \
147 elist = g_list_append(elist, &(sub_context->element[eid]));
149 #define _MMCAMCORDER_ELEMENT_MAKE_IGNORE_ERROR(sub_context, eid, name /*char* */, nickname /*char* */, elist) \
150 if (sub_context->element[eid].gst != NULL) { \
151 _mmcam_dbg_err("The element is existed. element_id=[%d], name=[%s]", eid, name); \
152 gst_object_unref(sub_context->element[eid].gst); \
154 sub_context->element[eid].gst = gst_element_factory_make(name, nickname); \
155 if (sub_context->element[eid].gst == NULL) { \
156 _mmcam_dbg_err("Element creation fail. element_id=[%d], name=[%s], but keep going...", eid, name); \
158 _mmcam_dbg_log("Element creation done. element_id=[%d], name=[%s]", eid, name); \
159 sub_context->element[eid].id = eid; \
160 g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \
161 elist = g_list_append(elist, &(sub_context->element[eid])); \
164 #define _MMCAMCORDER_ENCODEBIN_ELMGET(sub_context, eid, name /*char* */, err) \
165 if (sub_context->element[eid].gst != NULL) { \
166 _mmcam_dbg_err("The element is existed. element_id=[%d], name=[%s]", eid, name); \
167 gst_object_unref(sub_context->element[eid].gst); \
169 sub_context->element[eid].id = eid; \
170 g_object_get(G_OBJECT(sc->element[_MMCAMCORDER_ENCSINK_ENCBIN].gst), name, &(sc->element[eid].gst), NULL); \
171 if (sub_context->element[eid].gst == NULL) { \
172 _mmcam_dbg_err("Element get fail. element_id=[%d], name=[%s]", eid, name); \
173 err = MM_ERROR_CAMCORDER_RESOURCE_CREATION; \
174 goto pipeline_creation_error; \
176 gst_object_unref(sub_context->element[eid].gst); \
177 g_object_weak_ref(G_OBJECT(sub_context->element[eid].gst), (GWeakNotify)_mmcamcorder_element_release_noti, sub_context); \
180 /* GStreamer element remove macro */
181 #define _MMCAMCORDER_ELEMENT_REMOVE(sub_context, eid) \
182 if (sub_context->element[eid].gst != NULL) { \
183 gst_object_unref(sub_context->element[eid].gst); \
186 #define _MM_GST_ELEMENT_LINK_MANY gst_element_link_many
187 #define _MM_GST_ELEMENT_LINK gst_element_link
188 #define _MM_GST_PAD_LINK gst_pad_link
190 #define _MM_GST_PAD_LINK_UNREF( srcpad, sinkpad, err, if_fail_goto ) \
192 GstPadLinkReturn ret = _MM_GST_PAD_LINK( srcpad, sinkpad ); \
193 gst_object_unref( srcpad ); srcpad = NULL; \
194 gst_object_unref( sinkpad ); sinkpad = NULL; \
195 if (ret != GST_PAD_LINK_OK) { \
196 err = MM_ERROR_CAMCORDER_GST_LINK; \
201 #define _MM_GST_PAD_UNLINK_UNREF( srcpad, sinkpad) \
202 if (srcpad && sinkpad) { \
203 gst_pad_unlink(srcpad, sinkpad); \
205 _mmcam_dbg_warn("some pad(srcpad:%p,sinkpad:%p) is NULL", srcpad, sinkpad); \
208 gst_object_unref(srcpad); srcpad = NULL; \
211 gst_object_unref(sinkpad); sinkpad = NULL; \
214 #define _MMCAMCORDER_STATE_SET_COUNT 3 /* checking interval */
215 #define _MMCAMCORDER_STATE_CHECK_TOTALTIME 5000000L /* total wating time for state change */
216 #define _MMCAMCORDER_STATE_CHECK_INTERVAL 5000 /* checking interval */
219 * Default videosink type
221 #define _MMCAMCORDER_DEFAULT_VIDEOSINK_TYPE "VideosinkElementX"
224 * Default recording motion rate
226 #define _MMCAMCORDER_DEFAULT_RECORDING_MOTION_RATE 1.0
229 * Total level count of manual focus */
230 #define _MMFCAMCORDER_FOCUS_TOTAL_LEVEL 8
233 * File name length limit
235 #define _MMCamcorder_FILENAME_LEN (512)
238 * Minimum integer value
240 #define _MMCAMCORDER_MIN_INT (INT_MIN)
243 * Maximum integer value
245 #define _MMCAMCORDER_MAX_INT (INT_MAX)
248 * Minimum double value
250 #define _MMCAMCORDER_MIN_DOUBLE (DBL_MIN)
253 * Maximum integer value
255 #define _MMCAMCORDER_MAX_DOUBLE (DBL_MAX)
258 * Audio timestamp margin (msec)
260 #define _MMCAMCORDER_AUDIO_TIME_MARGIN (300)
263 * Functions related with LOCK and WAIT
265 #define _MMCAMCORDER_CAST_MTSAFE(handle) (((mmf_camcorder_t*)handle)->mtsafe)
267 #define _MMCAMCORDER_GET_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).lock)
268 #define _MMCAMCORDER_LOCK(handle) g_mutex_lock(_MMCAMCORDER_GET_LOCK(handle))
269 #define _MMCAMCORDER_TRYLOCK(handle) g_mutex_trylock(_MMCAMCORDER_GET_LOCK(handle))
270 #define _MMCAMCORDER_UNLOCK(handle) g_mutex_unlock(_MMCAMCORDER_GET_LOCK(handle))
272 #define _MMCAMCORDER_GET_COND(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).cond)
273 #define _MMCAMCORDER_WAIT(handle) g_cond_wait (_MMCAMCORDER_GET_COND(handle), _MMCAMCORDER_GET_LOCK(handle))
274 #define _MMCAMCORDER_TIMED_WAIT(handle, timeval) g_cond_timed_wait (_MMCAMCORDER_GET_COND(handle), _MMCAMCORDER_GET_LOCK(handle),timeval)
276 #define _MMCAMCORDER_SIGNAL(handle) g_cond_signal (_MMCAMCORDER_GET_COND(handle));
277 #define _MMCAMCORDER_BROADCAST(handle) g_cond_broadcast (_MMCAMCORDER_GET_COND(handle));
280 #define _MMCAMCORDER_GET_CMD_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).cmd_lock)
281 #define _MMCAMCORDER_LOCK_CMD(handle) g_mutex_lock(_MMCAMCORDER_GET_CMD_LOCK(handle))
282 #define _MMCAMCORDER_TRYLOCK_CMD(handle) g_mutex_trylock(_MMCAMCORDER_GET_CMD_LOCK(handle))
283 #define _MMCAMCORDER_UNLOCK_CMD(handle) g_mutex_unlock(_MMCAMCORDER_GET_CMD_LOCK(handle))
285 /* for state change */
286 #define _MMCAMCORDER_GET_STATE_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).state_lock)
287 #define _MMCAMCORDER_LOCK_STATE(handle) g_mutex_lock(_MMCAMCORDER_GET_STATE_LOCK(handle))
288 #define _MMCAMCORDER_TRYLOCK_STATE(handle) g_mutex_trylock(_MMCAMCORDER_GET_STATE_LOCK(handle))
289 #define _MMCAMCORDER_UNLOCK_STATE(handle) g_mutex_unlock(_MMCAMCORDER_GET_STATE_LOCK(handle))
291 /* for gstreamer state change */
292 #define _MMCAMCORDER_GET_GST_STATE_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).gst_state_lock)
293 #define _MMCAMCORDER_LOCK_GST_STATE(handle) g_mutex_lock(_MMCAMCORDER_GET_GST_STATE_LOCK(handle))
294 #define _MMCAMCORDER_TRYLOCK_GST_STATE(handle) g_mutex_trylock(_MMCAMCORDER_GET_GST_STATE_LOCK(handle))
295 #define _MMCAMCORDER_UNLOCK_GST_STATE(handle) g_mutex_unlock(_MMCAMCORDER_GET_GST_STATE_LOCK(handle))
297 /* for setting/calling callback */
298 #define _MMCAMCORDER_GET_MESSAGE_CALLBACK_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).message_cb_lock)
299 #define _MMCAMCORDER_LOCK_MESSAGE_CALLBACK(handle) g_mutex_lock(_MMCAMCORDER_GET_MESSAGE_CALLBACK_LOCK(handle))
300 #define _MMCAMCORDER_TRYLOCK_MESSAGE_CALLBACK(handle) g_mutex_trylock(_MMCAMCORDER_GET_MESSAGE_CALLBACK_LOCK(handle))
301 #define _MMCAMCORDER_UNLOCK_MESSAGE_CALLBACK(handle) g_mutex_unlock(_MMCAMCORDER_GET_MESSAGE_CALLBACK_LOCK(handle))
303 #define _MMCAMCORDER_GET_VCAPTURE_CALLBACK_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).vcapture_cb_lock)
304 #define _MMCAMCORDER_LOCK_VCAPTURE_CALLBACK(handle) g_mutex_lock(_MMCAMCORDER_GET_VCAPTURE_CALLBACK_LOCK(handle))
305 #define _MMCAMCORDER_TRYLOCK_VCAPTURE_CALLBACK(handle) g_mutex_trylock(_MMCAMCORDER_GET_VCAPTURE_CALLBACK_LOCK(handle))
306 #define _MMCAMCORDER_UNLOCK_VCAPTURE_CALLBACK(handle) g_mutex_unlock(_MMCAMCORDER_GET_VCAPTURE_CALLBACK_LOCK(handle))
308 #define _MMCAMCORDER_GET_VSTREAM_CALLBACK_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).vstream_cb_lock)
309 #define _MMCAMCORDER_LOCK_VSTREAM_CALLBACK(handle) g_mutex_lock(_MMCAMCORDER_GET_VSTREAM_CALLBACK_LOCK(handle))
310 #define _MMCAMCORDER_TRYLOCK_VSTREAM_CALLBACK(handle) g_mutex_trylock(_MMCAMCORDER_GET_VSTREAM_CALLBACK_LOCK(handle))
311 #define _MMCAMCORDER_UNLOCK_VSTREAM_CALLBACK(handle) g_mutex_unlock(_MMCAMCORDER_GET_VSTREAM_CALLBACK_LOCK(handle))
313 #define _MMCAMCORDER_GET_ASTREAM_CALLBACK_LOCK(handle) (_MMCAMCORDER_CAST_MTSAFE(handle).astream_cb_lock)
314 #define _MMCAMCORDER_LOCK_ASTREAM_CALLBACK(handle) g_mutex_lock(_MMCAMCORDER_GET_ASTREAM_CALLBACK_LOCK(handle))
315 #define _MMCAMCORDER_TRYLOCK_ASTREAM_CALLBACK(handle) g_mutex_trylock(_MMCAMCORDER_GET_ASTREAM_CALLBACK_LOCK(handle))
316 #define _MMCAMCORDER_UNLOCK_ASTREAM_CALLBACK(handle) g_mutex_unlock(_MMCAMCORDER_GET_ASTREAM_CALLBACK_LOCK(handle))
319 * Caster of main handle (camcorder)
321 #define MMF_CAMCORDER(h) (mmf_camcorder_t *)(h)
324 * Caster of subcontext
326 #define MMF_CAMCORDER_SUBCONTEXT(h) (((mmf_camcorder_t *)(h))->sub_context)
328 /* LOCAL CONSTANT DEFINITIONS */
330 * Total Numbers of Attribute values.
331 * If you increase any enum of attribute values, you also have to increase this.
333 #define MM_CAMCORDER_MODE_NUM 3 /**< Number of mode type */
334 #define MM_CAMCORDER_COLOR_TONE_NUM 30 /**< Number of color-tone modes */
335 #define MM_CAMCORDER_WHITE_BALANCE_NUM 10 /**< Number of WhiteBalance modes*/
336 #define MM_CAMCORDER_SCENE_MODE_NUM 15 /**< Number of program-modes */
337 #define MM_CAMCORDER_FOCUS_MODE_NUM 6 /**< Number of focus mode*/
338 #define MM_CAMCORDER_AUTO_FOCUS_NUM 5 /**< Total count of auto focus type*/
339 #define MM_CAMCORDER_FOCUS_STATE_NUM 4 /**< Number of focus state */
340 #define MM_CAMCORDER_ISO_NUM 10 /**< Number of ISO */
341 #define MM_CAMCORDER_AUTO_EXPOSURE_NUM 9 /**< Number of Auto exposure type */
342 #define MM_CAMCORDER_WDR_NUM 3 /**< Number of wide dynamic range */
343 #define MM_CAMCORDER_AHS_NUM 4 /**< Number of anti-handshake */
344 #define MM_CAMCORDER_VIDEO_STABILIZATION_NUM 2 /**< Number of video stabilization */
345 #define MM_CAMCORDER_HDR_CAPTURE_NUM 3 /**< Number of HDR capture mode */
346 #define MM_CAMCORDER_GEOMETRY_METHOD_NUM 5 /**< Number of geometry method */
347 #define MM_CAMCORDER_TAG_ORT_NUM 8 /**< Number of tag orientation */
348 #define MM_CAMCORDER_STROBE_MODE_NUM 8 /**< Number of strobe mode type */
349 #define MM_CAMCORDER_STROBE_CONTROL_NUM 3 /**< Number of strobe control type */
350 #define MM_CAMCORDER_DETECT_MODE_NUM 2 /**< Number of detect mode type */
353 /*=======================================================================================
355 ========================================================================================*/
357 * Command for Camcorder.
360 /* Command for Video/Audio recording */
361 _MMCamcorder_CMD_RECORD,
362 _MMCamcorder_CMD_PAUSE,
363 _MMCamcorder_CMD_CANCEL,
364 _MMCamcorder_CMD_COMMIT,
366 /* Command for Image capture */
367 _MMCamcorder_CMD_CAPTURE,
369 /* Command for Preview(Video/Image only effective) */
370 _MMCamcorder_CMD_PREVIEW_START,
371 _MMCamcorder_CMD_PREVIEW_STOP,
378 _MMCamcorder_SINGLE_SHOT,
379 _MMCamcorder_MULTI_SHOT,
383 * Enumerations for manual focus direction.
384 * If focusing mode is not "MM_CAMCORDER_AF_MODE_MANUAL", this value will be ignored.
386 enum MMCamcorderMfLensDir {
387 MM_CAMCORDER_MF_LENS_DIR_FORWARD = 1, /**< Focus direction to forward */
388 MM_CAMCORDER_MF_LENS_DIR_BACKWARD, /**< Focus direction to backward */
389 MM_CAMCORDER_MF_LENS_DIR_NUM, /**< Total number of the directions */
393 * Camcorder Pipeline's Element name.
394 * @note index of element.
397 _MMCAMCORDER_NONE = (-1),
399 /* Main Pipeline Element */
400 _MMCAMCORDER_MAIN_PIPE = 0x00,
402 /* Pipeline element of Video input */
403 _MMCAMCORDER_VIDEOSRC_BIN,
404 _MMCAMCORDER_VIDEOSRC_SRC,
405 _MMCAMCORDER_VIDEOSRC_FILT,
406 _MMCAMCORDER_VIDEOSRC_QUE,
407 _MMCAMCORDER_VIDEOSRC_CLS,
408 _MMCAMCORDER_VIDEOSRC_SCALE,
409 _MMCAMCORDER_VIDEOSRC_VSFLT,
410 _MMCAMCORDER_VIDEOSRC_TEE,
412 /* Pipeline element of Audio input */
413 _MMCAMCORDER_AUDIOSRC_BIN,
414 _MMCAMCORDER_AUDIOSRC_SRC,
415 _MMCAMCORDER_AUDIOSRC_FILT,
416 _MMCAMCORDER_AUDIOSRC_NS,
417 _MMCAMCORDER_AUDIOSRC_QUE,
418 _MMCAMCORDER_AUDIOSRC_CONV,
419 _MMCAMCORDER_AUDIOSRC_VOL,
420 _MMCAMCORDER_AUDIOSRC_ENC,
422 /* Pipeline element of Video output */
423 _MMCAMCORDER_VIDEOSINK_BIN,
424 _MMCAMCORDER_VIDEOSINK_QUE,
425 _MMCAMCORDER_VIDEOSINK_SCALE,
426 _MMCAMCORDER_VIDEOSINK_FILT,
427 _MMCAMCORDER_VIDEOSINK_OVERLAY,
428 _MMCAMCORDER_VIDEOSINK_CLS,
429 _MMCAMCORDER_VIDEOSINK_ROTATE,
430 _MMCAMCORDER_VIDEOSINK_SINK,
432 /* Pipeline element of Encodebin */
433 _MMCAMCORDER_ENCSINK_BIN,
434 _MMCAMCORDER_ENCSINK_ENCBIN,
435 _MMCAMCORDER_ENCSINK_AQUE,
436 _MMCAMCORDER_ENCSINK_CONV,
437 _MMCAMCORDER_ENCSINK_AENC,
438 _MMCAMCORDER_ENCSINK_AENC_QUE,
439 _MMCAMCORDER_ENCSINK_VQUE,
440 _MMCAMCORDER_ENCSINK_VCONV,
441 _MMCAMCORDER_ENCSINK_VENC,
442 _MMCAMCORDER_ENCSINK_VENC_QUE,
443 _MMCAMCORDER_ENCSINK_ITOG,
444 _MMCAMCORDER_ENCSINK_ICROP,
445 _MMCAMCORDER_ENCSINK_ISCALE,
446 _MMCAMCORDER_ENCSINK_IFILT,
447 _MMCAMCORDER_ENCSINK_IQUE,
448 _MMCAMCORDER_ENCSINK_IENC,
449 _MMCAMCORDER_ENCSINK_MUX,
450 _MMCAMCORDER_ENCSINK_SINK,
452 /* Pipeline element of Stillshot output */
453 _MMCAMCORDER_STILLSHOTSINK_BIN,
454 _MMCAMCORDER_STILLSHOTSINK_QUE,
455 _MMCAMCORDER_STILLSHOTSINK_TOGGLE,
456 _MMCAMCORDER_STILLSHOTSINK_CLS,
457 _MMCAMCORDER_STILLSHOTSINK_CROP,
458 _MMCAMCORDER_STILLSHOTSINK_FILT,
459 _MMCAMCORDER_STILLSHOTSINK_SCALE,
460 _MMCAMCORDER_STILLSHOTSINK_FILT2,
461 _MMCAMCORDER_STILLSHOTSINK_ENC,
462 _MMCAMCORDER_STILLSHOTSINK_SINK,
464 _MMCamcorder_PIPELINE_ELEMENT_NUM,
465 } _MMCAMCORDER_PIPELINE_ELELMENT;
468 * Command type for Camcorder.
471 _MMCAMCORDER_CMD_CREATE,
472 _MMCAMCORDER_CMD_DESTROY,
473 _MMCAMCORDER_CMD_REALIZE,
474 _MMCAMCORDER_CMD_UNREALIZE,
475 _MMCAMCORDER_CMD_START,
476 _MMCAMCORDER_CMD_STOP,
477 _MMCAMCORDER_CMD_CAPTURESTART,
478 _MMCAMCORDER_CMD_CAPTURESTOP,
479 _MMCAMCORDER_CMD_RECORD,
480 _MMCAMCORDER_CMD_PAUSE,
481 _MMCAMCORDER_CMD_COMMIT,
482 _MMCAMCORDER_CMD_CANCEL,
483 _MMCAMCORDER_CMD_QUIT,
484 } _MMCamcorderCommandType;
487 * System state change cause
490 _MMCAMCORDER_STATE_CHANGE_NORMAL = 0,
491 _MMCAMCORDER_STATE_CHANGE_BY_ASM,
492 } _MMCamcorderStateChange;
495 /*=======================================================================================
496 | STRUCTURE DEFINITIONS |
497 ========================================================================================*/
499 * MMCamcorder Gstreamer Element
502 unsigned int id; /**< Gstreamer piplinem element name */
503 GstElement *gst; /**< Gstreamer element */
504 } _MMCamcorderGstElement;
507 * MMCamcorder information for KPI measurement
510 int current_fps; /**< current fps of this second */
511 int average_fps; /**< average fps */
512 unsigned int video_framecount; /**< total number of video frame */
513 unsigned int last_framecount; /**< total number of video frame in last measurement */
514 struct timeval init_video_time; /**< time when start to measure */
515 struct timeval last_video_time; /**< last measurement time */
516 } _MMCamcorderKPIMeasure;
519 * MMCamcorder information for Multi-Thread Safe
522 GMutex *lock; /**< Mutex (for general use) */
523 GCond *cond; /**< Condition (for general use) */
524 GMutex *cmd_lock; /**< Mutex (for command) */
525 GMutex *state_lock; /**< Mutex (for state change) */
526 GMutex *gst_state_lock; /**< Mutex (for state change) */
527 GMutex *message_cb_lock; /**< Mutex (for message callback) */
528 GMutex *vcapture_cb_lock; /**< Mutex (for video capture callback) */
529 GMutex *vstream_cb_lock; /**< Mutex (for video stream callback) */
530 GMutex *astream_cb_lock; /**< Mutex (for audio stream callback) */
531 } _MMCamcorderMTSafe;
534 * MMCamcorder information for command loop
537 pthread_t pCommandThread; /**< Command loop handle */
538 GQueue *cmd_queue; /**< Queue for Command loop */
539 sem_t sema; /**< Semaphore for Command loop */
540 } _MMCamcorderCommand;
543 * MMCamcorder command information
546 MMHandleType handle; /**< camcorder handle */
547 _MMCamcorderCommandType type; /**< Type of command */
548 } __MMCamcorderCmdInfo;
551 * MMCamcorder Sub Context
554 bool isMaxsizePausing; /**< Because of size limit, pipeline is paused. */
555 bool isMaxtimePausing; /**< Because of time limit, pipeline is paused. */
556 int element_num; /**< count of element */
557 int cam_stability_count; /**< camsensor stability count. the count of frame will drop */
558 GstClockTime pipeline_time; /**< current time of Gstreamer Pipeline */
559 GstClockTime pause_time; /**< amount of time while pipeline is in PAUSE state.*/
560 GstClockTime stillshot_time; /**< pipeline time of capturing moment*/
561 gboolean is_modified_rate; /**< whether recording motion rate is modified or not */
562 gboolean error_occurs; /**< flag for error */
563 int error_code; /**< error code for internal gstreamer error */
564 gboolean ferror_send; /**< file write/seek error **/
565 guint ferror_count; /**< file write/seek error count **/
566 GstClockTime previous_slot_time;
567 int display_interval; /**< This value is set as 'GST_SECOND / display FPS' */
568 gboolean bget_eos; /**< Whether getting EOS */
569 gboolean bencbin_capture; /**< Use Encodebin for capturing */
570 gboolean audio_disable; /**< whether audio is disabled or not when record */
571 int videosrc_rotate; /**< rotate of videosrc */
573 /* For dropping video frame when start recording */
574 int drop_vframe; /**< When this value is bigger than zero and pass_first_vframe is zero, MSL will drop video frame though cam_stability count is bigger then zero. */
575 int pass_first_vframe; /**< When this value is bigger than zero, MSL won't drop video frame though "drop_vframe" is bigger then zero. */
577 /* INI information */
578 gchar format_name[sizeof(GST_VIDEO_FORMATS_ALL)]; /**< Get format value of camera INI file */
579 _MMCamcorderImageInfo *info_image; /**< extra information for image capture */
580 _MMCamcorderVideoInfo *info_video; /**< extra information for video recording */
581 _MMCamcorderAudioInfo *info_audio; /**< extra information for audio recording */
583 _MMCamcorderGstElement *element; /**< array of Gstreamer element */
584 _MMCamcorderKPIMeasure kpi; /**< information related with performance measurement */
586 type_element *VideosinkElement; /**< configure data of videosink element */
587 gboolean SensorEncodedCapture; /**< whether camera sensor support encoded image capture */
588 gboolean internal_encode; /**< whether use internal encoding function */
589 } _MMCamcorderSubContext;
592 * _MMCamcorderContext
594 typedef struct mmf_camcorder {
596 int type; /**< mmcamcorder_mode_type */
597 int state; /**< state of camcorder */
598 int target_state; /**< Target state that want to set. This is a flag that
599 * stands for async state changing. If this value differ from state,
600 * it means state is changing now asychronously. */
603 MMHandleType attributes; /**< Attribute handle */
604 _MMCamcorderSubContext *sub_context; /**< sub context */
605 mm_exif_info_t *exif_info; /**< EXIF */
606 GList *buffer_probes; /**< a list of buffer probe handle */
607 GList *event_probes; /**< a list of event probe handle */
608 GList *data_probes; /**< a list of data probe handle */
609 GList *signals; /**< a list of signal handle */
610 GList *msg_data; /**< a list of msg data */
611 camera_conf *conf_main; /**< Camera configure Main structure */
612 camera_conf *conf_ctrl; /**< Camera configure Control structure */
613 int asm_handle_sh; /**< Audio session manager handle of share session */
614 int asm_handle_ex; /**< Audio session manager handle of exclusive session */
615 guint pipeline_cb_event_id; /**< Event source ID of pipeline message callback */
616 guint setting_event_id; /**< Event source ID of attributes setting to sensor */
617 SOUND_INFO snd_info; /**< Sound handle for multishot capture */
619 /* callback handlers */
620 MMMessageCallback msg_cb; /**< message callback */
621 void *msg_cb_param; /**< message callback parameter */
622 mm_camcorder_video_stream_callback vstream_cb; /**< Video stream callback */
623 void *vstream_cb_param; /**< Video stream callback parameter */
624 mm_camcorder_audio_stream_callback astream_cb; /**< Audio stream callback */
625 void *astream_cb_param; /**< Audio stream callback parameter */
626 mm_camcorder_video_capture_callback vcapture_cb; /**< Video capture callback */
627 void *vcapture_cb_param; /**< Video capture callback parameter */
628 int (*command)(MMHandleType, int); /**< camcorder's command */
631 _MMCamcorderMTSafe mtsafe; /**< Thread safe */
632 _MMCamcorderCommand cmd; /**< information for command loop */
633 int sync_state_change; /**< Change framework state synchronously */
634 int quick_device_close;
635 int state_change_by_system; /**< MSL changes its state by itself because of system(ASM,MDM..) **/
636 int asm_event_code; /**< event code of audio session manager */
637 pthread_mutex_t sound_lock; /**< Capture sound mutex */
638 pthread_cond_t sound_cond; /**< Capture sound cond */
639 int use_zero_copy_format; /**< Whether use zero copy format for camera input */
640 int shutter_sound_policy; /**< shutter sound policy */
642 _MMCamcorderInfoConverting caminfo_convert[CAMINFO_CONVERT_NUM]; /**< converting structure of camera info */
643 _MMCamcorderEnumConvert enum_conv[ENUM_CONVERT_NUM]; /**< enum converting list that is modified by ini info */
645 int reserved[4]; /**< reserved */
648 /*=======================================================================================
649 | EXTERN GLOBAL VARIABLE |
650 ========================================================================================*/
652 /*=======================================================================================
653 | GLOBAL FUNCTION PROTOTYPES |
654 ========================================================================================*/
656 * This function creates camcorder for capturing still image and recording.
658 * @param[out] handle Specifies the camcorder handle
659 * @param[in] info Preset information of camcorder
660 * @return This function returns zero on success, or negative value with error code.
661 * @remarks When this function calls successfully, camcorder handle will be filled with a @n
662 * valid value and the state of the camcorder will become MM_CAMCORDER_STATE_NULL.@n
663 * Note that it's not ready to working camcorder. @n
664 * You should call mmcamcorder_realize before starting camcorder.
665 * @see _mmcamcorder_create
667 int _mmcamcorder_create(MMHandleType *handle, MMCamPreset *info);
670 * This function destroys instance of camcorder.
672 * @param[in] hcamcorder Specifies the camcorder handle
673 * @return This function returns zero on success, or negative value with error code.
674 * @see _mmcamcorder_create
676 int _mmcamcorder_destroy(MMHandleType hcamcorder);
679 * This function allocates memory for camcorder.
681 * @param[in] hcamcorder Specifies the camcorder handle
682 * @return This function returns zero on success, or negative value with error code.
683 * @remarks This function can be called successfully when current state is MM_CAMCORDER_STATE_NULL @n
684 * and the state of the camcorder will become MM_CAMCORDER_STATE_READY. @n
685 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
686 * @see _mmcamcorder_unrealize
687 * @pre MM_CAMCORDER_STATE_NULL
688 * @post MM_CAMCORDER_STATE_READY
690 int _mmcamcorder_realize(MMHandleType hcamcorder);
693 * This function free allocated memory for camcorder.
695 * @param[in] hcamcorder Specifies the camcorder handle
696 * @return This function returns zero on success, or negative value with error code.
697 * @remarks This function release all resources which are allocated for the camcorder engine.@n
698 * This function can be called successfully when current state is MM_CAMCORDER_STATE_READY and @n
699 * the state of the camcorder will become MM_CAMCORDER_STATE_NULL. @n
700 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
701 * @see _mmcamcorder_realize
702 * @pre MM_CAMCORDER_STATE_READY
703 * @post MM_CAMCORDER_STATE_NULL
705 int _mmcamcorder_unrealize(MMHandleType hcamcorder);
708 * This function is to start previewing.
710 * @param[in] hcamcorder Specifies the camcorder handle
711 * @return This function returns zero on success, or negative value with error code.
712 * @remarks This function can be called successfully when current state is MM_CAMCORDER_STATE_READY and @n
713 * the state of the camcorder will become MM_CAMCORDER_STATE_PREPARE. @n
714 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
715 * @see _mmcamcorder_stop
717 int _mmcamcorder_start(MMHandleType hcamcorder);
720 * This function is to stop previewing.
722 * @param[in] hcamcorder Specifies the camcorder handle
723 * @return This function returns zero on success, or negative value with error code.
724 * @remarks This function can be called successfully when current state is MM_CAMCORDER_STATE_PREPARE and @n
725 * the state of the camcorder will become MM_CAMCORDER_STATE_READY.@n
726 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
727 * @see _mmcamcorder_start
729 int _mmcamcorder_stop(MMHandleType hcamcorder);
732 * This function to start capturing of still images.
734 * @param[in] hcamcorder Specifies the camcorder handle.
735 * @return This function returns zero on success, or negative value with error code.
736 * @remarks This function can be called successfully when current state is MM_CAMCORDER_STATE_PREPARE and @n
737 * the state of the camcorder will become MM_CAMCORDER_STATE_CAPTURING. @n
738 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
739 * @see _mmcamcorder_capture_stop
741 int _mmcamcorder_capture_start(MMHandleType hcamcorder);
744 * This function is to stop capturing still images.
746 * @param[in] hcamcorder Specifies the camcorder handle
747 * @return This function returns zero on success, or negative value with error code.
748 * @remarks This function can be called successfully when current state is MM_CAMCORDER_STATE_CAPTURING and @n
749 * the state of the camcorder will become MM_CAMCORDER_STATE_PREPARE. @n
750 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
751 * @see _mmcamcorder_capture_start
753 int _mmcamcorder_capture_stop(MMHandleType hcamcorder);
756 * This function is to start video and audio recording.
758 * @param[in] hcamcorder Specifies the camcorder handle
759 * @return This function returns zero on success, or negative value with error code.
760 * @remarks This function can be called successfully when current state is @n
761 * MM_CAMCORDER_STATE_PREPARE or MM_CAMCORDER_STATE_PAUSED and @n
762 * the state of the camcorder will become MM_CAMCORDER_STATE_RECORDING.@n
763 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
764 * @see _mmcamcorder_pause
766 int _mmcamcorder_record(MMHandleType hcamcorder);
769 * This function is to pause video and audio recording
771 * @param[in] hcamcorder Specifies the camcorder handle
772 * @return This function returns zero on success, or negative value with error code.
773 * @remarks This function can be called successfully when current state is MM_CAMCORDER_STATE_RECORDING and @n
774 * the state of the camcorder will become MM_CAMCORDER_STATE_PAUSED.@n
775 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.@n
776 * @see _mmcamcorder_record
778 int _mmcamcorder_pause(MMHandleType hcamcorder);
781 * This function is to stop video and audio recording and save results.
783 * @param[in] hcamcorder Specifies the camcorder handle
784 * @return This function returns zero on success, or negative value with error code.
785 * @remarks This function can be called successfully when current state is @n
786 * MM_CAMCORDER_STATE_PAUSED or MM_CAMCORDER_STATE_RECORDING and @n
787 * the state of the camcorder will become MM_CAMCORDER_STATE_PREPARE. @n
788 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION
789 * @see _mmcamcorder_cancel
791 int _mmcamcorder_commit(MMHandleType hcamcorder);
794 * This function is to stop video and audio recording and do not save results.
796 * @param[in] hcamcorder Specifies the camcorder handle
797 * @return This function returns zero on success, or negative value with error code.
798 * @remarks This function can be called successfully when current state is @n
799 * MM_CAMCORDER_STATE_PAUSED or MM_CAMCORDER_STATE_RECORDING and @n
800 * the state of the camcorder will become MM_CAMCORDER_STATE_PREPARE. @n
801 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
802 * @see _mmcamcorder_commit
804 int _mmcamcorder_cancel(MMHandleType hcamcorder);
807 * This function calls after commiting action finished asynchronously.
808 * In this function, remaining process , such as state change, happens.
810 * @param[in] hcamcorder Specifies the camcorder handle
811 * @return This function returns zero on success, or negative value with error code.
812 * @remarks This function can be called successfully when current state is @n
813 * MM_CAMCORDER_STATE_PAUSED or MM_CAMCORDER_STATE_RECORDING and @n
814 * the state of the camcorder will become MM_CAMCORDER_STATE_PREPARE. @n
815 * Otherwise, this function will return MM_ERROR_CAMCORDER_INVALID_CONDITION.
816 * @see _mmcamcorder_commit
818 int _mmcamcorder_commit_async_end(MMHandleType hcamcorder);
821 * This function is to set callback for receiving messages from camcorder.
823 * @param[in] hcamcorder Specifies the camcorder handle
824 * @param[in] callback Specifies the function pointer of callback function
825 * @param[in] user_data Specifies the user poiner for passing to callback function
827 * @return This function returns zero on success, or negative value with error code.
828 * @remarks typedef bool (*mm_message_callback) (int msg, mm_messageType *param, void *user_param);@n
843 * } mm_message_type; @n
845 * If a message value for mm_message_callback is MM_MESSAGE_STATE_CHANGED, @n
846 * state value in mm_message_type will be a mmcamcorder_state_type enum value;@n
848 * If a message value for mm_message_callback is MM_MESSAGE_ERROR, @n
849 * the code value in mm_message_type will be a mmplayer_error_type enum value;
851 * @see mm_message_type, mmcamcorder_state_type, mmcamcorder_error_type
853 int _mmcamcorder_set_message_callback(MMHandleType hcamcorder,
854 MMMessageCallback callback,
858 * This function is to set callback for video stream.
860 * @param[in] hcamcorder Specifies the camcorder handle
861 * @param[in] callback Specifies the function pointer of callback function
862 * @param[in] user_data Specifies the user poiner for passing to callback function
864 * @return This function returns zero on success, or negative value with error code.
865 * @see mmcamcorder_error_type
867 int _mmcamcorder_set_video_stream_callback(MMHandleType hcamcorder,
868 mm_camcorder_video_stream_callback callback,
872 * This function is to set callback for audio stream.
874 * @param[in] hcamcorder Specifies the camcorder handle
875 * @param[in] callback Specifies the function pointer of callback function
876 * @param[in] user_data Specifies the user poiner for passing to callback function
878 * @return This function returns zero on success, or negative value with error code.
879 * @see mmcamcorder_error_type
881 int _mmcamcorder_set_audio_stream_callback(MMHandleType handle,
882 mm_camcorder_audio_stream_callback callback,
886 * This function is to set callback for video capture.
888 * @param[in] hcamcorder Specifies the camcorder handle
889 * @param[in] callback Specifies the function pointer of callback function
890 * @param[in] user_data Specifies the user poiner for passing to callback function
892 * @return This function returns zero on success, or negative value with error code.
893 * @see mmcamcorder_error_type
895 int _mmcamcorder_set_video_capture_callback(MMHandleType hcamcorder,
896 mm_camcorder_video_capture_callback callback,
900 * This function returns current state of camcorder, or negative value with error code.
902 * @param[in] hcamcorder Specifies the camcorder handle.
903 * @return This function returns current state of camcorder, or negative value with error code.
904 * @see mmcamcorder_state_type
906 int _mmcamcorder_get_current_state(MMHandleType hcamcorder);
908 int _mmcamcorder_init_focusing(MMHandleType handle);
909 int _mmcamcorder_adjust_focus(MMHandleType handle, int direction);
910 int _mmcamcorder_adjust_manual_focus(MMHandleType handle, int direction);
911 int _mmcamcorder_adjust_auto_focus(MMHandleType handle);
912 int _mmcamcorder_stop_focusing(MMHandleType handle);
915 * This function gets current state of camcorder.
918 * @return This function returns state of current camcorder context
920 * @see _mmcamcorder_set_state()
923 int _mmcamcorder_streamer_init(void);
926 * This function gets current state of camcorder.
929 * @return This function returns state of current camcorder context
931 * @see _mmcamcorder_set_state()
934 int _mmcamcorder_display_init(void);
937 * This function gets current state of camcorder.
939 * @param[in] handle Handle of camcorder context.
940 * @return This function returns state of current camcorder context
942 * @see _mmcamcorder_set_state()
945 int _mmcamcorder_get_state(MMHandleType handle);
948 * This function sets new state of camcorder.
950 * @param[in] handle Handle of camcorder context.
951 * @param[in] state setting state value of camcorder.
954 * @see _mmcamcorder_get_state()
957 void _mmcamcorder_set_state(MMHandleType handle, int state);
960 * This function gets asynchronous status of MSL Camcroder.
962 * @param[in] handle Handle of camcorder context.
963 * @param[in] target_state setting target_state value of camcorder.
964 * @return This function returns asynchrnous state.
966 * @see _mmcamcorder_set_async_state()
969 int _mmcamcorder_get_async_state(MMHandleType handle);
972 * This function sets new target state of camcorder.
974 * @param[in] handle Handle of camcorder context.
975 * @param[in] target_state setting target_state value of camcorder.
976 * @return This function returns zero on success, or negative value with error code.
978 * @see _mmcamcorder_get_async_state(), _mmcamcorder_set_async_cancel()
981 int _mmcamcorder_set_async_state(MMHandleType handle, int target_state);
984 * This function sets new target state of camcorder.
986 * @param[in] handle Handle of camcorder context.
989 * @see _mmcamcorder_set_async_cancel()
992 gboolean _mmcamcorder_set_async_cancel(MMHandleType handle);
995 * Check whether camcorder changes its state now.
997 * @param[in] handle Handle of camcorder context.
1000 * @see _mmcamcorder_set_async_state(), _mmcamcorder_set_async_cancel()
1003 gboolean _mmcamcorder_is_state_changing(MMHandleType handle);
1006 * This function allocates structure of subsidiary attributes.
1008 * @param[in] type Allocation type of camcorder context.
1009 * @return This function returns structure pointer on success, NULL value on failure.
1011 * @see _mmcamcorder_dealloc_subcontext()
1014 _MMCamcorderSubContext *_mmcamcorder_alloc_subcontext(int type);
1017 * This function releases structure of subsidiary attributes.
1019 * @param[in] sc Handle of camcorder subcontext.
1022 * @see _mmcamcorder_alloc_subcontext()
1025 void _mmcamcorder_dealloc_subcontext(_MMCamcorderSubContext *sc);
1028 * This function sets command function according to the type.
1030 * @param[in] handle Handle of camcorder context.
1031 * @param[in] type Allocation type of camcorder context.
1032 * @return This function returns MM_ERROR_NONE on success, or other values with error code.
1034 * @see __mmcamcorder_video_command(), __mmcamcorder_audio_command(), __mmcamcorder_image_command()
1037 int _mmcamcorder_set_functions(MMHandleType handle, int type);
1040 * This function is callback function of main pipeline.
1041 * Once this function is registered with certain pipeline using gst_bus_add_watch(),
1042 * this callback will be called every time when there is upcomming message from pipeline.
1043 * Basically, this function is used as error handling function, now.
1045 * @param[in] bus pointer of buf that called this function.
1046 * @param[in] message callback message from pipeline.
1047 * @param[in] data user data.
1048 * @return This function returns true on success, or false value with error
1050 * @see __mmcamcorder_create_preview_pipeline()
1053 gboolean _mmcamcorder_pipeline_cb_message(GstBus *bus, GstMessage *message, gpointer data);
1056 * This function is callback function of main pipeline.
1057 * Once this function is registered with certain pipeline using gst_bus_set_sync_handler(),
1058 * this callback will be called every time when there is upcomming message from pipeline.
1059 * Basically, this function is used as sync error handling function, now.
1061 * @param[in] bus pointer of buf that called this function.
1062 * @param[in] message callback message from pipeline.
1063 * @param[in] data user data.
1064 * @return This function returns true on success, or false value with error
1066 * @see __mmcamcorder_create_preview_pipeline()
1069 GstBusSyncReply _mmcamcorder_pipeline_bus_sync_callback(GstBus *bus, GstMessage *message, gpointer data);
1072 * This function create main pipeline according to type.
1074 * @param[in] handle Handle of camcorder context.
1075 * @param[in] type Allocation type of camcorder context.
1076 * @return This function returns zero on success, or negative value with error code.
1078 * @see _mmcamcorder_destroy_pipeline()
1081 int _mmcamcorder_create_pipeline(MMHandleType handle, int type);
1084 * This function release all element of main pipeline according to type.
1086 * @param[in] handle Handle of camcorder context.
1087 * @param[in] type Allocation type of camcorder context.
1090 * @see _mmcamcorder_create_pipeline()
1093 void _mmcamcorder_destroy_pipeline(MMHandleType handle, int type);
1096 * This function sets gstreamer element status.
1097 * If the gstreamer fails to set status or returns asynchronous mode,
1098 * this function waits for state changed until timeout expired.
1100 * @param[in] pipeline Pointer of pipeline
1101 * @param[in] target_state newly setting status
1102 * @return This function returns zero on success, or negative value with error code.
1107 int _mmcamcorder_gst_set_state(MMHandleType handle, GstElement *pipeline, GstState target_state);
1110 * This function sets gstreamer element status, asynchronously.
1111 * Regardless of processing, it returns immediately.
1113 * @param[in] pipeline Pointer of pipeline
1114 * @param[in] target_state newly setting status
1115 * @return This function returns zero on success, or negative value with error code.
1120 int _mmcamcorder_gst_set_state_async(MMHandleType handle, GstElement *pipeline, GstState target_state);
1122 /* For xvimagesink */
1123 GstBusSyncReply __mmcamcorder_sync_callback(GstBus *bus, GstMessage *message, gulong data);
1125 /* For querying capabilities */
1126 int _mmcamcorder_read_vidsrc_info(int videodevidx, camera_conf **configure_info);
1128 /* for performance check */
1129 void _mmcamcorder_video_current_framerate_init(MMHandleType handle);
1130 int _mmcamcorder_video_current_framerate(MMHandleType handle);
1131 int _mmcamcorder_video_average_framerate(MMHandleType handle);
1134 void _mmcamcorder_delete_command_info(__MMCamcorderCmdInfo *cmdinfo);
1135 int _mmcamcorder_create_command_loop(MMHandleType handle);
1136 int _mmcamcorder_destroy_command_loop(MMHandleType handle);
1137 int _mmcamcorder_append_command(MMHandleType handle, __MMCamcorderCmdInfo *info);
1138 int _mmcamcorder_append_simple_command(MMHandleType handle, _MMCamcorderCommandType type);
1139 void *_mmcamcorder_command_loop_thread(void *arg);
1145 #endif /* __MM_CAMCORDER_INTERNAL_H__ */