2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #ifndef __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
22 #define __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
24 #include <muse_core.h>
25 #include <muse_camera.h>
26 #include <mm_camcorder.h>
32 #define MAX_DETECTED_FACE 20
34 #define CAMERA_PARSE_STRING_SIZE 200
37 _CAMERA_EVENT_TYPE_STATE_CHANGE,
38 _CAMERA_EVENT_TYPE_FOCUS_CHANGE,
39 _CAMERA_EVENT_TYPE_CAPTURE_COMPLETE,
40 _CAMERA_EVENT_TYPE_PREVIEW,
41 _CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW,
42 _CAMERA_EVENT_TYPE_CAPTURE,
43 _CAMERA_EVENT_TYPE_ERROR,
44 _CAMERA_EVENT_TYPE_HDR_PROGRESS,
45 _CAMERA_EVENT_TYPE_INTERRUPTED,
46 _CAMERA_EVENT_TYPE_FACE_DETECTION,
47 _CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR,
48 _CAMERA_EVENT_TYPE_NUM
51 typedef struct _camera_cb_data {
56 typedef struct _callback_cb_info {
61 gpointer user_cb[MUSE_CAMERA_EVENT_TYPE_NUM];
62 gpointer user_cb_completed[MUSE_CAMERA_EVENT_TYPE_NUM];
63 gpointer user_data[MUSE_CAMERA_EVENT_TYPE_NUM];
64 gchar recvMsg[MUSE_CAMERA_MSG_MAX_LENGTH];
65 gchar recvApiMsg[MUSE_CAMERA_MSG_MAX_LENGTH];
66 gchar recvEventMsg[MUSE_CAMERA_MSG_MAX_LENGTH];
72 typedef struct _camera_cli_s{
73 intptr_t remote_handle;
74 MMHandleType client_handle;
75 intptr_t cli_display_handle;
76 callback_cb_info_s *cb_info;
78 MMCamWaylandInfo *wl_info;
79 #endif /* #ifdef HAVE_WAYLAND */
82 typedef struct _camera_s{
83 MMHandleType mm_handle;
85 void* user_cb[MUSE_CAMERA_EVENT_TYPE_NUM];
86 void* user_data[MUSE_CAMERA_EVENT_TYPE_NUM];
89 MMCamWaylandInfo *wl_info;
90 #endif /* #ifdef HAVE_WAYLAND */
91 camera_display_type_e display_type;
94 MMMessageCallback relay_message_callback;
95 void* relay_user_data;
99 bool is_continuous_shot_break;
100 bool is_capture_completed;
101 int current_capture_count;
102 int current_capture_complete_count;
103 bool capture_resolution_modified;
104 camera_detected_face_s faceinfo[MAX_DETECTED_FACE];
107 bool focus_area_valid;
108 bool is_used_in_recorder;
109 bool on_continuous_focusing;
110 int cached_focus_mode;
111 media_format_h pkt_fmt;
118 MUSE_CAMERA_CLIENT_SYNC_CB_HANDLER,
119 MUSE_CAMERA_CLIENT_USER_CALLBACK,
120 MUSE_CAMERA_CLIENT_MAX
121 } muse_cli_camera_api_e;
123 int _camera_get_mm_handle(camera_h camera , MMHandleType *handle);
124 int _camera_set_relay_mm_message_callback(camera_h camera, MMMessageCallback callback, void *user_data);
125 int __camera_start_continuous_focusing(camera_h camera);
126 int _camera_set_use(camera_h camera, bool used);
127 bool _camera_is_used(camera_h camera);
128 void _camera_remove_cb_message(camera_s *handle);
129 int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format);
130 int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype);
131 int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data);
132 int __convert_camera_error_code(const char* func, int code);
138 #endif //__TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__