Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Media file format and description indexing engine. More...
Go to the source code of this file.
Macros | |
#define | ast_media_index_update(index, variant) ast_media_index_update_for_file(index, variant, NULL) |
Update a media index. More... | |
Functions | |
const char * | ast_media_get_description (struct ast_media_index *index, const char *filename, const char *variant) |
Get the description for a media file. More... | |
struct ast_format_cap * | ast_media_get_format_cap (struct ast_media_index *index, const char *filename, const char *variant) |
Get the ast_format_cap for a media file. More... | |
struct ao2_container * | ast_media_get_media (struct ast_media_index *index) |
Get the a container of all media available on the system. More... | |
struct ao2_container * | ast_media_get_variants (struct ast_media_index *index, const char *filename) |
Get the languages in which a media file is available. More... | |
struct ast_media_index * | ast_media_index_create (const char *base_dir) |
Creates a new media index. More... | |
int | ast_media_index_update_for_file (struct ast_media_index *index, const char *variant, const char *filename) |
Update a media index for a specific sound file. More... | |
Media file format and description indexing engine.
Definition in file media_index.h.
#define ast_media_index_update | ( | index, | |
variant | |||
) | ast_media_index_update_for_file(index, variant, NULL) |
Update a media index.
index | Media index in which to query information |
variant | Media variant for which to get the description |
non-zero | on error |
Definition at line 121 of file media_index.h.
const char * ast_media_get_description | ( | struct ast_media_index * | index, |
const char * | filename, | ||
const char * | variant | ||
) |
Get the description for a media file.
index | Media index in which to query information |
filename | Name of the file for which to get the description |
variant | Media variant for which to get the description |
NULL | if not found |
Definition at line 230 of file media_index.c.
References ao2_cleanup, ast_strlen_zero(), find_variant(), NULL, RAII_VAR, and media_variant::variant.
Referenced by create_sound_blob(), and show_sound_info_cb().
struct ast_format_cap * ast_media_get_format_cap | ( | struct ast_media_index * | index, |
const char * | filename, | ||
const char * | variant | ||
) |
Get the ast_format_cap for a media file.
index | Media index in which to query information |
filename | Name of the file for which to get the description |
variant | Media variant for which to get the description |
NULL | if not found |
Definition at line 245 of file media_index.c.
References ao2_cleanup, ast_format_cap_alloc, ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, AST_MEDIA_TYPE_UNKNOWN, ast_strlen_zero(), find_variant(), ast_format_cap::formats, NULL, and RAII_VAR.
Referenced by add_format_information_cb(), and show_sound_info_cb().
struct ao2_container * ast_media_get_media | ( | struct ast_media_index * | index | ) |
Get the a container of all media available on the system.
index | Media index in which to query information |
NULL | on error |
Definition at line 307 of file media_index.c.
References add_media_cb(), ao2_callback, ao2_cleanup, ao2_ref, ast_str_container_alloc, ast_media_index::index, INDEX_BUCKETS, ast_media_index::media_list_cache, NULL, OBJ_NODATA, and RAII_VAR.
Referenced by ast_ari_sounds_list(), handle_cli_sound_show(), and handle_cli_sounds_show().
struct ao2_container * ast_media_get_variants | ( | struct ast_media_index * | index, |
const char * | filename | ||
) |
Get the languages in which a media file is available.
index | Media index in which to query information |
filename | Name of the file for which to get available languages |
NULL | on error |
Definition at line 274 of file media_index.c.
References add_variant_cb(), ao2_callback, ao2_cleanup, ao2_find, ao2_ref, ast_str_container_alloc, ast_media_index::index, sip_to_pjsip::info(), NULL, OBJ_KEY, OBJ_NODATA, RAII_VAR, and VARIANT_BUCKETS.
Referenced by create_sound_blob(), and handle_cli_sound_show().
struct ast_media_index * ast_media_index_create | ( | const char * | base_dir | ) |
Creates a new media index.
base_dir | Base directory for indexing |
NULL | on error |
A | new AO2 refcounted media index |
Definition at line 162 of file media_index.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ast_media_index::base_dir, ast_media_index::index, INDEX_BUCKETS, media_index_dtor(), media_info_cmp(), media_info_hash(), and NULL.
Referenced by ast_sounds_get_index_for_file().
int ast_media_index_update_for_file | ( | struct ast_media_index * | index, |
const char * | variant, | ||
const char * | filename | ||
) |
Update a media index for a specific sound file.
index | Media index in which to query information |
variant | Media variant for which to get the description |
filename | Sound file name without extension |
non-zero | on error |
Definition at line 587 of file media_index.c.
References ast_alloca, ast_debug, ast_file_read_dirs(), ast_strlen_zero(), ast_tvdiff_us(), ast_media_index::base_dir, read_dirs_data::dirname_len, end, read_dirs_data::index, NULL, read_dirs_cb(), S_OR, read_dirs_data::search_filename, and read_dirs_data::search_variant.
Referenced by update_index_cb().