mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-10 06:49:40 +00:00
This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
91 lines
2.9 KiB
C
91 lines
2.9 KiB
C
/*
|
|
* Asterisk -- An open source telephony toolkit.
|
|
*
|
|
* Copyright (C) 1999 - 2006, Digium, Inc.
|
|
*
|
|
* Mark Spencer <markster@digium.com>
|
|
*
|
|
* See http://www.asterisk.org for more information about
|
|
* the Asterisk project. Please do not directly contact
|
|
* any of the maintainers of this project for assistance;
|
|
* the project provides a web site, mailing lists and IRC
|
|
* channels for your use.
|
|
*
|
|
* This program is free software, distributed under the terms of
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
* at the top of the source tree.
|
|
*/
|
|
|
|
/*! \file
|
|
* \brief General Asterisk channel definitions for image handling
|
|
*/
|
|
|
|
#ifndef _ASTERISK_IMAGE_H
|
|
#define _ASTERISK_IMAGE_H
|
|
|
|
/*! \brief structure associated with registering an image format */
|
|
struct ast_imager {
|
|
char *name; /*!< Name */
|
|
char *desc; /*!< Description */
|
|
char *exts; /*!< Extension(s) (separated by '|' ) */
|
|
struct ast_format format; /*!< Image format */
|
|
struct ast_frame *(*read_image)(int fd, int len); /*!< Read an image from a file descriptor */
|
|
int (*identify)(int fd); /*!< Identify if this is that type of file */
|
|
int (*write_image)(int fd, struct ast_frame *frame); /*!< Returns length written */
|
|
AST_LIST_ENTRY(ast_imager) list; /*!< For linked list */
|
|
};
|
|
|
|
/*!
|
|
* \brief Check for image support on a channel
|
|
* \param chan channel to check
|
|
* Checks the channel to see if it supports the transmission of images
|
|
* \return non-zero if image transmission is supported
|
|
*/
|
|
int ast_supports_images(struct ast_channel *chan);
|
|
|
|
/*!
|
|
* \brief Sends an image
|
|
* \param chan channel to send image on
|
|
* \param filename filename of image to send (minus extension)
|
|
* Sends an image on the given channel.
|
|
* \retval 0 on success
|
|
* \retval -1 on error
|
|
*/
|
|
int ast_send_image(struct ast_channel *chan, const char *filename);
|
|
|
|
/*!
|
|
* \brief Make an image
|
|
* \param filename filename of image to prepare
|
|
* \param preflang preferred language to get the image...?
|
|
* \param format the format of the file, NULL for any image format
|
|
* Make an image from a filename ??? No estoy positivo
|
|
* \retval an ast_frame on success
|
|
* \retval NULL on failure
|
|
*/
|
|
struct ast_frame *ast_read_image(const char *filename, const char *preflang, struct ast_format *format);
|
|
|
|
/*!
|
|
* \brief Register image format
|
|
* \param imgdrv Populated ast_imager structure with info to register
|
|
* Registers an image format
|
|
* \return 0 regardless
|
|
*/
|
|
int ast_image_register(struct ast_imager *imgdrv);
|
|
|
|
/*!
|
|
* \brief Unregister an image format
|
|
* \param imgdrv pointer to the ast_imager structure you wish to unregister
|
|
* Unregisters the image format passed in.
|
|
* Returns nothing
|
|
*/
|
|
void ast_image_unregister(struct ast_imager *imgdrv);
|
|
|
|
/*!
|
|
* \brief Initialize image stuff
|
|
* Initializes all the various image stuff. Basically just registers the cli stuff
|
|
* \return 0 all the time
|
|
*/
|
|
int ast_image_init(void);
|
|
|
|
#endif /* _ASTERISK_IMAGE_H */
|