Asterisk - The Open Source Telephony Project
18.5.0
|
Image Management. More...
#include "asterisk.h"
#include <sys/time.h>
#include <sys/stat.h>
#include <signal.h>
#include "asterisk/paths.h"
#include "asterisk/sched.h"
#include "asterisk/channel.h"
#include "asterisk/file.h"
#include "asterisk/image.h"
#include "asterisk/translate.h"
#include "asterisk/cli.h"
#include "asterisk/lock.h"
Go to the source code of this file.
Data Structures | |
struct | imagers |
Macros | |
#define | FORMAT "%10s %10s %50s %10s\n" |
#define | FORMAT2 "%10s %10s %50s %10s\n" |
Functions | |
int | ast_image_init (void) |
Initialize image stuff Initializes all the various image stuff. Basically just registers the cli stuff. More... | |
int | ast_image_register (struct ast_imager *img) |
Register image format. More... | |
void | ast_image_unregister (struct ast_imager *img) |
Unregister an image format. More... | |
struct ast_frame * | ast_read_image (const char *filename, const char *preflang, struct ast_format *format) |
Make an image. More... | |
int | ast_send_image (struct ast_channel *chan, const char *filename) |
Sends an image. More... | |
int | ast_supports_images (struct ast_channel *chan) |
Check for image support on a channel. More... | |
static int | file_exists (char *filename) |
static char * | handle_core_show_image_formats (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | image_shutdown (void) |
static void | make_filename (char *buf, int len, const char *filename, const char *preflang, char *ext) |
Variables | |
static struct ast_cli_entry | cli_image [] |
static struct imagers | imagers = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
Image Management.
Definition in file image.c.
#define FORMAT "%10s %10s %50s %10s\n" |
Referenced by handle_core_show_image_formats().
#define FORMAT2 "%10s %10s %50s %10s\n" |
Referenced by handle_core_show_image_formats().
int ast_image_init | ( | void | ) |
Initialize image stuff Initializes all the various image stuff. Basically just registers the cli stuff.
Definition at line 212 of file image.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_register_cleanup(), and image_shutdown().
Referenced by asterisk_daemon().
int ast_image_register | ( | struct ast_imager * | imgdrv | ) |
Register image format.
imgdrv | Populated ast_imager structure with info to register Registers an image format |
Definition at line 48 of file image.c.
References AST_RWLIST_INSERT_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, ast_imager::desc, and ast_imager::name.
void ast_image_unregister | ( | struct ast_imager * | imgdrv | ) |
Unregister an image format.
imgdrv | pointer to the ast_imager structure you wish to unregister Unregisters the image format passed in. Returns nothing |
Definition at line 57 of file image.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, ast_imager::desc, and ast_imager::name.
struct ast_frame* ast_read_image | ( | const char * | filename, |
const char * | preflang, | ||
struct ast_format * | format | ||
) |
Make an image.
filename | filename of image to prepare |
preflang | preferred language to get the image...? |
format | the format of the file, NULL for any image format Make an image from a filename ??? No estoy positivo |
an | ast_frame on success |
NULL | on failure |
Definition at line 101 of file image.c.
References ast_copy_string(), ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_log, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, buf, errno, ast_imager::exts, file_exists(), ast_imager::format, ast_imager::identify, len(), LOG_WARNING, make_filename(), ast_imager::name, NULL, ast_imager::read_image, strsep(), and tmp().
Referenced by ast_send_image().
int ast_send_image | ( | struct ast_channel * | chan, |
const char * | filename | ||
) |
Sends an image.
chan | channel to send image on |
filename | filename of image to send (minus extension) Sends an image on the given channel. |
0 | on success |
-1 | on error |
Definition at line 158 of file image.c.
References ast_channel_language(), ast_channel_tech(), ast_frfree, ast_read_image(), NULL, and ast_channel_tech::send_image.
Referenced by handle_sendimage(), and sendimage_exec().
int ast_supports_images | ( | struct ast_channel * | chan | ) |
Check for image support on a channel.
chan | channel to check Checks the channel to see if it supports the transmission of images |
Definition at line 67 of file image.c.
References ast_channel_tech().
Referenced by sendimage_exec().
|
static |
Definition at line 76 of file image.c.
Referenced by ast_read_image().
|
static |
Definition at line 172 of file image.c.
References ast_cli_args::argc, ast_cli(), ast_format_get_name(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ast_imager::desc, ast_imager::exts, ast_cli_args::fd, ast_imager::format, FORMAT, FORMAT2, ast_imager::name, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 207 of file image.c.
References ARRAY_LEN, and ast_cli_unregister_multiple().
Referenced by ast_image_init().
|
static |
Definition at line 86 of file image.c.
References ast_config_AST_DATA_DIR, and ast_strlen_zero.
Referenced by ast_read_image().
|
static |