Ignore:
Timestamp:
Jul 27, 2006 10:03:51 PM (17 years ago)
Author:
bennylp
Message:
  • Added splitter/combiner port (splitcomb.c)
  • Added function to initialize pjmedia_port_info (still unused though)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/port.c

    r518 r631  
    2323 
    2424#define THIS_FILE       "port.c" 
     25 
     26 
     27/** 
     28 * This is an auxiliary function to initialize port info for 
     29 * ports which deal with PCM audio. 
     30 */ 
     31PJ_DEF(pj_status_t) pjmedia_port_info_init( pjmedia_port_info *info, 
     32                                            const pj_str_t *name, 
     33                                            unsigned signature, 
     34                                            unsigned clock_rate, 
     35                                            unsigned channel_count, 
     36                                            unsigned bits_per_sample, 
     37                                            unsigned samples_per_frame) 
     38{ 
     39    pj_bzero(info, sizeof(*info)); 
     40 
     41    info->name = *name; 
     42    info->signature = signature; 
     43    info->type = PJMEDIA_TYPE_AUDIO; 
     44    info->has_info = PJ_TRUE; 
     45    info->need_info = PJ_FALSE; 
     46    info->pt = 0xFF; 
     47    info->encoding_name = pj_str("pcm"); 
     48    info->clock_rate = clock_rate; 
     49    info->channel_count = channel_count; 
     50    info->bits_per_sample = bits_per_sample; 
     51    info->samples_per_frame = samples_per_frame; 
     52    info->bytes_per_frame = samples_per_frame * bits_per_sample / 8; 
     53 
     54    return PJ_SUCCESS; 
     55} 
    2556 
    2657 
Note: See TracChangeset for help on using the changeset viewer.