[ACR-1777] Deprecate unused APIs
[platform/core/api/media-content.git] / include / media_face.h
1 /*
2 * Copyright (c) 2014 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 #ifndef __TIZEN_CONTENT_MEDIA_FACE_H__
18 #define __TIZEN_CONTENT_MEDIA_FACE_H__
19
20 #include <media_content_type.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25
26 /**
27  * @file media_face.h
28  * @brief This file contains the media face function and related to all operations with the face information of the image in Media DB. \n
29  *             Functions include cloning and destroying the media face handler, getting face information such as face id, face coordinates in file, \n
30  *             face tag. Face information will be managed by DB. To insert face information, you should use media_face_insert_to_db() \n
31  *             or media_info_start_face_detection() function. And you can insert,update,delete face information manually.
32  */
33
34 /**
35  * @addtogroup CAPI_CONTENT_MEDIA_FACE_MODULE
36  * @{
37  */
38
39 /**
40  * @deprecated Deprecated since 8.0.
41  * @brief Clones the media face handle.
42  * @details This function copies the media face handle from a source to
43  * destination. There is no media_face_create() function. The media_face_h is created internally and available through
44  * media face foreach function such as media_face_foreach_face_from_db(). To use this handle outside of these foreach functions,
45  * use this function.
46  *
47  * @since_tizen 3.0
48  * @remarks The @a dst should be released using media_face_destroy().
49  *
50  * @param[out] dst The destination handle to the media face
51  * @param[in] src The source handle to the media face
52  *
53  * @return 0 on success, otherwise a negative error value.
54  *
55  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
56  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
57  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
58  *
59  * @see media_face_destroy()
60  * @see media_face_foreach_face_from_db()
61  */
62 int media_face_clone(media_face_h *dst, media_face_h src) TIZEN_DEPRECATED_API;
63
64 /**
65  * @deprecated Deprecated since 8.0.
66  * @brief Destroys the media face handle.
67  * @details Function frees all resources related to media face handle. This
68  * handle no longer can be used to perform any operations. New handle has to
69  * be created before next usage.
70  *
71  * @since_tizen 3.0
72  *
73  * @param[in] face The media face handle
74  *
75  * @return 0 on success, otherwise a negative error value.
76  *
77  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
78  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
79  *
80  * @pre Get copy of media face handle by calling media_face_clone() or Get media face handle by calling media_info_foreach_face_from_db()
81  *
82  * @see media_face_clone()
83  */
84 int media_face_destroy(media_face_h face) TIZEN_DEPRECATED_API;
85
86 /**
87  * @deprecated Deprecated since 8.0.
88  * @brief Gets the face id from the media face handle.
89  *
90  * @since_tizen 3.0
91  *
92  * @remarks The @a face_id should be released using free().
93  *
94  * @param[in] face The media face handle
95  * @param[out] face_id The ID of the media face
96  *
97  * @return 0 on success, otherwise a negative error value.
98  *
99  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
100  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
101  */
102 int media_face_get_face_id(media_face_h face, char **face_id) TIZEN_DEPRECATED_API;
103
104 /**
105  * @deprecated Deprecated since 8.0.
106  * @brief Gets the media id from the media face handle.
107  *
108  * @since_tizen 3.0
109  *
110  * @remarks The @a media_id should be released using free().
111  *
112  * @param[in] face The media face handle
113  * @param[out] media_id The media ID
114  *
115  * @return 0 on success, otherwise a negative error value.
116  *
117  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
118  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
119  */
120 int media_face_get_media_id(media_face_h face, char **media_id) TIZEN_DEPRECATED_API;
121
122  /**
123  * @deprecated Deprecated since 8.0.
124  * @brief Gets the face's rectangle from the media face handle.
125  * @details This function can get the face's rectangle information. returned rectangle information includes the orientation value.
126  *
127  * @since_tizen 3.0
128  *
129  * @param[in] face The media face handle
130  * @param[out] rect_x The x position of the media face
131  * @param[out] rect_y The y position of the media face
132  * @param[out] rect_w The width of the media face
133  * @param[out] rect_h The height of the media face
134  *
135  * @return 0 on success, otherwise a negative error value.
136  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
137  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
138  */
139 int media_face_get_face_rect(media_face_h face, unsigned int *rect_x, unsigned int *rect_y, unsigned int *rect_w, unsigned int *rect_h) TIZEN_DEPRECATED_API;
140
141 /**
142  * @deprecated Deprecated since 8.0.
143  * @brief Gets the orientation from the media face handle.
144  * @details This function can get the orientation value from the original image.
145  *
146  * @since_tizen 3.0
147  *
148  * @param[in] face The media face handle
149  * @param[out] orientation The orientation of the media face
150  *
151  * @return 0 on success, otherwise a negative error value.
152  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
153  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
154  */
155 int media_face_get_orientation(media_face_h face, media_content_orientation_e *orientation) TIZEN_DEPRECATED_API;
156
157 /**
158  * @deprecated Deprecated since 8.0.
159  * @brief Gets the tag from the media face handle.
160  *
161  * @since_tizen 3.0
162  *
163  * @remarks The @a tag should be released using free().
164  *
165  * @param[in] face The media face handle
166  * @param[out] tag The tag of the media face
167  *
168  * @return 0 on success, otherwise a negative error value.
169  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
170  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
171  */
172 int media_face_get_tag(media_face_h face, char **tag) TIZEN_DEPRECATED_API;
173
174 /**
175  * @deprecated Deprecated since 8.0.
176  * @brief Creates the media face handle.
177  *
178  * @since_tizen 3.0
179  *
180  * @remarks The @a face should be released using media_face_destroy(). \n
181  *          Since 5.5, this function supports only image type.
182  *
183  * @param[in] media_id The media ID
184  * @param[out] face The media face handle
185  *
186  * @return 0 on success, otherwise a negative error value.
187  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
188  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
189  *
190  * @see media_face_destroy()
191  */
192 int media_face_create(const char *media_id, media_face_h *face) TIZEN_DEPRECATED_API;
193
194 /**
195  * @deprecated Deprecated since 8.0.
196  * @brief Sets the face rectangle of the media face handle.
197  *
198  * @since_tizen 3.0
199  *
200  * @param[in] face The media face handle
201  * @param[in] rect_x The integer to set as a position x of face rectangle
202  * @param[in] rect_y The integer to set as a position y of face rectangle
203  * @param[in] rect_w The integer to set as a width of face rectangle
204  * @param[in] rect_h The integer to set as a height of face rectangle
205  *
206  * @return 0 on success, otherwise a negative error value.
207  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
208  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
209  *
210  * @post media_face_insert_to_db()
211  * @post media_face_update_to_db()
212  *
213  */
214 int media_face_set_face_rect(media_face_h face, unsigned int rect_x, unsigned int rect_y, unsigned int rect_w, unsigned int rect_h) TIZEN_DEPRECATED_API;
215
216 /**
217  * @deprecated Deprecated since 8.0.
218  * @brief Sets the orientation of the media face handle.
219  * @details This function may set the value of the original image orientation.
220  *
221  * @since_tizen 3.0
222  *
223  * @param[in] face The media face handle
224  * @param[in] orientation The integer to set as an orientation
225  *
226  * @return 0 on success, otherwise a negative error value.
227  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
228  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
229  *
230  * @post media_face_insert_to_db()
231  * @post media_face_update_to_db()
232  *
233  */
234 int media_face_set_orientation(media_face_h face, media_content_orientation_e orientation) TIZEN_DEPRECATED_API;
235
236 /**
237  * @deprecated Deprecated since 8.0.
238  * @brief Sets the tag of the media face handle.
239  *
240  * @since_tizen 3.0
241  *
242  * @param[in] face The media face handle
243  * @param[in] tag The tag of the media face
244  *
245  * @return 0 on success, otherwise a negative error value.
246  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
247  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
248  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
249  *
250  * @post media_face_insert_to_db()
251  * @post media_face_update_to_db()
252  */
253 int media_face_set_tag(media_face_h face, const char *tag) TIZEN_DEPRECATED_API;
254
255 /**
256  * @deprecated Deprecated since 8.0.
257  * @brief Inserts a new face in the media database.
258  * @since_tizen 3.0
259  *
260  * @privlevel public
261  * @privilege %http://tizen.org/privilege/content.write
262  *
263  * @remarks The @a face should be released using media_face_destroy().
264  *
265  * @param[in] face The media face handle
266  *
267  * @return 0 on success, otherwise a negative error value.
268  *
269  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
270  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
271  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
272  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
273  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
274  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
275  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
276  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
277  *
278  * @see media_content_connect()
279  * @see media_face_destroy()
280  * @see media_face_set_face_rect()
281  * @see media_face_set_orientation()
282  * @see media_face_set_tag()
283  */
284 int media_face_insert_to_db(media_face_h face) TIZEN_DEPRECATED_API;
285
286 /**
287  * @deprecated Deprecated since 8.0.
288  * @brief Updates the face details to the media database.
289  *
290  * @details The function updates the given media face in the media database. The function should be called after any change in face, to be updated to the media
291  * database. For example, after using media_face_set_orientation() for setting the orientation of the face, media_face_update_to_db() function should be called so as to update
292  * the given face attributes in the media database.
293  * @since_tizen 3.0
294  *
295  * @privlevel public
296  * @privilege %http://tizen.org/privilege/content.write
297  *
298  * @param[in] face The media face handle to update
299  *
300  * @return 0 on success, otherwise a negative error value.
301  *
302  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
303  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
304  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
305  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
306  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
307  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
308  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
309  *
310  * @pre This function requires opened connection to content service by media_content_connect().
311  *
312  * @see media_content_connect()
313  * @see media_face_destroy()
314  * @see media_face_set_face_rect()
315  * @see media_face_set_orientation()
316  * @see media_face_set_tag()
317  *
318  */
319 int media_face_update_to_db(media_face_h face) TIZEN_DEPRECATED_API;
320
321 /**
322  * @deprecated Deprecated since 8.0.
323  * @brief Deletes the face with given face id from the media database.
324  *
325  * @since_tizen 3.0
326  *
327  * @privlevel public
328  * @privilege %http://tizen.org/privilege/content.write
329  *
330  * @param[in] face_id The ID of the media face
331  *
332  * @return 0 on success, otherwise a negative error value.
333  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
334  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
335  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
336  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
337  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
338  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
339  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
340  *
341  * @pre This function requires opened connection to content service by media_content_connect().
342  * @see media_content_connect()
343  *
344  */
345 int media_face_delete_from_db(const char *face_id) TIZEN_DEPRECATED_API;
346
347 /**
348  * @deprecated Deprecated since 8.0.
349  * @brief Gets the number of media faces with an optional filter from the media database.
350  * @since_tizen 4.0
351  *
352  * @param[in] filter The handle to the media filter
353  * @param[out] face_count The count of the media faces
354  *
355  * @return @c 0 on success,
356  *         otherwise a negative error value
357  *
358  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
359  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
360  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
361  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
362  *
363  * @pre This function requires opened connection to content service by media_content_connect().
364  *
365  * @see media_content_connect()
366  * @see media_filter_create()
367  */
368 int media_face_get_face_count_from_db(filter_h filter, int *face_count) TIZEN_DEPRECATED_API;
369
370 /**
371  * @deprecated Deprecated since 8.0.
372  * @brief Iterates through the faces with an optional filter from the media database.
373  * @details This function gets all faces associated with the given filter and calls @a callback for every retrieved media face.
374  *          If @c NULL is passed to the @a filter, then no filtering is applied.
375  * @since_tizen 4.0
376  *
377  * @param[in] filter The handle to the media filter
378  * @param[in] callback The callback function to be invoked
379  * @param[in] user_data The user data to be passed to the callback function
380  *
381  * @return @c 0 on success,
382  *         otherwise a negative error value
383  *
384  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
385  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
386  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
387  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
388  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
389  *
390  * @pre This function requires opened connection to content service by media_content_connect().
391  * @post This function invokes media_face_cb().
392  *
393  * @see media_content_connect()
394  * @see media_face_cb()
395  * @see media_filter_create()
396  */
397 int media_face_foreach_face_from_db(filter_h filter, media_face_cb callback, void *user_data) TIZEN_DEPRECATED_API;
398
399 /**
400  * @}
401  */
402
403 #ifdef __cplusplus
404 }
405 #endif /* __cplusplus */
406
407 #endif /* __TIZEN_CONTENT_MEDIA_FACE_H__ */