- Timestamp:
- Apr 21, 2012 2:17:07 AM (13 years ago)
- Location:
- pjproject/branches/1.x
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjmedia/include/pjmedia/sound_port.h
r3553 r4065 76 76 /** 77 77 * This structure specifies the parameters to create the sound port. 78 * Use pjmedia_snd_port_param_default() to initialize this structure with 79 * default values (mostly zeroes) 78 80 */ 79 81 typedef struct pjmedia_snd_port_param … … 88 90 */ 89 91 unsigned options; 92 93 /** 94 * Echo cancellation options/flags. 95 */ 96 unsigned ec_options; 97 90 98 } pjmedia_snd_port_param; 99 100 /** 101 * Initialize pjmedia_snd_port_param with default values. 102 * 103 * @param prm The parameter. 104 */ 105 PJ_DECL(void) pjmedia_snd_port_param_default(pjmedia_snd_port_param *prm); 91 106 92 107 /** -
pjproject/branches/1.x/pjmedia/src/pjmedia/sound_port.c
r3963 r4065 50 50 unsigned bits_per_sample; 51 51 unsigned options; 52 unsigned prm_ec_options; 52 53 53 54 /* software ec */ … … 178 179 179 180 return PJ_SUCCESS; 181 } 182 183 /* Initialize with default values (zero) */ 184 PJ_DEF(void) pjmedia_snd_port_param_default(pjmedia_snd_port_param *prm) 185 { 186 pj_bzero(prm, sizeof(*prm)); 180 187 } 181 188 … … 270 277 271 278 status = pjmedia_snd_port_set_ec(snd_port, pool, 272 snd_port->aud_param.ec_tail_ms, 0); 279 snd_port->aud_param.ec_tail_ms, 280 snd_port->prm_ec_options); 273 281 if (status != PJ_SUCCESS) { 274 282 pjmedia_aud_stream_destroy(snd_port->aud_stream); … … 331 339 pj_status_t status; 332 340 333 PJ_UNUSED_ARG(options);341 pjmedia_snd_port_param_default(¶m); 334 342 335 343 status = pjmedia_aud_dev_default_param(rec_id, ¶m.base); … … 345 353 param.base.bits_per_sample = bits_per_sample; 346 354 param.options = options; 355 param.ec_options = 0; 347 356 348 357 return pjmedia_snd_port_create2(pool, ¶m, p_port); … … 364 373 pj_status_t status; 365 374 366 PJ_UNUSED_ARG(options);375 pjmedia_snd_port_param_default(¶m); 367 376 368 377 status = pjmedia_aud_dev_default_param(dev_id, ¶m.base); … … 377 386 param.base.bits_per_sample = bits_per_sample; 378 387 param.options = options; 388 param.ec_options = 0; 379 389 380 390 return pjmedia_snd_port_create2(pool, ¶m, p_port); … … 397 407 pj_status_t status; 398 408 399 PJ_UNUSED_ARG(options);409 pjmedia_snd_port_param_default(¶m); 400 410 401 411 status = pjmedia_aud_dev_default_param(dev_id, ¶m.base); … … 410 420 param.base.bits_per_sample = bits_per_sample; 411 421 param.options = options; 422 param.ec_options = 0; 412 423 413 424 return pjmedia_snd_port_create2(pool, ¶m, p_port); … … 437 448 snd_port->samples_per_frame = prm->base.samples_per_frame; 438 449 snd_port->bits_per_sample = prm->base.bits_per_sample; 439 pj_memcpy(&snd_port->aud_param, prm, sizeof(snd_port->aud_param));450 pj_memcpy(&snd_port->aud_param, &prm->base, sizeof(snd_port->aud_param)); 440 451 snd_port->options = prm->options; 452 snd_port->prm_ec_options = prm->ec_options; 441 453 442 454 /* Start sound device immediately. -
pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_media.c
r3986 r4065 2029 2029 pjmedia_snd_port_param param; 2030 2030 2031 pjmedia_snd_port_param_default(¶m); 2032 param.ec_options = pjsua_var.media_cfg.ec_options; 2033 2031 2034 /* Create parameter based on peer info */ 2032 2035 status = create_aud_param(¶m.base, pjsua_var.cap_dev, … … 2953 2956 pjsua_var.media_cfg.audio_frame_ptime * 2954 2957 pjsua_var.media_cfg.channel_count / 1000; 2958 pjmedia_snd_port_param_default(¶m); 2959 param.ec_options = pjsua_var.media_cfg.ec_options; 2955 2960 status = create_aud_param(¶m.base, capture_dev, playback_dev, 2956 2961 alt_cr[i], pjsua_var.media_cfg.channel_count, … … 3081 3086 3082 3087 pjsua_var.media_cfg.ec_tail_len = tail_ms; 3088 pjsua_var.media_cfg.ec_options = options; 3083 3089 3084 3090 if (pjsua_var.snd_port)
Note: See TracChangeset
for help on using the changeset viewer.