Tizen Native API
3.0
|
The Media Bookmark Information API provides functions to manage bookmark information on the media items.
You can use above define to set the condition of bookmark filter and order keyword.
Required Header
#include <media_content.h>
Overview
A Bookmark allows you to mark interesting moment in a media(video and audio) to enable fast searching. The Bookmark Information API provides functions to get information about bookmarks associated with video and audio items.
API allows to:
- get and filter existing bookmarks
- insert new bookmarks
- delete bookmarks
For inserting a bookmark to media item, call media_bookmark_insert_to_db() function and for deleting already set bookmark from a media, call media_bookmark_delete_from_db() function. For retrieving time where the bookmark is placed on the media, call media_bookmark_get_marked_time() function.
Foreach Operations
FOREACH | CALLBACK | DESCRIPTION |
---|---|---|
media_info_foreach_bookmark_from_db() | media_bookmark_cb() | Iterates through bookmarks |
- Since :
- 2.3.1
Functions | |
int | media_bookmark_insert_to_db (const char *media_id, time_t time, const char *thumbnail_path) |
Inserts a new bookmark in media on the specified time offset to the media database. | |
int | media_bookmark_delete_from_db (int bookmark_id) |
Removes a media bookmark from the media database. | |
int | media_bookmark_get_bookmark_count_from_db (filter_h filter, int *bookmark_count) |
Gets the number of bookmarks with an optional filter from the media database. | |
int | media_bookmark_clone (media_bookmark_h *dst, media_bookmark_h src) |
Clones a media bookmark. | |
int | media_bookmark_destroy (media_bookmark_h bookmark) |
Destroys a media bookmark. | |
int | media_bookmark_get_bookmark_id (media_bookmark_h bookmark, int *bookmark_id) |
Gets the bookmark ID. | |
int | media_bookmark_get_marked_time (media_bookmark_h bookmark, time_t *marked_time) |
Gets the bookmark time marked parameter. | |
int | media_bookmark_get_thumbnail_path (media_bookmark_h bookmark, char **path) |
Gets the media bookmark thumbnail. | |
Typedefs | |
typedef struct media_bookmark_s * | media_bookmark_h |
The structure type for the Media bookmark handle. | |
typedef bool(* | media_bookmark_cb )(media_bookmark_h bookmark, void *user_data) |
Called for every bookmark in the obtained list of bookmarks. | |
Defines | |
#define | BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME" |
Define Documentation
#define BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME" |
Bookmark marked time
Typedef Documentation
typedef bool(* media_bookmark_cb)(media_bookmark_h bookmark, void *user_data) |
Called for every bookmark in the obtained list of bookmarks.
- Since :
- 2.3.1
Iterates over a bookmark list.
- Remarks:
- To use the bookmark outside this function, copy the handle with the media_bookmark_clone() function.
The callback is called in the main loop.
- Parameters:
-
[in] bookmark The handle to the video bookmark [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_bookmark_from_db() will invoke this function.
typedef struct media_bookmark_s* media_bookmark_h |
The structure type for the Media bookmark handle.
- Since :
- 2.3.1
Function Documentation
int media_bookmark_clone | ( | media_bookmark_h * | dst, |
media_bookmark_h | src | ||
) |
Clones a media bookmark.
This function copies the media bookmark handle from a source to destination. There is no media_bookmark_create() function. The media_bookmark_h is created internally and available through media bookmark foreach function such as media_info_foreach_bookmark_from_db(). To use this handle outside of these foreach functions, use this function.
- Since :
- 2.3.1
- Remarks:
- The destination handle must be released using media_bookmark_destroy().
- Parameters:
-
[out] dst The destination handle to media bookmark [in] src The source handle to media bookmark
- 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
int media_bookmark_delete_from_db | ( | int | bookmark_id | ) |
Removes a media bookmark from the media database.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/content.write
- Parameters:
-
[in] bookmark_id The ID of media bookmark
- 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_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 MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- This function requires opened connection to content service by media_content_connect().
int media_bookmark_destroy | ( | media_bookmark_h | bookmark | ) |
Destroys a media bookmark.
This function frees all the resources related to the bookmark handle. This handle no longer can be used to perform any operation. A new handle has to be created before the next use.
- Since :
- 2.3.1
- Parameters:
-
[in] bookmark The handle to media bookmark
- 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
- Precondition:
- Get copy of bookmark handle by calling media_bookmark_clone().
- See also:
- media_bookmark_clone()
int media_bookmark_get_bookmark_count_from_db | ( | filter_h | filter, |
int * | bookmark_count | ||
) |
Gets the number of bookmarks with an optional filter from the media database.
- Since :
- 2.3.1
- Parameters:
-
[in] filter The handle to the media filter [out] bookmark_count The count of the media bookmark
- 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 MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- See also:
- media_content_connect()
int media_bookmark_get_bookmark_id | ( | media_bookmark_h | bookmark, |
int * | bookmark_id | ||
) |
Gets the bookmark ID.
- Since :
- 2.3.1
- Parameters:
-
[in] bookmark The handle to media bookmark [out] bookmark_id The media bookmark ID
- 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
int media_bookmark_get_marked_time | ( | media_bookmark_h | bookmark, |
time_t * | marked_time | ||
) |
Gets the bookmark time marked parameter.
This function returns time offset in milliseconds from beginning of the movie on which bookmark was placed.
- Since :
- 2.3.1
- Parameters:
-
[in] bookmark The handle to media bookmark [out] marked_time The bookmark time offset (in milliseconds)
- 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
int media_bookmark_get_thumbnail_path | ( | media_bookmark_h | bookmark, |
char ** | path | ||
) |
Gets the media bookmark thumbnail.
- Since :
- 2.3.1
- Remarks:
- You must release path using free().
- Parameters:
-
[in] bookmark The handle to media bookmark [out] path The thumbnail path of media bookmark
- 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
int media_bookmark_insert_to_db | ( | const char * | media_id, |
time_t | time, | ||
const char * | thumbnail_path | ||
) |
Inserts a new bookmark in media on the specified time offset to the media database.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/content.write
- Parameters:
-
[in] media_id The media ID [in] time The bookmark time offset (in seconds) [in] thumbnail_path The thumbnail path of video bookmark\ n If the media type is audio, then thumbnail is null.
- 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_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 MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
- Precondition:
- This function requires opened connection to content service by media_content_connect().