pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication
Loading

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJMEDIA Reference

The Endpoint

Enumerations

enum  pjmedia_endpt_flag { PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG }

Functions

pj_status_t pjmedia_endpt_create (pj_pool_factory *pf, pj_ioqueue_t *ioqueue, unsigned worker_cnt, pjmedia_endpt **p_endpt)
pj_status_t pjmedia_endpt_destroy (pjmedia_endpt *endpt)
pj_status_t pjmedia_endpt_set_flag (pjmedia_endpt *endpt, pjmedia_endpt_flag flag, const void *value)
pj_status_t pjmedia_endpt_get_flag (pjmedia_endpt *endpt, pjmedia_endpt_flag flag, void *value)
pj_ioqueue_tpjmedia_endpt_get_ioqueue (pjmedia_endpt *endpt)
unsigned pjmedia_endpt_get_thread_count (pjmedia_endpt *endpt)
pj_thread_tpjmedia_endpt_get_thread (pjmedia_endpt *endpt, unsigned index)
pj_pool_tpjmedia_endpt_create_pool (pjmedia_endpt *endpt, const char *name, pj_size_t initial, pj_size_t increment)
pjmedia_codec_mgrpjmedia_endpt_get_codec_mgr (pjmedia_endpt *endpt)
pj_status_t pjmedia_endpt_create_sdp (pjmedia_endpt *endpt, pj_pool_t *pool, unsigned stream_cnt, const pjmedia_sock_info sock_info[], pjmedia_sdp_session **p_sdp)
pj_status_t pjmedia_endpt_dump (pjmedia_endpt *endpt)

Detailed Description

The media endpoint acts as placeholder for endpoint capabilities. Each media endpoint will have a codec manager to manage list of codecs installed in the endpoint and a sound device factory.

A reference to media endpoint instance is required when application wants to create a media session (pjmedia_session_create()).


Enumeration Type Documentation

This enumeration describes various flags that can be set or retrieved in the media endpoint, by using pjmedia_endpt_set_flag() and pjmedia_endpt_get_flag() respectively.

Enumerator:
PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG 

This flag controls whether telephony-event should be offered in SDP. Value is boolean.


Function Documentation

pj_status_t pjmedia_endpt_create ( pj_pool_factory pf,
pj_ioqueue_t ioqueue,
unsigned  worker_cnt,
pjmedia_endpt **  p_endpt 
)

Create an instance of media endpoint.

Parameters:
pf Pool factory, which will be used by the media endpoint throughout its lifetime.
ioqueue Optional ioqueue instance to be registered to the endpoint. The ioqueue instance is used to poll all RTP and RTCP sockets. If this argument is NULL, the endpoint will create an internal ioqueue instance.
worker_cnt Specify the number of worker threads to be created to poll the ioqueue.
p_endpt Pointer to receive the endpoint instance.
Returns:
PJ_SUCCESS on success.
pj_status_t pjmedia_endpt_destroy ( pjmedia_endpt endpt  ) 

Destroy media endpoint instance.

Parameters:
endpt Media endpoint instance.
Returns:
PJ_SUCCESS on success.
pj_status_t pjmedia_endpt_set_flag ( pjmedia_endpt endpt,
pjmedia_endpt_flag  flag,
const void *  value 
)

Change the value of a flag.

Parameters:
endpt Media endpoint.
flag The flag.
value Pointer to the value to be set.

PJ_SUCCESS on success.

pj_status_t pjmedia_endpt_get_flag ( pjmedia_endpt endpt,
pjmedia_endpt_flag  flag,
void *  value 
)

Retrieve the value of a flag.

Parameters:
endpt Media endpoint.
flag The flag.
value Pointer to store the result.
Returns:
PJ_SUCCESS on success.
pj_ioqueue_t* pjmedia_endpt_get_ioqueue ( pjmedia_endpt endpt  ) 

Get the ioqueue instance of the media endpoint.

Parameters:
endpt The media endpoint instance.
Returns:
The ioqueue instance of the media endpoint.
unsigned pjmedia_endpt_get_thread_count ( pjmedia_endpt endpt  ) 

Get the number of worker threads on the media endpoint

Parameters:
endpt The media endpoint instance.
Returns:
The number of worker threads on the media endpoint
pj_thread_t* pjmedia_endpt_get_thread ( pjmedia_endpt endpt,
unsigned  index 
)

Get a reference to one of the worker threads of the media endpoint

Parameters:
endpt The media endpoint instance.
index The index of the thread: 0<= index < thread_cnt
Returns:
pj_thread_t or NULL
pj_pool_t* pjmedia_endpt_create_pool ( pjmedia_endpt endpt,
const char *  name,
pj_size_t  initial,
pj_size_t  increment 
)

Request the media endpoint to create pool.

Parameters:
endpt The media endpoint instance.
name Name to be assigned to the pool.
initial Initial pool size, in bytes.
increment Increment size, in bytes.
Returns:
Memory pool.
pjmedia_codec_mgr* pjmedia_endpt_get_codec_mgr ( pjmedia_endpt endpt  ) 

Get the codec manager instance of the media endpoint.

Parameters:
endpt The media endpoint instance.
Returns:
The instance of codec manager belonging to this media endpoint.
pj_status_t pjmedia_endpt_create_sdp ( pjmedia_endpt endpt,
pj_pool_t pool,
unsigned  stream_cnt,
const pjmedia_sock_info  sock_info[],
pjmedia_sdp_session **  p_sdp 
)

Create a SDP session description that describes the endpoint capability.

Parameters:
endpt The media endpoint.
pool Pool to use to create the SDP descriptor.
stream_cnt Number of elements in the sock_info array. This also denotes the maximum number of streams (i.e. the "m=" lines) that will be created in the SDP.
sock_info Array of socket transport information. One transport is needed for each media stream, and each transport consists of an RTP and RTCP socket pair.
p_sdp Pointer to receive SDP session descriptor.
Returns:
PJ_SUCCESS on success.
pj_status_t pjmedia_endpt_dump ( pjmedia_endpt endpt  ) 

Dump media endpoint capabilities.

Parameters:
endpt The media endpoint.
Returns:
PJ_SUCCESS on success.

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.