提交 d6f9544b authored 作者: Giovanni Maruzzelli's avatar Giovanni Maruzzelli

skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo…

skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14375 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 44875f02
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <switch.h> #include <switch.h>
#include <switch_version.h> #include <switch_version.h>
#ifndef WIN32 #ifndef WIN32
#include <sys/time.h> #include <sys/time.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
......
...@@ -181,7 +181,7 @@ int skypiax_signaling_read(private_t * tech_pvt) ...@@ -181,7 +181,7 @@ int skypiax_signaling_read(private_t * tech_pvt)
/* this is the call in which we are calling out */ /* this is the call in which we are calling out */
DEBUGA_SKYPE("Call %s NOTHING\n", SKYPIAX_P_LOG, id); DEBUGA_SKYPE("Call %s NOTHING\n", SKYPIAX_P_LOG, id);
} else { } else {
skypiax_sleep(400000); //0.4 seconds skypiax_sleep(400000); //0.4 seconds
DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPIAX_P_LOG, id); DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPIAX_P_LOG, id);
skypiax_transfer(tech_pvt, id, value); skypiax_transfer(tech_pvt, id, value);
} }
...@@ -252,8 +252,8 @@ int skypiax_signaling_read(private_t * tech_pvt) ...@@ -252,8 +252,8 @@ int skypiax_signaling_read(private_t * tech_pvt)
char msg_to_skype[1024]; char msg_to_skype[1024];
tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA; tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING; tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", SKYPIAX_P_LOG, DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n",
id); SKYPIAX_P_LOG, id);
start_audio_threads(tech_pvt); start_audio_threads(tech_pvt);
skypiax_sleep(1000); skypiax_sleep(1000);
sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id,
...@@ -391,7 +391,7 @@ int skypiax_signaling_read(private_t * tech_pvt) ...@@ -391,7 +391,7 @@ int skypiax_signaling_read(private_t * tech_pvt)
sizeof(tech_pvt->skype_call_id) - 1); sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN; tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
tech_pvt->skype_call_id[0] = '\0'; tech_pvt->skype_call_id[0] = '\0';
skypiax_sleep(1000); skypiax_sleep(1000);
return CALLFLOW_INCOMING_HANGUP; return CALLFLOW_INCOMING_HANGUP;
} else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) { } else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) {
tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED; tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED;
...@@ -402,7 +402,7 @@ int skypiax_signaling_read(private_t * tech_pvt) ...@@ -402,7 +402,7 @@ int skypiax_signaling_read(private_t * tech_pvt)
sizeof(tech_pvt->skype_call_id) - 1); sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN; tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
tech_pvt->skype_call_id[0] = '\0'; tech_pvt->skype_call_id[0] = '\0';
skypiax_sleep(1000); skypiax_sleep(1000);
return CALLFLOW_INCOMING_HANGUP; return CALLFLOW_INCOMING_HANGUP;
} else { } else {
WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id, WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id,
...@@ -695,7 +695,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) ...@@ -695,7 +695,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
DEBUGA_SKYPE("ACCEPTED here you send me %d\n", SKYPIAX_P_LOG, DEBUGA_SKYPE("ACCEPTED here you send me %d\n", SKYPIAX_P_LOG,
tech_pvt->tcp_cli_port); tech_pvt->tcp_cli_port);
#ifndef WIN32 #ifndef WIN32
fcntl(tech_pvt->audioskypepipe[0], F_SETFL, O_NONBLOCK); fcntl(tech_pvt->audioskypepipe[0], F_SETFL, O_NONBLOCK);
#endif //WIN32 #endif //WIN32
if (!running) if (!running)
...@@ -713,7 +713,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) ...@@ -713,7 +713,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
if (!running) if (!running)
break; break;
FD_ZERO(&fs); FD_ZERO(&fs);
to.tv_usec = 120000; //120msec to.tv_usec = 120000; //120msec
to.tv_sec = 0; to.tv_sec = 0;
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
/* on win32 we cannot select from the apr "pipe", so we select on socket writability */ /* on win32 we cannot select from the apr "pipe", so we select on socket writability */
...@@ -730,63 +730,63 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) ...@@ -730,63 +730,63 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
#endif #endif
if (rt > 0) { if (rt > 0) {
int counter; int counter;
/* until we drained the pipe to empty */ /* until we drained the pipe to empty */
for(counter = 0; counter < 10; counter++){ for (counter = 0; counter < 10; counter++) {
/* read from the pipe the audio frame we are supposed to send out */ /* read from the pipe the audio frame we are supposed to send out */
got = got =
skypiax_pipe_read(tech_pvt->audioskypepipe[0], cli_in, skypiax_pipe_read(tech_pvt->audioskypepipe[0], cli_in,
SAMPLES_PER_FRAME * sizeof(short)); SAMPLES_PER_FRAME * sizeof(short));
if(got == -1) if (got == -1)
break; break;
if (got != SAMPLES_PER_FRAME * sizeof(short)) { if (got != SAMPLES_PER_FRAME * sizeof(short)) {
WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got, WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got,
(int) (SAMPLES_PER_FRAME * sizeof(short))); (int) (SAMPLES_PER_FRAME * sizeof(short)));
} }
if (got == SAMPLES_PER_FRAME * sizeof(short)) {
if (samplerate_skypiax == 8000) {
/* we're upsampling from 8khz to 16khz, cli_out will contain two times each sample from cli_in */ if (got == SAMPLES_PER_FRAME * sizeof(short)) {
a = 0; if (samplerate_skypiax == 8000) {
for (i = 0; i < got / sizeof(short); i++) {
cli_out[a] = cli_in[i]; /* we're upsampling from 8khz to 16khz, cli_out will contain two times each sample from cli_in */
a++; a = 0;
cli_out[a] = cli_in[i]; for (i = 0; i < got / sizeof(short); i++) {
a++; cli_out[a] = cli_in[i];
} a++;
got = got * 2; cli_out[a] = cli_in[i];
} else if (samplerate_skypiax == 16000) { a++;
/* we're NOT upsampling, cli_out will contain just ALL samples from cli_in */ }
for (i = 0; i < got / sizeof(short); i++) { got = got * 2;
cli_out[i] = cli_in[i]; } else if (samplerate_skypiax == 16000) {
/* we're NOT upsampling, cli_out will contain just ALL samples from cli_in */
for (i = 0; i < got / sizeof(short); i++) {
cli_out[i] = cli_in[i];
}
} else {
ERRORA("SAMPLERATE_SKYPIAX can only be 8000 or 16000\n", SKYPIAX_P_LOG);
} }
} else {
ERRORA("SAMPLERATE_SKYPIAX can only be 8000 or 16000\n", SKYPIAX_P_LOG);
}
/* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */ /* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) { if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
len = send(fd, (char *) cli_out, got, 0); len = send(fd, (char *) cli_out, got, 0);
skypiax_sleep(5000); //5 msec skypiax_sleep(5000); //5 msec
if (len == -1) { if (len == -1) {
break; break;
} else if (len != got) { } else if (len != got) {
ERRORA("len=%d\n", SKYPIAX_P_LOG, len); ERRORA("len=%d\n", SKYPIAX_P_LOG, len);
skypiax_sleep(1000); skypiax_sleep(1000);
break; break;
}
} }
}
} else { } else {
WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got, WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got,
(int) (SAMPLES_PER_FRAME * sizeof(short))); (int) (SAMPLES_PER_FRAME * sizeof(short)));
}
} }
}
} else { } else {
if (rt) if (rt)
ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt); ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论