From 4b2fc9d3e738dbb2e7dd297de2f35e571e350691 Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 6 Nov 2007 22:51:48 +0000 Subject: Commit some cleanups to the format type code. - Remove the AST_FORMAT_MAX_* types, as these are consuming 3 out of our available 32 bits. - Add a native slin16 type, so that 16kHz codecs can translate without losing resolution. (This doesn't affect anything immediately, until another codec has wb support.) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89071 f38db490-d61c-443f-a65b-d21fe96a405b --- include/asterisk/frame.h | 12 ++++-------- include/asterisk/translate.h | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h index b18575aaf..e51f6e638 100644 --- a/include/asterisk/frame.h +++ b/include/asterisk/frame.h @@ -243,8 +243,8 @@ extern struct ast_frame ast_null_frame; #define AST_FORMAT_G726 (1 << 11) /*! G.722 */ #define AST_FORMAT_G722 (1 << 12) -/*! Maximum audio format */ -#define AST_FORMAT_MAX_AUDIO (1 << 15) +/*! Raw 16-bit Signed Linear (16000 Hz) PCM */ +#define AST_FORMAT_SLINEAR16 (1 << 15) /*! Maximum audio mask */ #define AST_FORMAT_AUDIO_MASK ((1 << 16)-1) /*! JPEG Images */ @@ -261,14 +261,10 @@ extern struct ast_frame ast_null_frame; #define AST_FORMAT_H264 (1 << 21) /*! MPEG4 Video */ #define AST_FORMAT_MP4_VIDEO (1 << 22) -/*! Maximum video format */ -#define AST_FORMAT_MAX_VIDEO (1 << 24) #define AST_FORMAT_VIDEO_MASK (((1 << 25)-1) & ~(AST_FORMAT_AUDIO_MASK)) /*! T.140 Text format - ITU T.140, RFC 4351*/ #define AST_FORMAT_T140 (1 << 25) -/*! Maximum text mask */ -#define AST_FORMAT_MAX_TEXT (1 << 26) -#define AST_FORMAT_TEXT_MASK (((1 << 27)-1) & ~(AST_FORMAT_AUDIO_MASK) & ~(AST_FORMAT_VIDEO_MASK)) +#define AST_FORMAT_TEXT_MASK (((1 << 30)-1) & ~(AST_FORMAT_AUDIO_MASK) & ~(AST_FORMAT_VIDEO_MASK)) enum ast_control_frame_type { AST_CONTROL_HANGUP = 1, /*!< Other end has hungup */ @@ -361,9 +357,9 @@ struct ast_option_header { /*! \brief Definition of supported media formats (codecs) */ struct ast_format_list { - int visible; /*!< Can we see this entry */ int bits; /*!< bitmask value */ char *name; /*!< short name */ + int samplespersecond; /*!< Number of samples per second (8000/16000) */ char *desc; /*!< Description */ int fr_len; /*!< Single frame length in bytes */ int min_ms; /*!< Min value */ diff --git a/include/asterisk/translate.h b/include/asterisk/translate.h index 1de3fe61d..75023f0ad 100644 --- a/include/asterisk/translate.h +++ b/include/asterisk/translate.h @@ -44,7 +44,7 @@ struct ast_trans_pvt; /* declared below */ * related to run-time operation (size of buffers, auxiliary * descriptors, etc). * - * A coded registers itself by filling the relevant fields + * A codec registers itself by filling the relevant fields * of a structure and passing it as an argument to * ast_register_translator(). The structure should not be * modified after a successful registration, and its address -- cgit v1.2.3