Tizen Native API  3.0

The Media Filter API provides functions to manage media filters.

Required Header

#include <media_content.h>

Overview

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:

  • Offset - Used to set starting position of the filter's search
  • Count - Used to set number of items to be searched from offset
  • Condition - Used to set keyword which user want to search
  • Order - Used to set type of media to be ordered by the filter


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:

  • column = value
  • column > value
  • column >= value
  • column < value
  • column <= value
  • value = column
  • * - value > column
  • value >= column
  • value < column
  • value <= column
  • column IN (value)
  • column IN (value-list)
  • column NOT IN (value)
  • column NOT IN (value-list)
  • column LIKE value
  • expression1 AND expression2 OR expression3


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 caluse of sqlite will be ignored.

For example,

  • column LIKE ('#') ESCAPE('#') - "#" is escape character, it will be ignored.

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.

Example

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 and order keyword i.e. either descending or ascending.
int media_filter_set_storage (filter_h filter, const char *storage_id)
 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 and order keyword i.e. either descending or ascending.
int media_filter_get_storage (filter_h filter, char **storage_id)
 Get 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"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_PATH   "MEDIA_PATH"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DISPLAY_NAME   "MEDIA_DISPLAY_NAME"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TYPE   "MEDIA_TYPE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_MIME_TYPE   "MEDIA_MIME_TYPE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_SIZE   "MEDIA_SIZE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ADDED_TIME   "MEDIA_ADDED_TIME"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_MODIFIED_TIME   "MEDIA_MODIFIED_TIME"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TIMELINE   "MEDIA_TIMELINE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_THUMBNAIL_PATH   "MEDIA_THUMBNAIL_PATH"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TITLE   "MEDIA_TITLE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM   "MEDIA_ALBUM"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ARTIST   "MEDIA_ARTIST"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM_ARTIST   "MEDIA_ALBUM_ARTIST"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_GENRE   "MEDIA_GENRE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COMPOSER   "MEDIA_COMPOSER"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_YEAR   "MEDIA_YEAR"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_RECORDED_DATE   "MEDIA_RECORDED_DATE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COPYRIGHT   "MEDIA_COPYRIGHT"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_TRACK_NUM   "MEDIA_TRACK_NUM"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DESCRIPTION   "MEDIA_DESCRIPTION"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_BITRATE   "MEDIA_BITRATE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_BITPERSAMPLE   "MEDIA_BITPERSAMPLE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_SAMPLERATE   "MEDIA_SAMPLERATE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_CHANNEL   "MEDIA_CHANNEL"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DURATION   "MEDIA_DURATION"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LONGITUDE   "MEDIA_LONGITUDE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LATITUDE   "MEDIA_LATITUDE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALTITUDE   "MEDIA_ALTITUDE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_WIDTH   "MEDIA_WIDTH"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_HEIGHT   "MEDIA_HEIGHT"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DATETAKEN   "MEDIA_DATETAKEN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ORIENTATION   "MEDIA_ORIENTATION"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_BURST_ID   "BURST_ID"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_PLAYED_COUNT   "MEDIA_PLAYED_COUNT"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LAST_PLAYED_TIME   "MEDIA_LAST_PLAYED_TIME"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LAST_PLAYED_POSITION   "MEDIA_LAST_PLAYED_POSITION"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_RATING   "MEDIA_RATING"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_FAVOURITE   "MEDIA_FAVOURITE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_AUTHOR   "MEDIA_AUTHOR"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_PROVIDER   "MEDIA_PROVIDER"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_CONTENT_NAME   "MEDIA_CONTENT_NAME"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_CATEGORY   "MEDIA_CATEGORY"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LOCATION_TAG   "MEDIA_LOCATION_TAG"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_AGE_RATING   "MEDIA_AGE_RATING"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_KEYWORD   "MEDIA_KEYWORD"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_WEATHER   "MEDIA_WEATHER"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_IS_DRM   "MEDIA_IS_DRM"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_STORAGE_TYPE   "MEDIA_STORAGE_TYPE"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_EXPOSURE_TIME   "MEDIA_EXPOSURE_TIME"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_FNUMBER   "MEDIA_FNUMBER"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ISO   "MEDIA_ISO"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_MODEL   "MEDIA_MODEL"
 You can use above define to set the condition of media filter and order keyword.
#define 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_TITLE_PINYIN   "MEDIA_TITLE_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ALBUM_PINYIN   "MEDIA_ALBUM_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_ARTIST_PINYIN   "MEDIA_ARTIST_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define 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_GENRE_PINYIN   "MEDIA_GENRE_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COMPOSER_PINYIN   "MEDIA_COMPOSER_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COPYRIGHT_PINYIN   "MEDIA_COPYRIGHT_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_DESCRIPTION_PINYIN   "MEDIA_DESCRIPTION_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_AUTHOR_PINYIN   "MEDIA_AUTHOR_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_PROVIDER_PINYIN   "MEDIA_PROVIDER_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_CONTENT_NAME_PINYIN   "MEDIA_CONTENT_NAME_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_CATEGORY_PINYIN   "MEDIA_CATEGORY_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_LOCATION_TAG_PINYIN   "MEDIA_LOCATION_TAG_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_AGE_RATING_PINYIN   "MEDIA_AGE_RATING_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_KEYWORD_PINYIN   "MEDIA_KEYWORD_PINYIN"
 You can use above define to set the condition of media filter and order keyword.
#define MEDIA_360   "MEDIA_360"
 You can use above define to set the condition of media filter and order keyword.

Define Documentation

#define MEDIA_360   "MEDIA_360"

You can use above define to set the condition of media filter and order keyword.

Since :
3.0 Virtual Reality content
#define MEDIA_ADDED_TIME   "MEDIA_ADDED_TIME"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media added time
#define MEDIA_AGE_RATING   "MEDIA_AGE_RATING"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media age rating
#define MEDIA_AGE_RATING_PINYIN   "MEDIA_AGE_RATING_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media age rating pinyin
#define MEDIA_ALBUM   "MEDIA_ALBUM"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media album name
#define MEDIA_ALBUM_ARTIST   "MEDIA_ALBUM_ARTIST"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media album_artist
#define MEDIA_ALBUM_ARTIST_PINYIN   "MEDIA_ALBUM_ARTIST_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media album_artist pinyin
#define MEDIA_ALBUM_PINYIN   "MEDIA_ALBUM_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media album pinyin
#define MEDIA_ALTITUDE   "MEDIA_ALTITUDE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media altitude
#define MEDIA_ARTIST   "MEDIA_ARTIST"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media artist
#define MEDIA_ARTIST_PINYIN   "MEDIA_ARTIST_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media artist pinyin
#define MEDIA_AUTHOR   "MEDIA_AUTHOR"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media authore
#define MEDIA_AUTHOR_PINYIN   "MEDIA_AUTHOR_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media authore pinyin
#define MEDIA_BITPERSAMPLE   "MEDIA_BITPERSAMPLE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media bit per sample
#define MEDIA_BITRATE   "MEDIA_BITRATE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media bitrate
#define MEDIA_BURST_ID   "BURST_ID"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media burst ID
#define MEDIA_CATEGORY   "MEDIA_CATEGORY"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media category
#define MEDIA_CATEGORY_PINYIN   "MEDIA_CATEGORY_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media category pinyin
#define MEDIA_CHANNEL   "MEDIA_CHANNEL"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media channel
#define MEDIA_COMPOSER   "MEDIA_COMPOSER"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media composer
#define MEDIA_COMPOSER_PINYIN   "MEDIA_COMPOSER_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media composer pinyin
#define MEDIA_CONTENT_NAME   "MEDIA_CONTENT_NAME"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media content name
#define MEDIA_CONTENT_NAME_PINYIN   "MEDIA_CONTENT_NAME_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media content name pinyin
#define MEDIA_COPYRIGHT   "MEDIA_COPYRIGHT"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media copyright
#define MEDIA_COPYRIGHT_PINYIN   "MEDIA_COPYRIGHT_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media copyright pinyin
#define MEDIA_DATETAKEN   "MEDIA_DATETAKEN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media datetaken
#define MEDIA_DESCRIPTION   "MEDIA_DESCRIPTION"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media description
#define MEDIA_DESCRIPTION_PINYIN   "MEDIA_DESCRIPTION_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media description pinyin
#define MEDIA_DISPLAY_NAME   "MEDIA_DISPLAY_NAME"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media base name
#define MEDIA_DURATION   "MEDIA_DURATION"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media duration
#define MEDIA_EXPOSURE_TIME   "MEDIA_EXPOSURE_TIME"

You can use above define to set the condition of media filter and order keyword.

Since :
2.4 media exposure_time
#define MEDIA_FAVOURITE   "MEDIA_FAVOURITE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 The time to register favourite
#define MEDIA_FILE_NAME_PINYIN   "MEDIA_FILE_NAME_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media file name pinyin
#define MEDIA_FNUMBER   "MEDIA_FNUMBER"

You can use above define to set the condition of media filter and order keyword.

Since :
2.4 media fnumber
#define MEDIA_GENRE   "MEDIA_GENRE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media genre
#define MEDIA_GENRE_PINYIN   "MEDIA_GENRE_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media genre pinyin
#define MEDIA_HEIGHT   "MEDIA_HEIGHT"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media height
#define MEDIA_ID   "MEDIA_ID"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media ID
#define MEDIA_IS_DRM   "MEDIA_IS_DRM"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Is DRM. 0-not drm, 1-drm
#define MEDIA_ISO   "MEDIA_ISO"

You can use above define to set the condition of media filter and order keyword.

Since :
2.4 media iso
#define MEDIA_KEYWORD   "MEDIA_KEYWORD"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media keyword
#define MEDIA_KEYWORD_PINYIN   "MEDIA_KEYWORD_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media keyword pinyin
#define MEDIA_LAST_PLAYED_POSITION   "MEDIA_LAST_PLAYED_POSITION"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media last played position of file
#define MEDIA_LAST_PLAYED_TIME   "MEDIA_LAST_PLAYED_TIME"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media last played time
#define MEDIA_LATITUDE   "MEDIA_LATITUDE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media latitude
#define MEDIA_LOCATION_TAG   "MEDIA_LOCATION_TAG"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media location tag
#define MEDIA_LOCATION_TAG_PINYIN   "MEDIA_LOCATION_TAG_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media location tag pinyin
#define MEDIA_LONGITUDE   "MEDIA_LONGITUDE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media longitude
#define MEDIA_MIME_TYPE   "MEDIA_MIME_TYPE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media MIME type
#define MEDIA_MODEL   "MEDIA_MODEL"

You can use above define to set the condition of media filter and order keyword.

Since :
2.4 media model
#define MEDIA_MODIFIED_TIME   "MEDIA_MODIFIED_TIME"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media modified time
#define MEDIA_ORIENTATION   "MEDIA_ORIENTATION"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media orientation
#define MEDIA_PATH   "MEDIA_PATH"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media full path
#define MEDIA_PLAYED_COUNT   "MEDIA_PLAYED_COUNT"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media playedcount
#define MEDIA_PROVIDER   "MEDIA_PROVIDER"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media provider
#define MEDIA_PROVIDER_PINYIN   "MEDIA_PROVIDER_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media provider pinyin
#define MEDIA_RATING   "MEDIA_RATING"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media rating
#define MEDIA_RECORDED_DATE   "MEDIA_RECORDED_DATE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media recorded date
#define MEDIA_SAMPLERATE   "MEDIA_SAMPLERATE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media sample rate
#define MEDIA_SIZE   "MEDIA_SIZE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media MIME size
#define MEDIA_STORAGE_TYPE   "MEDIA_STORAGE_TYPE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media storage. 0-internal storage, 1-external storage
#define MEDIA_THUMBNAIL_PATH   "MEDIA_THUMBNAIL_PATH"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media thumbnail path
#define MEDIA_TIMELINE   "MEDIA_TIMELINE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media modified time
#define MEDIA_TITLE   "MEDIA_TITLE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media title get from tag or file name
#define MEDIA_TITLE_PINYIN   "MEDIA_TITLE_PINYIN"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media title pinyin
#define MEDIA_TRACK_NUM   "MEDIA_TRACK_NUM"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media track number
#define MEDIA_TYPE   "MEDIA_TYPE"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media type: 0-image, 1-video, 2-sound, 3-music, 4-other
#define MEDIA_WEATHER   "MEDIA_WEATHER"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media weather
#define MEDIA_WIDTH   "MEDIA_WIDTH"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media width
#define MEDIA_YEAR   "MEDIA_YEAR"

You can use above define to set the condition of media filter and order keyword.

Since :
2.3 Media year

Typedef Documentation

typedef struct filter_s* filter_h

The structure type for the Media filter handle.

Since :
2.3

Function Documentation

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.

Since :
2.3
Remarks:
You must release the filter handle using media_info_filter_destroy().
Parameters:
[out]filterA handle to the media filter
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_destroy()
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 operation. A new filter handle has to be created before the next usage.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
int media_filter_get_condition ( filter_h  filter,
char **  condition,
media_content_collation_e collate_type 
)

Gets the condition for the given filter.

Since :
2.3
Remarks:
You must release condition using free().
Parameters:
[in]filterThe handle to the media info filter
[out]conditionThe condition which is used WHERE clause on a query
[out]collate_typeThe collate type for comparing two strings
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
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.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
[out]offsetThe start position of the given filter (Starting from zero)
[out]countThe number of items to be searched with respect to the offset
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
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 and order keyword i.e. either descending or ascending.

Since :
2.3
Remarks:
You must release order_keyword using free().
Parameters:
[in]filterThe handle to the media filter
[out]order_typeThe search order type
[out]order_keywordThe search order keyword
[out]collate_typeThe collate type for comparing two strings
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
int media_filter_get_storage ( filter_h  filter,
char **  storage_id 
)

Get the storage id for given filter.

Since :
2.4
Remarks:
You must release storage_id using free().
Parameters:
[in]filterThe handle to media info filter
[out]storage_idThe storage_id which is used in filter
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
int media_filter_set_condition ( filter_h  filter,
const char *  condition,
media_content_collation_e  collate_type 
)

Sets the condition for the given filter.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
[in]conditionThe condition which is used WHERE clause on a query
[in]collate_typeThe collate type for comparing two strings
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
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.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
[in]offsetThe start position of the given filter (Starting from zero)
[in]countThe number of items to be searched with respect to the offset
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
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 and order keyword i.e. either descending or ascending.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
[in]order_typeThe search order type
[in]order_keywordThe search order keyword
[in]collate_typeThe collate type for comparing two strings
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()
int media_filter_set_storage ( filter_h  filter,
const char *  storage_id 
)

Sets the storage id for the given filter.

You can use this API when you want to search items only in the specific storage

Since :
2.4
Parameters:
[in]filterThe handle to the media filter
[in]storage_idThe storage_id for browsing or searching
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_PERMISSION_DENIEDPermission denied
See also:
media_filter_create()
media_filter_destroy()