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

Resampling Algorithm
[Audio Manipulation Algorithms]

Sample rate conversion algorithm. More...

Typedefs

typedef typedefPJ_BEGIN_DECL
struct pjmedia_resample 
pjmedia_resample

Functions

pj_status_t pjmedia_resample_create (pj_pool_t *pool, pj_bool_t high_quality, pj_bool_t large_filter, unsigned channel_count, unsigned rate_in, unsigned rate_out, unsigned samples_per_frame, pjmedia_resample **p_resample)
void pjmedia_resample_run (pjmedia_resample *resample, const pj_int16_t *input, pj_int16_t *output)
unsigned pjmedia_resample_get_input_size (pjmedia_resample *resample)
void pjmedia_resample_destroy (pjmedia_resample *resample)

Detailed Description

This section describes the base resampling functions. In addition to this, application can use the Resample Port which provides media port abstraction for the base resampling algorithm.


Typedef Documentation

typedef typedefPJ_BEGIN_DECL struct pjmedia_resample pjmedia_resample

Opaque resample session.


Function Documentation

pj_status_t pjmedia_resample_create ( pj_pool_t pool,
pj_bool_t  high_quality,
pj_bool_t  large_filter,
unsigned  channel_count,
unsigned  rate_in,
unsigned  rate_out,
unsigned  samples_per_frame,
pjmedia_resample **  p_resample 
)

Create a frame based resample session.

Parameters:
pool Pool to allocate the structure and buffers.
high_quality If true, then high quality conversion will be used, at the expense of more CPU and memory, because temporary buffer needs to be created.
large_filter If true, large filter size will be used.
channel_count Number of channels.
rate_in Clock rate of the input samples.
rate_out Clock rate of the output samples.
samples_per_frame Number of samples per frame in the input.
p_resample Pointer to receive the resample session.
Returns:
PJ_SUCCESS on success.
void pjmedia_resample_run ( pjmedia_resample resample,
const pj_int16_t input,
pj_int16_t output 
)

Use the resample session to resample a frame. The frame must have the same size and settings as the resample session, or otherwise the behavior is undefined.

Parameters:
resample The resample session.
input Buffer containing the input samples.
output Buffer to store the output samples.
unsigned pjmedia_resample_get_input_size ( pjmedia_resample resample  ) 

Get the input frame size of a resample session.

Parameters:
resample The resample session.
Returns:
The frame size, in number of samples.
void pjmedia_resample_destroy ( pjmedia_resample resample  ) 

Destroy the resample.

Parameters:
resample The resample session.

 


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