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/null_port.c

    r506 r633  
    2424 
    2525 
     26#define SIGNATURE   PJMEDIA_PORT_SIGNATURE('N', 'U', 'L', 'L') 
     27 
    2628static pj_status_t null_get_frame(pjmedia_port *this_port,  
    2729                                  pjmedia_frame *frame); 
     
    3941{ 
    4042    pjmedia_port *port; 
     43    const pj_str_t name = pj_str("null-port"); 
    4144 
    4245    PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 
     
    4548    PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); 
    4649 
    47     port->info.bits_per_sample = bits_per_sample; 
    48     port->info.bytes_per_frame = samples_per_frame * bits_per_sample / 8; 
    49     port->info.encoding_name = pj_str("pcm"); 
    50     port->info.has_info = 1; 
    51     port->info.name = pj_str("null-port"); 
    52     port->info.need_info = 0; 
    53     port->info.pt = 0xFF; 
    54     port->info.clock_rate = sampling_rate; 
    55     port->info.samples_per_frame = samples_per_frame; 
    56     port->info.channel_count = channel_count; 
    57     port->info.signature = 0x2411; 
    58     port->info.type = PJMEDIA_TYPE_AUDIO; 
     50    pjmedia_port_info_init(&port->info, &name, SIGNATURE, sampling_rate, 
     51                           channel_count, bits_per_sample, samples_per_frame); 
    5952 
    6053    port->get_frame = &null_get_frame; 
Note: See TracChangeset for help on using the changeset viewer.