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

Basic Types
[Base Types and Configurations]

Basic PJMEDIA types and operations.

Data Structures

struct  pjmedia_sock_info
struct  pjmedia_format
struct  pjmedia_frame
struct  pjmedia_frame_ext
struct  pjmedia_frame_ext_subframe

Defines

#define PJMEDIA_DIR_CAPTURE   PJMEDIA_DIR_ENCODING
#define PJMEDIA_DIR_PLAYBACK   PJMEDIA_DIR_DECODING
#define PJMEDIA_DIR_CAPTURE_PLAYBACK   PJMEDIA_DIR_ENCODING_DECODING
#define PJMEDIA_PORT_SIGNATURE(a, b, c, d)   (a<<24 | b<<16 | c<<8 | d)
#define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4)   ( C4<<24 | C3<<16 | C2<<8 | C1 )

Typedefs

typedef struct pjmedia_endpt pjmedia_endpt
typedef struct pjmedia_stream pjmedia_stream

Enumerations

enum  pjmedia_type {
  PJMEDIA_TYPE_NONE = 0,
  PJMEDIA_TYPE_AUDIO = 1,
  PJMEDIA_TYPE_VIDEO = 2,
  PJMEDIA_TYPE_UNKNOWN = 3,
  PJMEDIA_TYPE_APPLICATION = 4
}
enum  pjmedia_tp_proto {
  PJMEDIA_TP_PROTO_NONE = 0,
  PJMEDIA_TP_PROTO_RTP_AVP,
  PJMEDIA_TP_PROTO_RTP_SAVP,
  PJMEDIA_TP_PROTO_UNKNOWN
}
enum  pjmedia_dir {
  PJMEDIA_DIR_NONE = 0,
  PJMEDIA_DIR_ENCODING = 1,
  PJMEDIA_DIR_DECODING = 2,
  PJMEDIA_DIR_ENCODING_DECODING = 3
}
enum  pjmedia_format_id {
  PJMEDIA_FORMAT_L16 = 0,
  PJMEDIA_FORMAT_PCM = PJMEDIA_FORMAT_L16,
  PJMEDIA_FORMAT_PCMA = ( 'W' <<24 | 'A' <<16 | 'L' <<8 | 'A' ),
  PJMEDIA_FORMAT_ALAW = PJMEDIA_FORMAT_PCMA,
  PJMEDIA_FORMAT_PCMU = ( 'W' <<24 | 'A' <<16 | 'L' <<8 | 'u' ),
  PJMEDIA_FORMAT_ULAW = PJMEDIA_FORMAT_PCMU,
  PJMEDIA_FORMAT_AMR = ( 'R' <<24 | 'M' <<16 | 'A' <<8 | ' ' ),
  PJMEDIA_FORMAT_G729 = ( '9' <<24 | '2' <<16 | '7' <<8 | 'G' ),
  PJMEDIA_FORMAT_ILBC = ( 'C' <<24 | 'B' <<16 | 'L' <<8 | 'I' )
}
enum  pjmedia_frame_type {
  PJMEDIA_FRAME_TYPE_NONE,
  PJMEDIA_FRAME_TYPE_AUDIO,
  PJMEDIA_FRAME_TYPE_EXTENDED
}

Functions

void pjmedia_zero_samples (pj_int16_t *samples, unsigned count)
void pjmedia_copy_samples (pj_int16_t *dst, const pj_int16_t *src, unsigned count)
void pjmedia_move_samples (pj_int16_t *dst, const pj_int16_t *src, unsigned count)
void pjmedia_frame_ext_append_subframe (pjmedia_frame_ext *frm, const void *src, unsigned bitlen, unsigned samples_cnt)
pjmedia_frame_ext_subframepjmedia_frame_ext_get_subframe (const pjmedia_frame_ext *frm, unsigned n)
unsigned pjmedia_frame_ext_copy_payload (const pjmedia_frame_ext *frm, void *dst, unsigned maxlen)
pj_status_t pjmedia_frame_ext_pop_subframes (pjmedia_frame_ext *frm, unsigned n)

Define Documentation

#define PJMEDIA_DIR_CAPTURE   PJMEDIA_DIR_ENCODING

Direction is capturing audio frames.

#define PJMEDIA_DIR_PLAYBACK   PJMEDIA_DIR_DECODING

Direction is playback of audio frames.

#define PJMEDIA_DIR_CAPTURE_PLAYBACK   PJMEDIA_DIR_ENCODING_DECODING

Direction is both capture and playback.

#define PJMEDIA_PORT_SIGNATURE ( a,
b,
c,
 )     (a<<24 | b<<16 | c<<8 | d)

Create 32bit port signature from ASCII characters.

#define PJMEDIA_FORMAT_PACK ( C1,
C2,
C3,
C4   )     ( C4<<24 | C3<<16 | C2<<8 | C1 )

Macro for packing format.


Typedef Documentation

typedef struct pjmedia_endpt pjmedia_endpt

Opaque declaration of media endpoint.


Enumeration Type Documentation

Top most media type.

Enumerator:
PJMEDIA_TYPE_NONE 

No type.

PJMEDIA_TYPE_AUDIO 

The media is audio

PJMEDIA_TYPE_VIDEO 

The media is video.

PJMEDIA_TYPE_UNKNOWN 

Unknown media type, in this case the name will be specified in encoding_name.

PJMEDIA_TYPE_APPLICATION 

The media is application.

Media transport protocol.

Enumerator:
PJMEDIA_TP_PROTO_NONE 

No transport type

PJMEDIA_TP_PROTO_RTP_AVP 

RTP using A/V profile

PJMEDIA_TP_PROTO_RTP_SAVP 

Secure RTP

PJMEDIA_TP_PROTO_UNKNOWN 

Unknown

Media direction.

Enumerator:
PJMEDIA_DIR_NONE 

None

PJMEDIA_DIR_ENCODING 

Encoding (outgoing to network) stream

PJMEDIA_DIR_DECODING 

Decoding (incoming from network) stream.

PJMEDIA_DIR_ENCODING_DECODING 

Incoming and outgoing stream.

This enumeration describes format ID.

Enumerator:
PJMEDIA_FORMAT_L16 

16bit linear

PJMEDIA_FORMAT_PCM 

Alias for PJMEDIA_FORMAT_L16

PJMEDIA_FORMAT_PCMA 

G.711 ALAW

PJMEDIA_FORMAT_ALAW 

Alias for PJMEDIA_FORMAT_PCMA

PJMEDIA_FORMAT_PCMU 

G.711 ULAW

PJMEDIA_FORMAT_ULAW 

Aliaw for PJMEDIA_FORMAT_PCMU

PJMEDIA_FORMAT_AMR 

AMR narrowband

PJMEDIA_FORMAT_G729 

ITU G.729

PJMEDIA_FORMAT_ILBC 

Internet Low Bit-Rate Codec (ILBC)

Types of media frame.

Enumerator:
PJMEDIA_FRAME_TYPE_NONE 

No frame.

PJMEDIA_FRAME_TYPE_AUDIO 

Normal audio frame.

PJMEDIA_FRAME_TYPE_EXTENDED 

Extended audio frame.


Function Documentation

void pjmedia_zero_samples ( pj_int16_t samples,
unsigned  count 
)

This is a general purpose function set PCM samples to zero. Since this function is needed by many parts of the library, by putting this functionality in one place, it enables some. clever people to optimize this function.

Parameters:
samples The 16bit PCM samples.
count Number of samples.

References pj_bzero(), and PJ_INLINE.

void pjmedia_copy_samples ( pj_int16_t dst,
const pj_int16_t src,
unsigned  count 
)

This is a general purpose function to copy samples from/to buffers with equal size. Since this function is needed by many parts of the library, by putting this functionality in one place, it enables some. clever people to optimize this function.

References PJ_INLINE, and pj_memcpy().

Referenced by pjmedia_circ_buf_copy(), pjmedia_circ_buf_pack_buffer(), pjmedia_circ_buf_read(), and pjmedia_circ_buf_write().

void pjmedia_move_samples ( pj_int16_t dst,
const pj_int16_t src,
unsigned  count 
)

This is a general purpose function to copy samples from/to buffers with equal size. Since this function is needed by many parts of the library, by putting this functionality in one place, it enables some. clever people to optimize this function.

References PJ_INLINE, and pj_memmove().

Referenced by pjmedia_circ_buf_pack_buffer().

void pjmedia_frame_ext_append_subframe ( pjmedia_frame_ext frm,
const void *  src,
unsigned  bitlen,
unsigned  samples_cnt 
)

Append one subframe to pjmedia_frame_ext.

Parameters:
frm The pjmedia_frame_ext.
src Subframe data.
bitlen Lenght of subframe, in bits.
samples_cnt Number of audio samples in subframe.

References pjmedia_frame_ext_subframe::bitlen, pjmedia_frame_ext_subframe::data, PJ_INLINE, and pj_memcpy().

pjmedia_frame_ext_subframe* pjmedia_frame_ext_get_subframe ( const pjmedia_frame_ext frm,
unsigned  n 
)

Get a subframe from pjmedia_frame_ext.

Parameters:
frm The pjmedia_frame_ext.
n Subframe index, zero based.
Returns:
The n-th subframe, or NULL if n is out-of-range.

References pjmedia_frame_ext_subframe::bitlen.

Referenced by pjmedia_frame_ext_copy_payload(), and pjmedia_frame_ext_pop_subframes().

unsigned pjmedia_frame_ext_copy_payload ( const pjmedia_frame_ext frm,
void *  dst,
unsigned  maxlen 
)

Extract all frame payload to the specified buffer.

Parameters:
frm The frame.
dst Destination buffer.
maxlen Maximum size to copy (i.e. the size of the destination buffer).
Returns:
Total size of payload copied.

References pjmedia_frame_ext_subframe::bitlen, pjmedia_frame_ext_subframe::data, pj_memcpy(), and pjmedia_frame_ext_get_subframe().

pj_status_t pjmedia_frame_ext_pop_subframes ( pjmedia_frame_ext frm,
unsigned  n 
)

Pop out first n subframes from pjmedia_frame_ext.

Parameters:
frm The pjmedia_frame_ext.
n Number of first subframes to be popped out.
Returns:
PJ_SUCCESS when successful.

References pjmedia_frame_ext_subframe::bitlen, pj_memmove(), PJ_SUCCESS, and pjmedia_frame_ext_get_subframe().

 


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