Implement --null-audio, --auto-loop, etc. in pjsua
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@507 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
f37356fe02
commit
22a300a401
|
@ -586,6 +586,10 @@ static pj_status_t parse_args(int argc, char *argv[],
|
||||||
case OPT_DURATION:
|
case OPT_DURATION:
|
||||||
cfg->duration = my_atoi(pj_optarg);
|
cfg->duration = my_atoi(pj_optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
PJ_LOG(1,(THIS_FILE, "Invalid argument %s", argv[pj_optind-1]));
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2068,6 +2072,8 @@ pj_status_t app_init(int argc, char *argv[])
|
||||||
&app_config.wav_id);
|
&app_config.wav_id);
|
||||||
if (status != PJ_SUCCESS)
|
if (status != PJ_SUCCESS)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
|
app_config.wav_port = pjsua_player_get_conf_port(app_config.wav_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add UDP transport */
|
/* Add UDP transport */
|
||||||
|
@ -2108,6 +2114,13 @@ pj_status_t app_init(int argc, char *argv[])
|
||||||
if (status != PJ_SUCCESS)
|
if (status != PJ_SUCCESS)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
|
/* Use null sound device? */
|
||||||
|
if (app_config.null_audio) {
|
||||||
|
status = pjsua_set_null_snd_dev();
|
||||||
|
if (status != PJ_SUCCESS)
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
return PJ_SUCCESS;
|
return PJ_SUCCESS;
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
|
|
|
@ -475,7 +475,7 @@ on_exit:
|
||||||
* in this case are file_port and stream_port).
|
* in this case are file_port and stream_port).
|
||||||
*/
|
*/
|
||||||
if (master_port) {
|
if (master_port) {
|
||||||
pjmedia_master_port_destroy(master_port);
|
pjmedia_master_port_destroy(master_port, PJ_TRUE);
|
||||||
play_file_port = NULL;
|
play_file_port = NULL;
|
||||||
stream = NULL;
|
stream = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,7 +326,7 @@ pj_status_t pjsua_media_subsys_start(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create sound port if none is created yet */
|
/* Create sound port if none is created yet */
|
||||||
if (pjsua_var.snd_port == NULL) {
|
if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL) {
|
||||||
status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev);
|
status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev);
|
||||||
if (status != PJ_SUCCESS) {
|
if (status != PJ_SUCCESS) {
|
||||||
/* Error opening sound device, use null device */
|
/* Error opening sound device, use null device */
|
||||||
|
|
Loading…
Reference in New Issue