BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJMEDIA Reference

Frame. More...

Data Structures

struct  pjmedia_frame
 
struct  pjmedia_frame_ext
 
struct  pjmedia_frame_ext_subframe
 

Enumerations

enum  pjmedia_frame_type {
  PJMEDIA_FRAME_TYPE_NONE ,
  PJMEDIA_FRAME_TYPE_AUDIO ,
  PJMEDIA_FRAME_TYPE_EXTENDED ,
  PJMEDIA_FRAME_TYPE_VIDEO
}
 

Functions

void pjmedia_frame_copy (pjmedia_frame *dst, const pjmedia_frame *src)
 
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)
 
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)
 

Detailed Description

Enumeration Type Documentation

◆ pjmedia_frame_type

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.

PJMEDIA_FRAME_TYPE_VIDEO 

Video frame.

Function Documentation

◆ pjmedia_frame_copy()

void pjmedia_frame_copy ( pjmedia_frame dst,
const pjmedia_frame src 
)

Copy one frame to another. If the destination frame's size is smaller than the source frame's, the destination buffer will be truncated.

Parameters
srcSource frame.
dstDestination frame.

References pjmedia_frame::bit_info, pjmedia_frame::buf, PJ_INLINE, pj_memcpy(), pjmedia_frame::size, pjmedia_frame::timestamp, and pjmedia_frame::type.

◆ pjmedia_frame_ext_append_subframe()

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
frmThe pjmedia_frame_ext.
srcSubframe data.
bitlenLength of subframe, in bits.
samples_cntNumber of audio samples in subframe.

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

◆ pjmedia_frame_ext_get_subframe()

pjmedia_frame_ext_subframe * pjmedia_frame_ext_get_subframe ( const pjmedia_frame_ext frm,
unsigned  n 
)

Get a subframe from pjmedia_frame_ext.

Parameters
frmThe pjmedia_frame_ext.
nSubframe 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().

◆ pjmedia_frame_ext_copy_payload()

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

Extract all frame payload to the specified buffer.

Parameters
frmThe frame.
dstDestination buffer.
maxlenMaximum 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().

◆ pjmedia_frame_ext_pop_subframes()

pj_status_t pjmedia_frame_ext_pop_subframes ( pjmedia_frame_ext frm,
unsigned  n 
)

Pop out first n subframes from pjmedia_frame_ext.

Parameters
frmThe pjmedia_frame_ext.
nNumber 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_zero_samples()

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
samplesThe 16bit PCM samples.
countNumber of samples.

References pj_bzero(), and PJ_INLINE.

◆ pjmedia_copy_samples()

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().

◆ pjmedia_move_samples()

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().

 


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