e5f43b215fad7154eec97ac43673f83045634155
[platform/core/api/camera.git] / include / camera_private.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18
19
20
21 #ifndef __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
22 #define __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
23 #include <camera.h>
24 #include <mm_camcorder.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #define MAX_DETECTED_FACE 20
31
32 typedef enum {
33         _CAMERA_EVENT_TYPE_STATE_CHANGE,
34         _CAMERA_EVENT_TYPE_FOCUS_CHANGE,
35         _CAMERA_EVENT_TYPE_CAPTURE_COMPLETE,
36         _CAMERA_EVENT_TYPE_PREVIEW,
37         _CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW,
38         _CAMERA_EVENT_TYPE_CAPTURE,
39         _CAMERA_EVENT_TYPE_ERROR,
40         _CAMERA_EVENT_TYPE_HDR_PROGRESS,
41         _CAMERA_EVENT_TYPE_INTERRUPTED,
42         _CAMERA_EVENT_TYPE_FACE_DETECTION,
43         _CAMERA_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR,
44         _CAMERA_EVENT_TYPE_NUM
45 }_camera_event_e;
46
47 typedef struct _camera_cb_data {
48         int event_type;
49         void *handle;
50 } camera_cb_data;
51
52 typedef struct _camera_s{
53         MMHandleType mm_handle;
54
55         void* user_cb[_CAMERA_EVENT_TYPE_NUM];
56         void* user_data[_CAMERA_EVENT_TYPE_NUM];
57         void* display_handle;
58 #ifdef HAVE_WAYLAND
59         MMCamWaylandInfo *wl_info;
60 #endif /* #ifdef HAVE_WAYLAND */
61         camera_display_type_e display_type;
62         unsigned int state;
63
64         MMMessageCallback relay_message_callback;
65         void* relay_user_data;
66         int capture_count;
67         int capture_width;
68         int capture_height;
69         bool is_continuous_shot_break;
70         bool is_capture_completed;
71         int current_capture_count;
72         int current_capture_complete_count;
73         bool capture_resolution_modified;
74         camera_detected_face_s faceinfo[MAX_DETECTED_FACE];
75         int num_of_faces;
76         bool hdr_keep_mode;
77         bool focus_area_valid;
78         bool is_used_in_recorder;
79         bool on_continuous_focusing;
80         int cached_focus_mode;
81         media_format_h pkt_fmt;
82
83         GList *cb_data_list;
84         GMutex idle_cb_lock;
85 } camera_s;
86
87 int _camera_get_mm_handle(camera_h camera , MMHandleType *handle);
88 int _camera_set_relay_mm_message_callback(camera_h camera, MMMessageCallback callback, void *user_data);
89 int __camera_start_continuous_focusing(camera_h camera);
90 int _camera_set_use(camera_h camera, bool used);
91 bool _camera_is_used(camera_h camera);
92 void _camera_remove_cb_message(camera_s *handle);
93 int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format);
94 int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype);
95 int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data);
96 int __convert_camera_error_code(const char* func, int code);
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif //__TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
103