Ignore:
Timestamp:
Jul 29, 2006 11:14:47 AM (18 years ago)
Author:
bennylp
Message:

Added pjmedia_port_info_init() to fill in pjmedia_port_info structure, avoiding manual initialization and thus improves consistency (and probably reduces size by a tiny bit). This involves modification in quite few places.

File:
1 edited

Legend:

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

    r582 r633  
    2525 
    2626#define BYTES_PER_SAMPLE        2 
     27#define SIGNATURE               PJMEDIA_PORT_SIGNATURE('R','S','M','P') 
     28 
    2729 
    2830struct resample_port 
     
    5355                                                  pjmedia_port **p_port  ) 
    5456{ 
     57    const pj_str_t name = pj_str("resample"); 
    5558    struct resample_port *rport; 
    5659    unsigned ptime; 
     
    7073    PJ_ASSERT_RETURN(rport != NULL, PJ_ENOMEM); 
    7174 
    72     rport->base.info.clock_rate = clock_rate; 
    73     rport->base.info.samples_per_frame = clock_rate * ptime / 1000; 
    74     rport->base.info.bytes_per_frame = rport->base.info.samples_per_frame * 
    75                                        BYTES_PER_SAMPLE; 
    76     rport->base.info.bits_per_sample = BYTES_PER_SAMPLE * 8; 
    77     rport->base.info.channel_count = dn_port->info.channel_count; 
    78     rport->base.info.encoding_name = pj_str("pcm"); 
    79     rport->base.info.has_info = 1; 
    80     rport->base.info.name = pj_str("resample"); 
    81     rport->base.info.need_info = 0; 
    82     rport->base.info.pt = 0xFF; 
    83     rport->base.info.signature = PJMEDIA_PORT_SIGNATURE('R','S','M','P'); 
    84     rport->base.info.type = PJMEDIA_TYPE_AUDIO; 
     75    pjmedia_port_info_init(&rport->base.info, &name, SIGNATURE, clock_rate, 
     76                           dn_port->info.channel_count, BYTES_PER_SAMPLE * 8,  
     77                           clock_rate * ptime / 1000); 
    8578 
    8679    rport->dn_port = dn_port; 
Note: See TracChangeset for help on using the changeset viewer.