BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

Media/MIME type declaration and manipulations. More...

Data Structures

struct  pjsip_media_type
 

Functions

void pjsip_media_type_init (pjsip_media_type *mt, pj_str_t *type, pj_str_t *subtype)
 
void pjsip_media_type_init2 (pjsip_media_type *mt, char *type, char *subtype)
 
int pjsip_media_type_cmp (const pjsip_media_type *mt1, const pjsip_media_type *mt2, int cmp_param)
 
void pjsip_media_type_cp (pj_pool_t *pool, pjsip_media_type *dst, const pjsip_media_type *src)
 
int pjsip_media_type_print (char *buf, unsigned len, const pjsip_media_type *mt)
 

Detailed Description

Function Documentation

◆ pjsip_media_type_init()

void pjsip_media_type_init ( pjsip_media_type mt,
pj_str_t type,
pj_str_t subtype 
)

Initialize the media type with the specified type and subtype string.

Parameters
mtThe media type.
typeOptionally specify the media type.
subtypeOptionally specify the media subtype.

◆ pjsip_media_type_init2()

void pjsip_media_type_init2 ( pjsip_media_type mt,
char *  type,
char *  subtype 
)

Initialize the media type with the specified type and subtype string.

Parameters
mtThe media type.
typeOptionally specify the media type.
subtypeOptionally specify the media subtype.

◆ pjsip_media_type_cmp()

int pjsip_media_type_cmp ( const pjsip_media_type mt1,
const pjsip_media_type mt2,
int  cmp_param 
)

Compare two media types.

Parameters
mt1The first media type.
mt2The second media type.
cmp_paramSpecify how to compare the media type parameters:
  • 0: do not compare parameters
  • 1: compare parameters but ignore parameters that only appear in one of the media type.
  • 2: compare the parameters.
Returns
Zero if both media types are equal, -1 if mt1 < mt2, 1 if mt1 > mt2.

◆ pjsip_media_type_cp()

void pjsip_media_type_cp ( pj_pool_t pool,
pjsip_media_type dst,
const pjsip_media_type src 
)

Copy SIP media type to another.

Parameters
poolPool to duplicate strings.
dstDestination structure.
srcSource structure.

◆ pjsip_media_type_print()

int pjsip_media_type_print ( char *  buf,
unsigned  len,
const pjsip_media_type mt 
)

Print media type to the specified buffer.

Parameters
bufDestination buffer.
lenLength of the buffer.
mtThe media type to be printed.
Returns
The number of characters printed to the buffer, or -1 if there's not enough space in the buffer.

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.