Tizen Native API
5.5
|
The Media Filter API provides functions to manage media filters.
#include <media_content.h>
A Media filter is required for filtering information associated with media Folder, Tag, Audio, Bookmark and Media Information on basis of details like offset, count, order and condition for searching.
Media Filter API provides functions for creating and destroying media filters.
It provide functions to set properties and also provide functions for getting filter properties associated with a given media filter.
Setting media filter properties helps to limit the number of filtered items as following:
The Media Filter API provides functions for creating and destroying media filters.
It provide functions to set and get properties of the filter associated with a given media filter.
For creating a media filter (filter_h), call media_filter_create() function and call media_filter_destroy() function for destroying an existing filter.
For setting filter properties call the respective set functions e.g. to set offset position, call media_filter_set_offset() function and call media_filter_set_condition() function to set the condition like an sql "where" clause.
Searchable expression can use one of the following forms:
Note that if you want to set qoutation(" ' " or " " ") as value of LIKE operator, you should use two times.(" '' " or " "" ") \n
And the optional ESCAPE clause is supported. Both percent symbol("%") and underscore symbol("_") are used in the LIKE pattern.
If these characters are used as value of LIKE operation, then the expression following the ESCAPE clause of sqlite will be ignored.
For example,
Similarly, call respective get function to get filter properties e.g. call media_filter_get_condition() function to get condition of the media filter and call media_filter_get_order() function to get order (media_content_order_e) of the filtered items and so on.
You can set the filter as follows.
#include <stdio.h> #include <string.h> #include <media_content.h> #define MAX_QUERY_LEN 512 #define DLOG_TAG "media-content-test" filter_h g_filter = NULL; int create_filter() { int ret = MEDIA_CONTENT_ERROR_NONE; char condition[MAX_QUERY_LEN] = {0,}; snprintf(condition,sizeof(condition),"%s = 0",MEDIA_TYPE); ret = media_filter_create(&g_filter); ret = media_filter_set_condition(g_filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT); ret = media_filter_set_order(g_filter, MEDIA_CONTENT_ORDER_DESC, MEDIA_ARTIST, MEDIA_CONTENT_COLLATE_DEFAULT); return ret; }
And you can use the created filter as follows.
int get_media_count() { int ret = MEDIA_CONTENT_ERROR_NONE; int media_cnt = 0; ret = media_info_get_media_count_from_db(g_filter, &media_cnt); dlog_print(DLOG_DEBUG, DLOG_TAG, "media count [%d]\n", media_cnt); return ret; }
Functions | |
int | media_filter_create (filter_h *filter) |
Creates a media filter handle. | |
int | media_filter_destroy (filter_h filter) |
Destroys a media filter handle. | |
int | media_filter_set_offset (filter_h filter, int offset, int count) |
Sets the media filter offset and count. | |
int | media_filter_set_condition (filter_h filter, const char *condition, media_content_collation_e collate_type) |
Sets the condition for the given filter. | |
int | media_filter_set_order (filter_h filter, media_content_order_e order_type, const char *order_keyword, media_content_collation_e collate_type) |
Sets the media filter content order_type and order_keyword i.e. either descending or ascending. | |
int | media_filter_set_storage (filter_h filter, const char *storage_id) TIZEN_DEPRECATED_API |
Sets the storage_id for the given filter. | |
int | media_filter_get_offset (filter_h filter, int *offset, int *count) |
Gets the offset and count for the given filter used to limit the number of items returned. | |
int | media_filter_get_condition (filter_h filter, char **condition, media_content_collation_e *collate_type) |
Gets the condition for the given filter. | |
int | media_filter_get_order (filter_h filter, media_content_order_e *order_type, char **order_keyword, media_content_collation_e *collate_type) |
Gets the media filter's content order_type and order_keyword i.e. either descending or ascending. | |
int | media_filter_get_storage (filter_h filter, char **storage_id) TIZEN_DEPRECATED_API |
Gets the storage_id for given filter. | |
Typedefs | |
typedef struct filter_s * | filter_h |
The structure type for the Media filter handle. | |
Defines | |
#define | MEDIA_ID "MEDIA_ID" |
Media ID. | |
#define | MEDIA_PATH "MEDIA_PATH" |
Media full path. | |
#define | MEDIA_DISPLAY_NAME "MEDIA_DISPLAY_NAME" |
The file name including the extension. | |
#define | MEDIA_TYPE "MEDIA_TYPE" |
Media type. | |
#define | MEDIA_MIME_TYPE "MEDIA_MIME_TYPE" |
Media MIME type. | |
#define | MEDIA_SIZE "MEDIA_SIZE" |
Media file size. | |
#define | MEDIA_ADDED_TIME "MEDIA_ADDED_TIME" |
The time that content file was first added to media database. | |
#define | MEDIA_MODIFIED_TIME "MEDIA_MODIFIED_TIME" |
The last modification time provided by the file system. | |
#define | MEDIA_TIMELINE "MEDIA_TIMELINE" |
Media created time. | |
#define | MEDIA_THUMBNAIL_PATH "MEDIA_THUMBNAIL_PATH" |
Media thumbnail path. | |
#define | MEDIA_TITLE "MEDIA_TITLE" |
Media title get from tag or file name. | |
#define | MEDIA_ALBUM "MEDIA_ALBUM" |
Media album name. | |
#define | MEDIA_ARTIST "MEDIA_ARTIST" |
Media artist. | |
#define | MEDIA_ALBUM_ARTIST "MEDIA_ALBUM_ARTIST" |
Media album artist. | |
#define | MEDIA_GENRE "MEDIA_GENRE" |
Media genre. | |
#define | MEDIA_COMPOSER "MEDIA_COMPOSER" |
Media composer. | |
#define | MEDIA_YEAR "MEDIA_YEAR" |
Media year. | |
#define | MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE" |
Media recorded date. | |
#define | MEDIA_COPYRIGHT "MEDIA_COPYRIGHT" |
Media copyright. | |
#define | MEDIA_TRACK_NUM "MEDIA_TRACK_NUM" |
Media track number. | |
#define | MEDIA_DESCRIPTION "MEDIA_DESCRIPTION" |
Media description. | |
#define | MEDIA_BITRATE "MEDIA_BITRATE" |
Media bitrate. | |
#define | MEDIA_BITPERSAMPLE "MEDIA_BITPERSAMPLE" |
Media bit per sample. | |
#define | MEDIA_SAMPLERATE "MEDIA_SAMPLERATE" |
Media sample rate. | |
#define | MEDIA_CHANNEL "MEDIA_CHANNEL" |
Media channel. | |
#define | MEDIA_DURATION "MEDIA_DURATION" |
Media duration. | |
#define | MEDIA_LONGITUDE "MEDIA_LONGITUDE" |
Media longitude. | |
#define | MEDIA_LATITUDE "MEDIA_LATITUDE" |
Media latitude. | |
#define | MEDIA_ALTITUDE "MEDIA_ALTITUDE" |
Media altitude. | |
#define | MEDIA_WIDTH "MEDIA_WIDTH" |
Media width. | |
#define | MEDIA_HEIGHT "MEDIA_HEIGHT" |
Media height. | |
#define | MEDIA_DATETAKEN "MEDIA_DATETAKEN" |
Media datetaken. | |
#define | MEDIA_ORIENTATION "MEDIA_ORIENTATION" |
Media orientation. | |
#define | MEDIA_RATING "MEDIA_RATING" |
Media rating. | |
#define | MEDIA_FAVOURITE "MEDIA_FAVOURITE" |
The time to register favourite. | |
#define | MEDIA_IS_DRM "MEDIA_IS_DRM" |
Is DRM. | |
#define | MEDIA_STORAGE_TYPE "MEDIA_STORAGE_TYPE" |
Media storage. | |
#define | MEDIA_EXPOSURE_TIME "MEDIA_EXPOSURE_TIME" |
Media exposure time. | |
#define | MEDIA_FNUMBER "MEDIA_FNUMBER" |
Media fnumber. | |
#define | MEDIA_ISO "MEDIA_ISO" |
Media ISO. | |
#define | MEDIA_MODEL "MEDIA_MODEL" |
Media model. | |
#define | MEDIA_FILE_NAME_PINYIN "MEDIA_FILE_NAME_PINYIN" |
Media file name pinyin. | |
#define | MEDIA_TITLE_PINYIN "MEDIA_TITLE_PINYIN" |
Media title pinyin. | |
#define | MEDIA_ALBUM_PINYIN "MEDIA_ALBUM_PINYIN" |
Media album pinyin. | |
#define | MEDIA_ARTIST_PINYIN "MEDIA_ARTIST_PINYIN" |
Media artist pinyin. | |
#define | MEDIA_ALBUM_ARTIST_PINYIN "MEDIA_ALBUM_ARTIST_PINYIN" |
Media album artist pinyin. | |
#define | MEDIA_GENRE_PINYIN "MEDIA_GENRE_PINYIN" |
Media genre pinyin. | |
#define | MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN" |
Media composer pinyin. | |
#define | MEDIA_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN" |
Media copyright pinyin. | |
#define | MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN" |
Media description pinyin. | |
#define | MEDIA_360 "MEDIA_360" |
Virtual Reality content. | |
#define | FOLDER_ID "FOLDER_ID" |
Folder ID. | |
#define | FOLDER_PATH "FOLDER_PATH" |
Folder full path. | |
#define | FOLDER_NAME "FOLDER_NAME" |
Folder base name. | |
#define | FOLDER_STORAGE_TYPE "FOLDER_STORAGE_TYPE" |
Folder storage. | |
#define | FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN" |
Folder base name pinyin. | |
#define | PLAYLIST_NAME "PLAYLIST_NAME" |
Playlist name. | |
#define | MEDIA_PLAYLIST_ID "PLAYLIST_ID" |
Playlist id. | |
#define | PLAYLIST_MEMBER_ORDER "PLAYLIST_MEMBER_ORDER" |
Playlist member order. | |
#define | PLAYLIST_MEDIA_COUNT "PLAYLIST_MEDIA_COUNT" |
Media count in playlist. | |
#define | TAG_NAME "TAG_NAME" |
Tag name. | |
#define | MEDIA_TAG_ID "TAG_ID" |
Tag id. | |
#define | TAG_MEDIA_COUNT "TAG_MEDIA_COUNT" |
Media count in tag. | |
#define | BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME" |
Bookmark marked time. | |
#define | MEDIA_BOOKMARK_ID "BOOKMARK_ID" |
Bookmark id. | |
#define | BOOKMARK_NAME "BOOKMARK_NAME" |
Bookmark name. | |
#define | MEDIA_STORAGE_ID "STORAGE_ID" |
Storage ID. | |
#define | MEDIA_STORAGE_PATH "STORAGE_PATH" |
Storage path. | |
#define | MEDIA_FACE_TAG "MEDIA_FACE_TAG" |
Face tag. | |
#define | MEDIA_FACE_ID "MEDIA_FACE_ID" |
Face id. |
#define BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME" |
Bookmark marked time.
You can use above define to set the condition of bookmark filter and order keyword.
#define BOOKMARK_NAME "BOOKMARK_NAME" |
Bookmark name.
You can use above define to set the condition of bookmark filter and order keyword.
#define FOLDER_ID "FOLDER_ID" |
Folder ID.
You can use above define to set the condition of folder filter and order keyword.
#define FOLDER_NAME "FOLDER_NAME" |
Folder base name.
You can use above define to set the condition of folder filter and order keyword.
#define FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN" |
Folder base name pinyin.
You can use above define to set the condition of folder filter and order keyword.
#define FOLDER_PATH "FOLDER_PATH" |
Folder full path.
You can use above define to set the condition of folder filter and order keyword.
#define FOLDER_STORAGE_TYPE "FOLDER_STORAGE_TYPE" |
Folder storage.
There are 2 types:
0-internal storage, 1-external storage
You can use above define to set the condition of folder filter and order keyword.
#define MEDIA_360 "MEDIA_360" |
Virtual Reality content.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ADDED_TIME "MEDIA_ADDED_TIME" |
The time that content file was first added to media database.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM "MEDIA_ALBUM" |
Media album name.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM_ARTIST "MEDIA_ALBUM_ARTIST" |
Media album artist.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM_ARTIST_PINYIN "MEDIA_ALBUM_ARTIST_PINYIN" |
Media album artist pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM_PINYIN "MEDIA_ALBUM_PINYIN" |
Media album pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALTITUDE "MEDIA_ALTITUDE" |
Media altitude.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ARTIST "MEDIA_ARTIST" |
Media artist.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ARTIST_PINYIN "MEDIA_ARTIST_PINYIN" |
Media artist pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_BITPERSAMPLE "MEDIA_BITPERSAMPLE" |
Media bit per sample.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_BITRATE "MEDIA_BITRATE" |
Media bitrate.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_BOOKMARK_ID "BOOKMARK_ID" |
Bookmark id.
You can use above define to set the condition of bookmark filter and order keyword.
#define MEDIA_CHANNEL "MEDIA_CHANNEL" |
Media channel.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COMPOSER "MEDIA_COMPOSER" |
Media composer.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN" |
Media composer pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COPYRIGHT "MEDIA_COPYRIGHT" |
Media copyright.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN" |
Media copyright pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DATETAKEN "MEDIA_DATETAKEN" |
Media datetaken.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DESCRIPTION "MEDIA_DESCRIPTION" |
Media description.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN" |
Media description pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DISPLAY_NAME "MEDIA_DISPLAY_NAME" |
The file name including the extension.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DURATION "MEDIA_DURATION" |
Media duration.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_EXPOSURE_TIME "MEDIA_EXPOSURE_TIME" |
Media exposure time.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_FACE_ID "MEDIA_FACE_ID" |
Face id.
You can use above define to set the condition of face filter and order keyword.
#define MEDIA_FACE_TAG "MEDIA_FACE_TAG" |
Face tag.
You can use above define to set the condition of face filter and order keyword.
#define MEDIA_FAVOURITE "MEDIA_FAVOURITE" |
The time to register favourite.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_FILE_NAME_PINYIN "MEDIA_FILE_NAME_PINYIN" |
Media file name pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_FNUMBER "MEDIA_FNUMBER" |
Media fnumber.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_GENRE "MEDIA_GENRE" |
Media genre.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_GENRE_PINYIN "MEDIA_GENRE_PINYIN" |
Media genre pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_HEIGHT "MEDIA_HEIGHT" |
Media height.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ID "MEDIA_ID" |
Media ID.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_IS_DRM "MEDIA_IS_DRM" |
Is DRM.
There are 2 types:
0-not drm, 1-drm
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ISO "MEDIA_ISO" |
Media ISO.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LATITUDE "MEDIA_LATITUDE" |
Media latitude.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LONGITUDE "MEDIA_LONGITUDE" |
Media longitude.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_MIME_TYPE "MEDIA_MIME_TYPE" |
Media MIME type.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_MODEL "MEDIA_MODEL" |
Media model.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_MODIFIED_TIME "MEDIA_MODIFIED_TIME" |
The last modification time provided by the file system.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ORIENTATION "MEDIA_ORIENTATION" |
Media orientation.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_PATH "MEDIA_PATH" |
Media full path.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_PLAYLIST_ID "PLAYLIST_ID" |
Playlist id.
You can use above define to set the condition of playlist filter and order keyword.
#define MEDIA_RATING "MEDIA_RATING" |
Media rating.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE" |
Media recorded date.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_SAMPLERATE "MEDIA_SAMPLERATE" |
Media sample rate.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_SIZE "MEDIA_SIZE" |
Media file size.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_STORAGE_ID "STORAGE_ID" |
Storage ID.
You can use above define to set the condition of storage filter and order keyword.
#define MEDIA_STORAGE_PATH "STORAGE_PATH" |
Storage path.
You can use above define to set the condition of storage filter and order keyword.
#define MEDIA_STORAGE_TYPE "MEDIA_STORAGE_TYPE" |
Media storage.
There are 3 types:
0-internal storage, 1-SD card, 2-USB storage
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TAG_ID "TAG_ID" |
Tag id.
You can use above define to set the condition of tag filter and order keyword.
#define MEDIA_THUMBNAIL_PATH "MEDIA_THUMBNAIL_PATH" |
Media thumbnail path.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TIMELINE "MEDIA_TIMELINE" |
Media created time.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TITLE "MEDIA_TITLE" |
Media title get from tag or file name.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TITLE_PINYIN "MEDIA_TITLE_PINYIN" |
Media title pinyin.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TRACK_NUM "MEDIA_TRACK_NUM" |
Media track number.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TYPE "MEDIA_TYPE" |
Media type.
There are 5 media types:
0-image, 1-video, 2-sound, 3-music, 4-other
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_WIDTH "MEDIA_WIDTH" |
Media width.
You can use above define to set the condition of media filter and order keyword.
#define MEDIA_YEAR "MEDIA_YEAR" |
Media year.
You can use above define to set the condition of media filter and order keyword.
#define PLAYLIST_MEDIA_COUNT "PLAYLIST_MEDIA_COUNT" |
Media count in playlist.
You can use above define to set the condition of playlist filter and order keyword.
#define PLAYLIST_MEMBER_ORDER "PLAYLIST_MEMBER_ORDER" |
Playlist member order.
You can use above define to set the condition of playlist filter and order keyword.
#define PLAYLIST_NAME "PLAYLIST_NAME" |
Playlist name.
You can use above define to set the condition of playlist filter and order keyword.
#define TAG_MEDIA_COUNT "TAG_MEDIA_COUNT" |
Media count in tag.
You can use above define to set the condition of tag filter and order keyword.
#define TAG_NAME "TAG_NAME" |
Tag name.
You can use above define to set the condition of tag filter and order keyword.
typedef struct filter_s* filter_h |
The structure type for the Media filter handle.
int media_filter_create | ( | filter_h * | filter | ) |
Creates a media filter handle.
This function creates a media filter handle. The handle can be used to get the filtered information based on filter properties i.e. offset, count, condition for searching and order.
[out] | filter | The handle to the media filter |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int media_filter_destroy | ( | filter_h | filter | ) |
Destroys a media filter handle.
The function frees all resources related to the media filter handle. The filter handle no longer can be used to perform any operations. A new filter handle has to be created before the next usage.
[in] | filter | The handle to the media filter |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_get_condition | ( | filter_h | filter, |
char ** | condition, | ||
media_content_collation_e * | collate_type | ||
) |
Gets the condition for the given filter.
[in] | filter | The handle to the media filter |
[out] | condition | The condition which is used WHERE clause on a query |
[out] | collate_type | The collate type for comparing two strings |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_get_offset | ( | filter_h | filter, |
int * | offset, | ||
int * | count | ||
) |
Gets the offset and count for the given filter used to limit the number of items returned.
[in] | filter | The handle to the media filter |
[out] | offset | The start position of the given media filter (Starting from zero) |
[out] | count | The number of items to be searched with respect to the offset |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_get_order | ( | filter_h | filter, |
media_content_order_e * | order_type, | ||
char ** | order_keyword, | ||
media_content_collation_e * | collate_type | ||
) |
Gets the media filter's content order_type and order_keyword i.e. either descending or ascending.
[in] | filter | The handle to the media filter |
[out] | order_type | The search order type |
[out] | order_keyword | The search order keyword |
[out] | collate_type | The collate type for comparing two strings |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_get_storage | ( | filter_h | filter, |
char ** | storage_id | ||
) |
Gets the storage_id for given filter.
[in] | filter | The handle to the media filter |
[out] | storage_id | The ID of the media storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_set_condition | ( | filter_h | filter, |
const char * | condition, | ||
media_content_collation_e | collate_type | ||
) |
Sets the condition for the given filter.
[in] | filter | The handle to the media filter |
[in] | condition | The condition which is used WHERE clause on a query |
[in] | collate_type | The collate type for comparing two strings |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_set_offset | ( | filter_h | filter, |
int | offset, | ||
int | count | ||
) |
Sets the media filter offset and count.
This function sets the offset and count for the given filter used to limit number of items returned. For example, if you set the offset as 10
and count as 5
, then only searched data from 10
to 14
will be returned when the filter is used with foreach functions.
[in] | filter | The handle to the media filter |
[in] | offset | The start position of the given media filter (Starting from zero) |
[in] | count | The number of items to be searched with respect to the offset |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_set_order | ( | filter_h | filter, |
media_content_order_e | order_type, | ||
const char * | order_keyword, | ||
media_content_collation_e | collate_type | ||
) |
Sets the media filter content order_type and order_keyword i.e. either descending or ascending.
[in] | filter | The handle to the media filter |
[in] | order_type | The search order type |
[in] | order_keyword | The search order keyword |
[in] | collate_type | The collate type for comparing two strings |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_filter_set_storage | ( | filter_h | filter, |
const char * | storage_id | ||
) |
Sets the storage_id for the given filter.
You can use this function when you want to search items only in the specific storage
[in] | filter | The handle to the media filter |
[in] | storage_id | The ID of the media storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |