*/
int camera_set_x11_display_pixmap(camera_h camera, camera_x11_pixmap_updated_cb callback, void *user_data);
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @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] type The type of the display
+ * @param[in] display_handle The handle of the created display
+ *
+ * @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().
+ * @post camera_set_mused_display() will be invoked.
+ *
+ * @see camera_set_mused_display()
+ */
+int camera_set_mused_display(camera_h camera, camera_display_type_e type, void *display_handle);
+
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @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
+ *
+ * @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().
+ * @post camera_get_video_caps() will be invoked.
+ *
+ * @see camera_get_video_caps()
+ */
+int camera_get_video_caps(camera_h camera, char **caps);
+
+/**
+ * @brief Registers a callback function to be invoked when camera needs updated xid.
+ * @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] socket_path The socket file path for the display data ipc
+ *
+ * @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().
+ * @post camera_set_shm_socket_path_for_mused() will be invoked.
+ *
+ * @see camera_set_shm_socket_path_for_mused()
+ */
+int camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path);
+
/**
* @}
*/
#include <string.h>
#include <mm.h>
#include <mm_camcorder.h>
+#include <mm_camcorder_mused.h>
#include <mm_types.h>
#include <camera.h>
#include <camera_internal.h>
return __convert_camera_error_code(__func__, ret);
}
+int camera_set_mused_display(camera_h camera, camera_display_type_e type, void *display_handle)
+{
+ int ret = MM_ERROR_NONE;
+ int set_surface = MM_DISPLAY_SURFACE_X;
+ camera_s *handle = NULL;
+ void *set_handle = NULL;
+
+ if (camera == NULL) {
+ LOGE("INVALID_PARAMETER(0x%08x)", CAMERA_ERROR_INVALID_PARAMETER);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (type != CAMERA_DISPLAY_TYPE_NONE && display_handle == NULL) {
+ LOGE("display type[%d] is not NONE, but display handle is NULL", type);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ handle = (camera_s *)camera;
+ handle->display_type = type;
+ handle->display_handle = display_handle;
+
+ switch(type) {
+ case CAMERA_DISPLAY_TYPE_OVERLAY:
+ set_surface = MM_DISPLAY_SURFACE_X;
+ set_handle = &(handle->display_handle);
+ LOGD("display type OVERLAY : handle %p", (int)handle->display_handle);
+ break;
+ case CAMERA_DISPLAY_TYPE_EVAS:
+ set_surface = MM_DISPLAY_SURFACE_EVAS;
+ set_handle = display_handle;
+ break;
+ case CAMERA_DISPLAY_TYPE_NONE:
+ default:
+ set_surface = MM_DISPLAY_SURFACE_NULL;
+ handle->display_handle = NULL;
+ break;
+ }
+
+ ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_DISPLAY_DEVICE, MM_DISPLAY_DEVICE_MAINLCD,
+ MMCAM_DISPLAY_SURFACE, set_surface,
+ NULL);
+
+ if (ret == MM_ERROR_NONE && type != CAMERA_DISPLAY_TYPE_NONE) {
+ ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_DISPLAY_HANDLE, set_handle, sizeof(void *),
+ NULL);
+ }
+
+ return __convert_camera_error_code(__func__, ret);
+}
+
+int camera_get_video_caps(camera_h camera, char **caps)
+{
+ int ret;
+ camera_s *handle = (camera_s *)camera;
+
+ ret = mm_camcorder_mused_get_video_caps(handle->mm_handle, caps);
+ if(ret != MM_ERROR_NONE) {
+ return __convert_camera_error_code(__func__, ret);
+ }
+
+ return CAMERA_ERROR_NONE;
+}
+
+int camera_set_shm_socket_path_for_mused(camera_h camera, char *socket_path)
+{
+ int ret;
+ camera_s *handle = (camera_s *)camera;
+
+ LOGE("var : %s", socket_path);
+ mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_DISPLAY_SHM_SOCKET_PATH, socket_path, strlen(socket_path),
+ NULL);
+
+ if (ret != MM_ERROR_NONE) {
+ LOGE("error set shm socket path attribute 0x%x", ret);
+ return __convert_camera_error_code(__func__, ret);
+ }
+
+ return CAMERA_ERROR_NONE;
+}
+
+