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>
32 #ifdef BUFFER_MAX_PLANE_NUM
33 #undef BUFFER_MAX_PLANE_NUM
34 #endif /* BUFFER_MAX_PLANE_NUM */
36 #define BUFFER_MAX_PLANE_NUM 4
37 #define CAMERA_PARSE_STRING_SIZE 20
40 typedef struct _camera_stream_data_s {
44 unsigned int length_yuv;
48 unsigned int length_y;
50 unsigned int length_uv;
54 unsigned int length_y;
56 unsigned int length_u;
58 unsigned int length_v;
62 unsigned int length_data;
64 } data; /**< pointer of captured stream */
65 int data_type; /**< data type */
66 unsigned int length_total; /**< total length of stream buffer (in byte)*/
67 unsigned int num_planes; /**< number of planes */
68 MMPixelFormatType format; /**< image format */
69 int width; /**< width of video buffer */
70 int height; /**< height of video buffer */
71 unsigned int timestamp; /**< timestamp of stream buffer (msec)*/
72 void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */
73 void *internal_buffer; /**< Internal buffer pointer */
74 int stride[BUFFER_MAX_PLANE_NUM]; /**< Stride of each plane */
75 int elevation[BUFFER_MAX_PLANE_NUM]; /**< Elevation of each plane */
76 } camera_stream_data_s;
79 typedef struct _camera_cb_info_s {
81 GThread *msg_recv_thread;
82 GThread *msg_handler_thread;
83 gint msg_recv_running;
84 gint msg_handler_running;
85 GCond msg_handler_cond;
86 GMutex msg_handler_mutex;
88 GList *idle_event_list;
89 GCond idle_event_cond;
90 GMutex idle_event_mutex;
91 gpointer user_cb[MUSE_CAMERA_EVENT_TYPE_NUM];
92 gpointer user_data[MUSE_CAMERA_EVENT_TYPE_NUM];
93 gchar recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH];
94 GCond api_cond[MUSE_CAMERA_API_MAX];
95 GMutex api_mutex[MUSE_CAMERA_API_MAX];
99 media_format_h pkt_fmt;
102 typedef struct _camera_message_s {
103 gchar recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH];
104 muse_camera_api_e api;
107 typedef struct _camera_idle_event_s {
108 camera_cb_info_s *cb_info;
109 gchar recv_msg[MUSE_CAMERA_MSG_MAX_LENGTH];
110 muse_camera_event_e event;
112 } camera_idle_event_s;
115 typedef struct _camera_wl_info_s {
123 #endif /* HAVE_WAYLAND */
125 typedef struct _camera_cli_s {
126 intptr_t remote_handle;
127 intptr_t display_handle;
128 camera_cb_info_s *cb_info;
130 camera_wl_info_s wl_info;
131 #endif /* HAVE_WAYLAND */
134 typedef struct _camera_media_packet_data {
137 tbm_bo buffer_bo[BUFFER_MAX_PLANE_NUM];
139 } camera_media_packet_data;
142 int _camera_get_tbm_surface_format(int in_format, uint32_t *out_format);
143 int _camera_get_media_packet_mimetype(int in_format, media_format_mimetype_e *mimetype);
144 int _camera_media_packet_finalize(media_packet_h pkt, int error_code, void *user_data);
150 #endif /* __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__ */