/**
* @file camera_internal.h
- * @brief This file contains the Camera Product-internal API for framework, related structures and enumerations.
+ * @brief This file contains the Camera internal API for framework, related structures and enumerations.
*/
/**
- * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @brief Set pid of client for sound focus API.
* @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
- * @remarks This function is valid only for #CAMERA_DISPLAY_TYPE_OVERLAY.
* @param[in] camera The handle to the camera
- * @param[in] caps The caps information of the server's video element
+ * @param[in] pid The pid of client
*
* @return @c 0 on success, otherwise a negative error value
* @retval #CAMERA_ERROR_NONE Successful
* @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
* @retval #CAMERA_ERROR_INVALID_STATE Invalid state
* @pre The camera state must be #CAMERA_STATE_CREATED by camera_create().
- * @post camera_get_video_caps() will be invoked.
- *
- * @see camera_get_video_caps()
*/
-int legacy_camera_get_video_caps(camera_h camera, char **caps);
+int legacy_camera_set_client_pid(camera_h camera, int pid);
/**
- * @brief Set pid of client for sound focus API.
+ * @brief Emit signal to notify some information.
* @ingroup CAPI_MEDIA_CAMERA_MUSED_MODULE
* @param[in] camera The handle to the camera
- * @param[in] pid The pid of client
- *
- * @return @c 0 on success, otherwise a negative error value
- * @retval #CAMERA_ERROR_NONE Successful
- * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
- * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
- * @pre The camera state must be #CAMERA_STATE_CREATED by camera_create().
+ * @param[in] object_name The name of signal object
+ * @param[in] interface_name The name of signal interface
+ * @param[in] signal_name The name of signal
+ * @param[in] value The value of signal to emit
*/
-int legacy_camera_set_client_pid(camera_h camera, int pid);
+void legacy_camera_emit_signal(camera_h camera, const char *object_name,
+ const char *interface_name, const char *signal_name, int value);
#ifdef __cplusplus
#include <mm_camcorder.h>
#include <mm_types.h>
#include <math.h>
-#include <legacy_camera.h>
+#include <legacy_camera_internal.h>
#include <legacy_camera_private.h>
#include <glib.h>
#include <dlog.h>
#endif
#define LOG_TAG "LEGACY_CAMERA"
+/**
+ * @brief Definition for device state change signal
+ */
+#define MM_CAMCORDER_DBUS_OBJECT "/org/tizen/MMCamcorder"
+#define MM_CAMCORDER_DBUS_INTERFACE_CAMERA "org.tizen.MMCamcorder.Camera"
+#define MM_CAMCORDER_DBUS_SIGNAL_STATE_CHANGED "DeviceStateChanged"
+
static gboolean __mm_videostream_callback(MMCamcorderVideoStreamDataType *stream, void *user_data);
static gboolean __mm_capture_callback(MMCamcorderCaptureDataType *frame, MMCamcorderCaptureDataType *thumbnail, void *user_data);
case MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM:
case MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_SECURITY:
case MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_RM:
+ {
+ int emit_value = 0;
+ int device_state = -1;
+
if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED &&
(m->state.previous < MM_CAMCORDER_STATE_NONE ||
m->state.previous > MM_CAMCORDER_STATE_PAUSED ||
break;
}
+ /* check policy */
if (message == MM_MESSAGE_CAMCORDER_STATE_CHANGED_BY_ASM) {
switch (m->state.code) {
case MM_MSG_CODE_INTERRUPTED_BY_CALL_START:
handle->state, policy, handle->user_data[_CAMERA_EVENT_TYPE_STATE_CHANGE]);
}
+ /* emit signal for camera device state */
+ if (m->state.previous == MM_CAMCORDER_STATE_READY && m->state.current == MM_CAMCORDER_STATE_NULL)
+ device_state = CAMERA_DEVICE_STATE_NULL;
+ else if ((m->state.previous == MM_CAMCORDER_STATE_NULL && m->state.current == MM_CAMCORDER_STATE_READY) ||
+ (m->state.previous == MM_CAMCORDER_STATE_PREPARE && m->state.current == MM_CAMCORDER_STATE_READY))
+ device_state = CAMERA_DEVICE_STATE_OPENED;
+ else if (m->state.previous == MM_CAMCORDER_STATE_READY &&
+ m->state.current == MM_CAMCORDER_STATE_PREPARE)
+ device_state = CAMERA_DEVICE_STATE_WORKING;
+
+ if (device_state != -1) {
+ emit_value = handle->device_type << 16 | device_state;
+
+ LOGD("camera devce state change signal [0x8x]", emit_value);
+
+ legacy_camera_emit_signal((camera_h)handle,
+ MM_CAMCORDER_DBUS_OBJECT,
+ MM_CAMCORDER_DBUS_INTERFACE_CAMERA,
+ MM_CAMCORDER_DBUS_SIGNAL_STATE_CHANGED,
+ emit_value);
+ }
+
/* should change intermediate state MM_CAMCORDER_STATE_READY is not valid in capi , change to NULL state */
if (policy != CAMERA_POLICY_NONE && m->state.current == MM_CAMCORDER_STATE_NULL) {
if (handle->user_cb[_CAMERA_EVENT_TYPE_INTERRUPTED]) {
}
}
break;
+ }
case MM_MESSAGE_CAMCORDER_FOCUS_CHANGED:
if (handle->user_cb[_CAMERA_EVENT_TYPE_FOCUS_CHANGE]) {
((camera_focus_changed_cb)handle->user_cb[_CAMERA_EVENT_TYPE_FOCUS_CHANGE])(m->code,
#define LOG_TAG "LEGACY_CAMERA"
-int legacy_camera_get_video_caps(camera_h camera, char **caps)
-{
- int ret;
- camera_s *handle = (camera_s *)camera;
-
- ret = mm_camcorder_get_video_caps(handle->mm_handle, caps);
- if (ret != MM_ERROR_NONE)
- return __convert_camera_error_code(__func__, ret);
-
- return CAMERA_ERROR_NONE;
-}
-
int legacy_camera_set_client_pid(camera_h camera, int pid)
{
int ret;
return __convert_camera_error_code(__func__, ret);
}
+
+
+void legacy_camera_emit_signal(camera_h camera, const char *object_name,
+ const char *interface_name, const char *signal_name, int value)
+{
+ camera_s *handle = (camera_s *)camera;
+
+ if (!handle) {
+ LOGE("NULL handle");
+ return;
+ }
+
+ mm_camcorder_emit_signal(handle->mm_handle,
+ object_name, interface_name, signal_name, value);
+
+ return;
+}
Name: mmsvc-camera
Summary: A Camera module for muse server
-Version: 0.2.50
+Version: 0.2.51
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0