Release version 0.10.14
[platform/core/multimedia/libmm-camcorder.git] / src / include / mm_camcorder_client.h
1 /*
2  * libmm-camcorder
3  *
4  * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Sejong Park <sejong123.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __MM_CAMCORDER_MUSED_H__
23 #define __MM_CAMCORDER_MUSED_H__
24
25 #include "mm_types.h"
26
27 #ifdef __cplusplus
28         extern "C" {
29 #endif
30
31 /**
32  * Camcorder Client's attribute enumeration.
33  */
34 typedef enum
35 {
36         MM_CAM_CLIENT_DISPLAY_SHM_SOCKET_PATH,
37         MM_CAM_CLIENT_DISPLAY_HANDLE,
38         MM_CAM_CLIENT_DISPLAY_DEVICE,
39         MM_CAM_CLIENT_DISPLAY_SURFACE,
40         MM_CAM_CLIENT_DISPLAY_RECT_X,
41         MM_CAM_CLIENT_DISPLAY_RECT_Y,
42         MM_CAM_CLIENT_DISPLAY_RECT_WIDTH,
43         MM_CAM_CLIENT_DISPLAY_RECT_HEIGHT,
44         MM_CAM_CLIENT_DISPLAY_SOURCE_X,
45         MM_CAM_CLIENT_DISPLAY_SOURCE_Y,
46         MM_CAM_CLIENT_DISPLAY_SOURCE_WIDTH,
47         MM_CAM_CLIENT_DISPLAY_SOURCE_HEIGHT,
48         MM_CAM_CLIENT_DISPLAY_ROTATION,
49         MM_CAM_CLIENT_DISPLAY_VISIBLE,
50         MM_CAM_CLIENT_DISPLAY_SCALE,
51         MM_CAM_CLIENT_DISPLAY_GEOMETRY_METHOD,
52         MM_CAM_CLIENT_DISPLAY_MODE,
53         MM_CAM_CLIENT_DISPLAY_EVAS_SURFACE_SINK,
54         MM_CAM_CLIENT_DISPLAY_EVAS_DO_SCALING,
55         MM_CAM_CLIENT_DISPLAY_FLIP,
56         MM_CAM_CLIENT_ATTRIBUTE_NUM
57 }MMCamcorderClientAttrsID;
58
59 /**
60  * Camcorder Client Pipeline's Element name.
61  * @note index of element.
62  */
63 typedef enum {
64         _MMCAMCORDER_CLIENT_NONE = (-1),
65
66         /* Main Pipeline Element */
67         _MMCAMCORDER_CLIENT_MAIN_PIPE = 0x00,
68
69         /* Pipeline element of Video input */
70         _MMCAMCORDER_CLIENT_VIDEOSRC_SRC,
71
72         /* Pipeline element of Video Sink Queue */
73         _MMCAMCORDER_CLIENT_VIDEOSINK_QUE,
74
75         /* Pipeline element of Video Sink CLS */
76         _MMCAMCORDER_CLIENT_VIDEOSINK_CLS,
77
78         /* Pipeline element of Video output */
79         _MMCAMCORDER_CLIENT_VIDEOSINK_SINK,
80
81         /* Client pipeline Max number */
82         _MMCAMCORDER_CLIENT_PIPELINE_ELEMENT_NUM
83 } _MMCAMCORDER_PREVIEW_CLIENT_PIPELINE_ELELMENT;
84
85 /**
86  * This function creates resources at the client process.
87  *
88  * @param[in]   handle          Handle of camcorder context.
89  * @return      This function returns MM_ERROR_NONE on success, or the other values on error.
90  */
91 int mm_camcorder_client_create(MMHandleType *handle);
92
93 /**
94  * This function destroys resources from the client process.
95  *
96  * @param[in]   handle          Handle of camcorder context.
97  * @return      void
98  */
99 void mm_camcorder_client_destroy(MMHandleType handle);
100
101 /**
102  * This function prepares for the state running.
103  *
104  * @param[in]   handle          Handle of camcorder context.
105  * @return      This function returns MM_ERROR_NONE on success, or the other values on error.
106  * @see         _mmcamcorder_client_realize function.
107  */
108 int mm_camcorder_client_realize(MMHandleType handle, char *caps);
109
110 /**
111  * This function unprepare for the state null.
112  *
113  * @param[in]   handle          Handle of camcorder context.
114  * @return      This function returns MM_ERROR_NONE on success, or the other values on error.
115  * @see         _mmcamcorder_client_unrealize function.
116  */
117 int mm_camcorder_client_unrealize(MMHandleType handle);
118
119 /**
120  * This function get string of raw video caps.
121  * To be used by server.
122  *
123  * @param       handle  [in] Handle of camera.
124  * @param       caps    [out] String of caps. Should be freed after used.
125  *
126  * @return      This function returns zero on success, or negative value with error
127  *                      code.
128  * @see
129  * @since
130  */
131 int mm_camcorder_client_get_video_caps(MMHandleType handle, char **caps);
132
133 /**
134  * This function set "socket-path" element property of shmsink/src.
135  * To be used by both server and client.
136  *
137  * @param       handle  [in] Handle of camera.
138  * @param       path    [in] Local file path.
139  *
140  * @return      This function returns zero on success, or negative value with error
141  *                      code.
142  * @see
143  * @since
144  */
145 int mm_camcorder_client_set_shm_socket_path(MMHandleType handle, const char *path);
146
147 /**
148  * This function get root directory of current process.
149  *
150  * @param       root_directory    [out] Root directory.
151  * @return      This function returns zero on success, or negative value with error code.
152  */
153 int mm_camcorder_client_get_root_directory(char **root_directory);
154
155 #ifdef __cplusplus
156         }
157 #endif
158
159 #endif /* __MM_CAMCORDER_MUSED_H__ */