Release version 0.2.26
[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 <muse_core.h>
25 #include <muse_camera.h>
26 #include <mm_camcorder.h>
27
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define CAMERA_PARSE_STRING_SIZE 10
34
35 typedef struct _camera_cb_info_s {
36         gint fd;
37         GThread *msg_recv_thread;
38         GThread *msg_handler_thread;
39         gint msg_recv_running;
40         gint msg_handler_running;
41         GCond msg_handler_cond;
42         GMutex msg_handler_mutex;
43         GQueue *msg_queue;
44         GList *idle_event_list;
45         GCond idle_event_cond;
46         GMutex idle_event_mutex;
47         gpointer user_cb[MUSE_CAMERA_EVENT_TYPE_NUM];
48         gpointer user_data[MUSE_CAMERA_EVENT_TYPE_NUM];
49         gchar recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH];
50         GCond *api_cond;
51         GMutex *api_mutex;
52         gint *api_activating;
53         gint *api_ret;
54         tbm_bufmgr bufmgr;
55         gint prev_state;
56         media_format_h pkt_fmt;
57 } camera_cb_info_s;
58
59 typedef struct _camera_message_s {
60         gchar recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH];
61         muse_camera_api_e api;
62 } camera_message_s;
63
64 typedef struct _camera_idle_event_s {
65         camera_cb_info_s *cb_info;
66         gchar recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH];
67         muse_camera_event_e event;
68         GMutex event_mutex;
69 } camera_idle_event_s;
70
71 typedef struct _camera_cli_s {
72         intptr_t remote_handle;
73         MMHandleType client_handle;
74         intptr_t display_handle;
75         camera_cb_info_s *cb_info;
76 #ifdef HAVE_WAYLAND
77         MMCamWaylandInfo *wl_info;
78 #endif /* #ifdef HAVE_WAYLAND */
79 } camera_cli_s;
80
81 typedef struct _camera_media_packet_data {
82         int tbm_key;
83         tbm_bo bo;
84         tbm_bo buffer_bo[BUFFER_MAX_PLANE_NUM];
85         int num_buffer_key;
86 } camera_media_packet_data;
87
88
89 int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format);
90 int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype);
91 int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data);
92 int __convert_camera_error_code(const char* func, int code);
93
94 #ifdef __cplusplus
95 }
96 #endif
97
98 #endif //__TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__
99