Tizen Native API
7.0
|
The Media Face Information API provides functions to manage the face information in the image files.
Required Header
#include <media_content.h>
Overview
The Face Information API provides functions to manage the face information such as face id, face coordinates in the image files.
Functions | |
int | media_face_clone (media_face_h *dst, media_face_h src) |
Clones the media face handle. | |
int | media_face_destroy (media_face_h face) |
Destroys the media face handle. | |
int | media_face_get_face_id (media_face_h face, char **face_id) |
Gets the face id from the media face handle. | |
int | media_face_get_media_id (media_face_h face, char **media_id) |
Gets the media id from the media face handle. | |
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) |
Gets the face's rectangle from the media face handle. | |
int | media_face_get_orientation (media_face_h face, media_content_orientation_e *orientation) |
Gets the orientation from the media face handle. | |
int | media_face_get_tag (media_face_h face, char **tag) |
Gets the tag from the media face handle. | |
int | media_face_create (const char *media_id, media_face_h *face) |
Creates the media face handle. | |
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) |
Sets the face rectangle of the media face handle. | |
int | media_face_set_orientation (media_face_h face, media_content_orientation_e orientation) |
Sets the orientation of the media face handle. | |
int | media_face_set_tag (media_face_h face, const char *tag) |
Sets the tag of the media face handle. | |
int | media_face_insert_to_db (media_face_h face) |
Inserts a new face in the media database. | |
int | media_face_update_to_db (media_face_h face) |
Updates the face details to the media database. | |
int | media_face_delete_from_db (const char *face_id) |
Deletes the face with given face id from the media database. | |
int | media_face_get_face_count_from_db (filter_h filter, int *face_count) |
Gets the number of media faces with an optional filter from the media database. | |
int | media_face_foreach_face_from_db (filter_h filter, media_face_cb callback, void *user_data) |
Iterates through the faces with an optional filter from the media database. | |
Typedefs | |
typedef void * | media_face_h |
The structure type for the Media face handle. | |
typedef bool(* | media_face_cb )(media_face_h face, void *user_data) |
Called for every face in the obtained list of face. |
Typedef Documentation
typedef bool(* media_face_cb)(media_face_h face, void *user_data) |
Called for every face in the obtained list of face.
Iterates over a media face list.
- Since :
- 3.0
- Remarks:
- You should not destroy face returned by this function.
The callback is called in the main loop.
- Parameters:
-
[in] face The handle of the media face [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop, otherwisefalse
to break out of the loop
- Precondition:
- media_info_foreach_face_from_db() will invoke this function.
- See also:
- media_info_foreach_face_from_db()
typedef void* media_face_h |
The structure type for the Media face handle.
- Since :
- 3.0
Function Documentation
int media_face_clone | ( | media_face_h * | dst, |
media_face_h | src | ||
) |
Clones the media face handle.
This function copies the media face handle from a source to destination. There is no media_face_create() function. The media_face_h is created internally and available through media face foreach function such as media_face_foreach_face_from_db(). To use this handle outside of these foreach functions, use this function.
- Since :
- 3.0
- Remarks:
- The dst should be released using media_face_destroy().
- Parameters:
-
[out] dst The destination handle to the media face [in] src The source handle to the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
int media_face_create | ( | const char * | media_id, |
media_face_h * | face | ||
) |
Creates the media face handle.
- Since :
- 3.0
- Remarks:
- The face should be released using media_face_destroy().
Since 5.5, this function supports only image type.
- Parameters:
-
[in] media_id The media ID [out] face The media face handle
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- media_face_destroy()
int media_face_delete_from_db | ( | const char * | face_id | ) |
Deletes the face with given face id from the media database.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/content.write
- Parameters:
-
[in] face_id The ID of the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy MEDIA_CONTENT_ERROR_NETWORK Network fail
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- See also:
- media_content_connect()
int media_face_destroy | ( | media_face_h | face | ) |
Destroys the media face handle.
Function frees all resources related to media face handle. This handle no longer can be used to perform any operations. New handle has to be created before next usage.
- Since :
- 3.0
- Parameters:
-
[in] face The media face handle
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- Precondition:
- Get copy of media face handle by calling media_face_clone() or Get media face handle by calling media_info_foreach_face_from_db()
- See also:
- media_face_clone()
int media_face_foreach_face_from_db | ( | filter_h | filter, |
media_face_cb | callback, | ||
void * | user_data | ||
) |
Iterates through the faces with an optional filter from the media database.
This function gets all faces associated with the given filter and calls callback for every retrieved media face. If NULL
is passed to the filter, then no filtering is applied.
- Since :
- 4.0
- Parameters:
-
[in] filter The handle to the media filter [in] callback The callback function to be invoked [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- Postcondition:
- This function invokes media_face_cb().
int media_face_get_face_count_from_db | ( | filter_h | filter, |
int * | face_count | ||
) |
Gets the number of media faces with an optional filter from the media database.
- Since :
- 4.0
- Parameters:
-
[in] filter The handle to the media filter [out] face_count The count of the media faces
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
- Precondition:
- This function requires opened connection to content service by media_content_connect().
int media_face_get_face_id | ( | media_face_h | face, |
char ** | face_id | ||
) |
Gets the face id from the media face handle.
- Since :
- 3.0
- Remarks:
- The face_id should be released using free().
- Parameters:
-
[in] face The media face handle [out] face_id The ID of the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
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 | ||
) |
Gets the face's rectangle from the media face handle.
This function can get the face's rectangle information. returned rectangle information includes the orientation value.
- Since :
- 3.0
- Parameters:
-
[in] face The media face handle [out] rect_x The x position of the media face [out] rect_y The y position of the media face [out] rect_w The width of the media face [out] rect_h The height of the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int media_face_get_media_id | ( | media_face_h | face, |
char ** | media_id | ||
) |
Gets the media id from the media face handle.
- Since :
- 3.0
- Remarks:
- The media_id should be released using free().
- Parameters:
-
[in] face The media face handle [out] media_id The media ID
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int media_face_get_orientation | ( | media_face_h | face, |
media_content_orientation_e * | orientation | ||
) |
Gets the orientation from the media face handle.
This function can get the orientation value from the original image.
- Since :
- 3.0
- Parameters:
-
[in] face The media face handle [out] orientation The orientation of the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int media_face_get_tag | ( | media_face_h | face, |
char ** | tag | ||
) |
Gets the tag from the media face handle.
- Since :
- 3.0
- Remarks:
- The tag should be released using free().
- Parameters:
-
[in] face The media face handle [out] tag The tag of the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
int media_face_insert_to_db | ( | media_face_h | face | ) |
Inserts a new face in the media database.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/content.write
- Remarks:
- The face should be released using media_face_destroy().
- Parameters:
-
[in] face The media face handle
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy MEDIA_CONTENT_ERROR_NETWORK Network fail
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 | ||
) |
Sets the face rectangle of the media face handle.
- Since :
- 3.0
- Parameters:
-
[in] face The media face handle [in] rect_x The integer to set as a position x of face rectangle [in] rect_y The integer to set as a position y of face rectangle [in] rect_w The integer to set as a width of face rectangle [in] rect_h The integer to set as a height of face rectangle
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- Postcondition:
- media_face_insert_to_db()
- media_face_update_to_db()
int media_face_set_orientation | ( | media_face_h | face, |
media_content_orientation_e | orientation | ||
) |
Sets the orientation of the media face handle.
This function may set the value of the original image orientation.
- Since :
- 3.0
- Parameters:
-
[in] face The media face handle [in] orientation The integer to set as an orientation
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- Postcondition:
- media_face_insert_to_db()
- media_face_update_to_db()
int media_face_set_tag | ( | media_face_h | face, |
const char * | tag | ||
) |
Sets the tag of the media face handle.
- Since :
- 3.0
- Parameters:
-
[in] face The media face handle [in] tag The tag of the media face
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- Postcondition:
- media_face_insert_to_db()
- media_face_update_to_db()
int media_face_update_to_db | ( | media_face_h | face | ) |
Updates the face details to the media database.
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 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 the given face attributes in the media database.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/content.write
- Parameters:
-
[in] face The media face handle to update
- Returns:
- 0 on success, otherwise a negative error value.
- Return values:
-
MEDIA_CONTENT_ERROR_NONE Successful MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy MEDIA_CONTENT_ERROR_NETWORK Network fail
- Precondition:
- This function requires opened connection to content service by media_content_connect().