Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

image.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- A telephony toolkit for Linux.
00003  *
00004  * General Asterisk channel definitions.
00005  * 
00006  * Copyright (C) 1999, Mark Spencer
00007  *
00008  * Mark Spencer <markster@linux-support.net>
00009  *
00010  * This program is free software, distributed under the terms of
00011  * the GNU General Public License
00012  */
00013 
00014 #ifndef _ASTERISK_IMAGE_H
00015 #define _ASTERISK_IMAGE_H
00016 
00017 //! structure associated with registering an image format
00018 struct ast_imager {
00019    /*! Name */
00020    char *name;                
00021    /*! Description */
00022    char *desc;                
00023    /*! Extension(s) (separated by '|' ) */
00024    char *exts;                
00025    /*! Image format */
00026    int format;                
00027    /*! Read an image from a file descriptor */
00028    struct ast_frame *(*read_image)(int fd, int len);  
00029    /*! Identify if this is that type of file */
00030    int (*identify)(int fd);            
00031    /*! Returns length written */
00032    int (*write_image)(int fd, struct ast_frame *frame);  
00033    /*! For linked list */
00034    struct ast_imager *next;
00035 };
00036 
00037 //! Check for image support on a channel
00038 /*! 
00039  * \param chan channel to check
00040  * Checks the channel to see if it supports the transmission of images
00041  * Returns non-zero if image transmission is supported
00042  */
00043 extern int ast_supports_images(struct ast_channel *chan);
00044 
00045 //! Sends an image
00046 /*!
00047  * \param chan channel to send image on
00048  * \param filename filename of image to send (minus extension)
00049  * Sends an image on the given channel.
00050  * Returns 0 on success, -1 on error
00051  */
00052 extern int ast_send_image(struct ast_channel *chan, char *filename);
00053 
00054 //! Make an image
00055 /*! 
00056  * \param filename filename of image to prepare
00057  * \param preflang preferred language to get the image...?
00058  * \param format the format of the file
00059  * Make an image from a filename ??? No estoy positivo
00060  * Returns an ast_frame on success, NULL on failure
00061  */
00062 extern struct ast_frame *ast_read_image(char *filename, char *preflang, int format);
00063 
00064 //! Register image format
00065 /*! 
00066  * \param imgdrv Populated ast_imager structure with info to register
00067  * Registers an image format
00068  * Returns 0 regardless
00069  */
00070 extern int ast_image_register(struct ast_imager *imgdrv);
00071 
00072 //! Unregister an image format
00073 /*!
00074  * \param imgdrv pointer to the ast_imager structure you wish to unregister
00075  * Unregisters the image format passed in
00076  * Returns nothing
00077  */
00078 extern void ast_image_unregister(struct ast_imager *imgdrv);
00079 
00080 //! Initialize image stuff
00081 /*!
00082  * Initializes all the various image stuff.  Basically just registers the cli stuff
00083  * Returns 0 all the time
00084  */
00085 extern int ast_image_init(void);
00086 
00087 #endif

Generated on Sat Nov 25 19:09:37 2006 for Asterisk by  doxygen 1.4.2