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

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

Resample Port
[Media Ports Framework]


Detailed Description

This section describes media port abstraction for Resampling Algorithm.


Enumerations

enum  pjmedia_resample_port_options {
  PJMEDIA_RESAMPLE_USE_LINEAR = 1,
  PJMEDIA_RESAMPLE_USE_SMALL_FILTER = 2,
  PJMEDIA_RESAMPLE_DONT_DESTROY_DN = 4
}

Functions

pj_status_t pjmedia_resample_port_create (pj_pool_t *pool, pjmedia_port *dn_port, unsigned clock_rate, unsigned options, pjmedia_port **p_port)


Enumeration Type Documentation

Option flags that can be specified when creating resample port.

Enumerator:
PJMEDIA_RESAMPLE_USE_LINEAR  Do not use high quality resampling algorithm, but use linear algorithm instead.
PJMEDIA_RESAMPLE_USE_SMALL_FILTER  Use small filter workspace when high quality resampling is used.
PJMEDIA_RESAMPLE_DONT_DESTROY_DN  Do not destroy downstream port when resample port is destroyed.


Function Documentation

pj_status_t pjmedia_resample_port_create ( pj_pool_t pool,
pjmedia_port dn_port,
unsigned  clock_rate,
unsigned  options,
pjmedia_port **  p_port 
)

Create a resample port. This creates a bidirectional resample session, which will resample frames when the port's get_frame() and put_frame() is called.

When the resample port's get_frame() is called, this port will get a frame from the downstream port and resample the frame to the target clock rate before returning it to the caller.

When the resample port's put_frame() is called, this port will resample the frame to the downstream port's clock rate before giving the frame to the downstream port.

Parameters:
pool Pool to allocate the structure and buffers.
dn_port The downstream port, which clock rate is to be converted to the target clock rate.
clock_rate Target clock rate.
options Flags from pjmedia_resample_port_options. When this flag is zero, the default behavior is to use high quality resampling with large filter, and to destroy downstream port when resample port is destroyed.
p_port Pointer to receive the resample port instance.
Returns:
PJ_SUCCESS on success.

 


PJMEDIA small footprint Open Source media stack
(C)2003-2008 Benny Prijono