Changeset 633 for pjproject/trunk/pjmedia/src/pjmedia/resample_port.c
- Timestamp:
- Jul 29, 2006 11:14:47 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/resample_port.c
r582 r633 25 25 26 26 #define BYTES_PER_SAMPLE 2 27 #define SIGNATURE PJMEDIA_PORT_SIGNATURE('R','S','M','P') 28 27 29 28 30 struct resample_port … … 53 55 pjmedia_port **p_port ) 54 56 { 57 const pj_str_t name = pj_str("resample"); 55 58 struct resample_port *rport; 56 59 unsigned ptime; … … 70 73 PJ_ASSERT_RETURN(rport != NULL, PJ_ENOMEM); 71 74 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); 85 78 86 79 rport->dn_port = dn_port;
Note: See TracChangeset
for help on using the changeset viewer.