Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.10.112
+Version: 0.10.113
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
* @endcode
*/
int mm_camcorder_get_state(MMHandleType camcorder, MMCamcorderStateType *state);
+int mm_camcorder_get_state2(MMHandleType camcorder, MMCamcorderStateType *state, MMCamcorderStateType *old_state);
/**
int type; /**< mmcamcorder_mode_type */
int device_type; /**< device type */
int state; /**< state of camcorder */
- int target_state; /**< Target state that want to set. This is a flag that
- * stands for async state changing. If this value differ from state,
- * it means state is changing now asychronously. */
+ int old_state; /**< old state of camcorder */
/* handles */
MMHandleType attributes; /**< Attribute handle */
*
*/
int _mmcamcorder_get_state(MMHandleType handle);
+int _mmcamcorder_get_state2(MMHandleType handle, int *state, int *old_state);
/**
* This function sets new state of camcorder.
void _mmcamcorder_set_state(MMHandleType handle, int state);
/**
- * This function gets asynchronous status of MSL Camcroder.
- *
- * @param[in] handle Handle of camcorder context.
- * @param[in] target_state setting target_state value of camcorder.
- * @return This function returns asynchrnous state.
- * @remarks
- * @see _mmcamcorder_set_async_state()
- *
- */
-int _mmcamcorder_get_async_state(MMHandleType handle);
-
-/**
* This function allocates structure of subsidiary attributes.
*
* @param[in] type Allocation type of camcorder context.
*/
int _mmcamcorder_gst_set_state(MMHandleType handle, GstElement *pipeline, GstState target_state);
-/**
- * This function sets gstreamer element status, asynchronously.
- * Regardless of processing, it returns immediately.
- *
- * @param[in] pipeline Pointer of pipeline
- * @param[in] target_state newly setting status
- * @return This function returns zero on success, or negative value with error code.
- * @remarks
- * @see
- *
- */
-int _mmcamcorder_gst_set_state_async(MMHandleType handle, GstElement *pipeline, GstState target_state);
/* For xvimagesink */
GstBusSyncReply __mmcamcorder_sync_callback(GstBus *bus, GstMessage *message, gulong data);
}
-int mm_camcorder_get_state(MMHandleType camcorder, MMCamcorderStateType *status)
+int mm_camcorder_get_state(MMHandleType camcorder, MMCamcorderStateType *state)
{
int ret = MM_ERROR_NONE;
return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
}
- *status = _mmcamcorder_get_state(camcorder);
+ *state = _mmcamcorder_get_state(camcorder);
return ret;
+}
+
+
+int mm_camcorder_get_state2(MMHandleType camcorder, MMCamcorderStateType *state, MMCamcorderStateType *old_state)
+{
+ if (!camcorder) {
+ _mmcam_dbg_warn("Empty handle.");
+ return MM_ERROR_CAMCORDER_INVALID_ARGUMENT;
+ }
+ return _mmcamcorder_get_state2(camcorder, (int *)state, (int *)old_state);
}
/*---------------------------------------------------------------------------------------
| GLOBAL VARIABLE DEFINITIONS for internal |
---------------------------------------------------------------------------------------*/
-#define MM_CAMCORDER_START_CHANGE_STATE _MMCamcorderStartHelperFunc((void *)hcamcorder)
-#define MM_CAMCORDER_STOP_CHANGE_STATE _MMCamcorderStopHelperFunc((void *)hcamcorder)
+
/*---------------------------------------------------------------------------------------
| LOCAL VARIABLE DEFINITIONS for internal |
---------------------------------------------------------------------------------------*/
}
-/**
- * This function operates each command on audio mode.
- *
- * @param c [in] Handle of camcorder context.
- * @param command [in] command type received from Multimedia Framework.
- *
- * @return This function returns MM_ERROR_NONE on success, or the other values
- * on error.
- * @remark
- * @see _mmcamcorder_set_functions()
- *
- */
- /* ADDED BY SISO */
-
-
-void* _MMCamcorderStartHelperFunc(void *handle)
-{
- mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
- _mmcamcorder_set_state((MMHandleType)hcamcorder, hcamcorder->target_state);
-
- return NULL;
-}
-
-void* _MMCamcorderStopHelperFunc(void *handle)
-{
- mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
- _mmcamcorder_set_state((MMHandleType)hcamcorder, hcamcorder->target_state);
-
- return NULL;
-}
-
-
int
_mmcamcorder_audio_command(MMHandleType handle, int command)
{
hcamcorder->type = 0;
hcamcorder->state = MM_CAMCORDER_STATE_NONE;
hcamcorder->sub_context = NULL;
- hcamcorder->target_state = MM_CAMCORDER_STATE_NULL;
+ hcamcorder->old_state = MM_CAMCORDER_STATE_NONE;
hcamcorder->capture_in_recording = FALSE;
hcamcorder->session_type = MM_SESSION_TYPE_MEDIA;
}
+int _mmcamcorder_get_state2(MMHandleType handle, int *state, int *old_state)
+{
+ mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+
+ mmf_return_val_if_fail(hcamcorder && state && old_state, MM_ERROR_CAMCORDER_INVALID_ARGUMENT);
+
+ _MMCAMCORDER_LOCK_STATE(handle);
+
+ *state = hcamcorder->state;
+ *old_state = hcamcorder->old_state;
+
+ _MMCAMCORDER_UNLOCK_STATE(handle);
+
+ return MM_ERROR_NONE;
+}
+
+
void _mmcamcorder_set_state(MMHandleType handle, int state)
{
int old_state;
old_state = hcamcorder->state;
if (old_state != state) {
hcamcorder->state = state;
- hcamcorder->target_state = state;
+ hcamcorder->old_state = old_state;
- _mmcam_dbg_log("set state[%d] and send state-changed message", state);
+ _mmcam_dbg_log("set state[%d -> %d] and send state-changed message", old_state, state);
/* To discern who changes the state */
switch (hcamcorder->state_change_by_system) {
}
-int _mmcamcorder_get_async_state(MMHandleType handle)
-{
- int state;
- mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
-
- _MMCAMCORDER_LOCK_STATE(handle);
- state = hcamcorder->target_state;
-
- _MMCAMCORDER_UNLOCK_STATE(handle);
-
- return state;
-}
-
-
_MMCamcorderSubContext *_mmcamcorder_alloc_subcontext(int type)
{
int i;
}
-int _mmcamcorder_gst_set_state_async(MMHandleType handle, GstElement *pipeline, GstState target_state)
-{
- GstStateChangeReturn setChangeReturn = GST_STATE_CHANGE_FAILURE;
-
- _MMCAMCORDER_LOCK_GST_STATE(handle);
- setChangeReturn = gst_element_set_state(pipeline, target_state);
- _MMCAMCORDER_UNLOCK_GST_STATE(handle);
-
- return setChangeReturn;
-}
-
-
#ifdef _MMCAMCORDER_USE_SET_ATTR_CB
static gboolean __mmcamcorder_set_attr_to_camsensor_cb(gpointer data)
{