Yate
|
Wrapper class for audio and video formats. More...
#include <yateiax.h>
Public Types | |
enum | Formats { G723_1 = (1 << 0), GSM = (1 << 1), ULAW = (1 << 2), ALAW = (1 << 3), G726 = (1 << 4), ADPCM = (1 << 5), SLIN = (1 << 6), LPC10 = (1 << 7), G729 = (1 << 8), SPEEX = (1 << 9), ILBC = (1 << 10), G726AAL2 = (1 << 11), G722 = (1 << 12), AMR = (1 << 13), AudioMask, JPEG = (1 << 16), PNG = (1 << 17), ImageMask = JPEG | PNG, H261 = (1 << 18), H263 = (1 << 19), H263p = (1 << 20), H264 = (1 << 21), VideoMask = H261 | H263 | H263p | H264 } |
enum | Media { Audio = 0, Video, Image, TypeCount } |
Public Member Functions | |
IAXFormat (int type=Audio) | |
int | type () const |
u_int32_t | format () const |
u_int32_t | in () const |
u_int32_t | out () const |
const char * | formatName () const |
const char * | typeName () const |
void | set (u_int32_t *fmt, u_int32_t *fmtIn, u_int32_t *fmtOut) |
Static Public Member Functions | |
static void | formatList (String &dest, u_int32_t formats, const TokenDict *dict=0, const char *sep=",") |
static u_int32_t | pickFormat (u_int32_t formats, u_int32_t format=0) |
static u_int32_t | encode (const String &formats, const TokenDict *dict, char sep= ',') |
static u_int32_t | mask (u_int32_t value, int type) |
static u_int32_t | clear (u_int32_t value, int type) |
static const char * | formatName (u_int32_t fmt) |
static const char * | typeName (int type) |
Static Public Attributes | |
static const TokenDict | s_formats [] |
static const TokenDict | s_types [] |
Protected Attributes | |
int | m_type |
u_int32_t | m_format |
u_int32_t | m_formatIn |
u_int32_t | m_formatOut |
Wrapper class for audio and video formats.
This class holds the enumeration values for audio and video formats
enum Formats |
Format enumeration types
enum Media |
Media type enumeration
IAXFormat | ( | int | type = Audio | ) | [inline] |
Constructor. Build an audio format
type | Media type |
static u_int32_t clear | ( | u_int32_t | value, |
int | type | ||
) | [inline, static] |
Clear formats by type
value | Input format(s) |
type | Media type to clear |
Encode a formats list
formats | Formats list |
dict | Dictionary to use |
sep | Formats list separator |
u_int32_t format | ( | ) | const [inline] |
static void formatList | ( | String & | dest, |
u_int32_t | formats, | ||
const TokenDict * | dict = 0 , |
||
const char * | sep = "," |
||
) | [static] |
Create a string list from formats
dest | The destination |
formats | The formats |
dict | Optional dictionary to use, 0 to use s_formats |
sep | The separator to use |
const char* formatName | ( | ) | const [inline] |
Get the text associated with the format
References IAXFormat::formatName().
Referenced by IAXFormat::formatName().
static const char* formatName | ( | u_int32_t | fmt | ) | [inline, static] |
Get the text associated with a format
fmt | The desired format |
References TelEngine::lookup().
u_int32_t in | ( | ) | const [inline] |
static u_int32_t mask | ( | u_int32_t | value, |
int | type | ||
) | [inline, static] |
Mask formats by type
value | Input format(s) |
type | Media type to retrieve |
u_int32_t out | ( | ) | const [inline] |
static u_int32_t pickFormat | ( | u_int32_t | formats, |
u_int32_t | format = 0 |
||
) | [static] |
Pick a format from a list of capabilities
formats | Capabilities list |
format | Optional format to pick |
void set | ( | u_int32_t * | fmt, |
u_int32_t * | fmtIn, | ||
u_int32_t * | fmtOut | ||
) |
Set format
fmt | Optional pointer to format to set |
fmtIn | Optional pointer to incoming format to set |
fmtOut | Optional pointer to outgoing format to set |
int type | ( | ) | const [inline] |
Get the media type
const char* typeName | ( | ) | const [inline] |
Get the text associated with the media type
References IAXFormat::typeName().
Referenced by IAXFormat::typeName().
static const char* typeName | ( | int | type | ) | [inline, static] |
Get the text associated with a media type
type | The media type |
References TelEngine::lookup().