From: <st...@us...> - 2003-06-13 18:57:27
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv557 Modified Files: iaxclient.h iaxclient_lib.c iaxclient_lib.h Log Message: remove last vestiges of FILE *f from library. (some commented out thoughts about event callbacks in iaxclient.h) Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- iaxclient.h 10 Jun 2003 23:19:45 -0000 1.10 +++ iaxclient.h 13 Jun 2003 18:57:24 -0000 1.11 @@ -42,7 +42,36 @@ #define IAXC_FORMAT_H263 (1 << 19) /* H.263 Video */ +#if 0 +/* not yet implemented */ + +#define IAXC_EVENT_BUFSIZ 256 +struct iaxc_ev_levels { + float input; + float output; +}; +struct iaxc_ev_text { + char message[IAXC_EVENT_BUFSIZ]; +}; + +struct iaxc_ev_call { + char callerid[IAXC_EVENT_BUFSIZ]; +} + +typedef struct iaxc_event_struct { + int type; + union { + struct iaxc_ev_levels levels; + struct iaxc_ev_text text; + struct iaxc_ev_call call; + } event; + struct iaxc_event_struct *next; +} iaxc_event; + +typedef int (*iaxc_event_callback_t)(iaxc_event e); +void iaxc_set_event_callback(iaxc_message_callback_t func); +#endif int iaxc_initialize(int audType); void iaxc_shutdown(); Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- iaxclient_lib.c 12 Jun 2003 15:27:11 -0000 1.17 +++ iaxclient_lib.c 13 Jun 2003 18:57:24 -0000 1.18 @@ -14,8 +14,6 @@ int port; int c, i; char rcmd[RBUFSIZE]; -FILE *f; -gsm_frame fo; int iaxc_audio_output_mode = 0; // Normal static int answered_call; @@ -27,7 +25,7 @@ struct timeval lastouttm; static struct peer * find_peer(struct iax_session *session); -static void do_iax_event(FILE *f); +static void do_iax_event(); static THREAD procThread; static THREADID procThreadID; @@ -161,7 +159,7 @@ win_prepare_audio_buffers(); } #endif - iaxc_service_network(netfd,f); + iaxc_service_network(netfd); service_audio(); } @@ -200,7 +198,7 @@ void start_call_processing() { if (!answered_call) { while(1) { - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); if (answered_call) break; } @@ -219,20 +217,20 @@ { switch (iAudioType) { case AUDIO_INTERNAL: - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); #ifdef WIN32 win_process_audio_buffers(&lastouttm, most_recent_answer, iEncodeType); #endif - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); break; case AUDIO_INTERNAL_PA: - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); pa_send_audio(&lastouttm, most_recent_answer, iEncodeType); break; default: - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); iaxc_external_service_audio(); - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); break; } } else { @@ -243,7 +241,7 @@ } -void handle_audio_event(FILE *f, struct iax_event *e, struct peer *p) { +void handle_audio_event(struct iax_event *e, struct peer *p) { int total_consumed = 0; int cur; short fr[160]; @@ -285,7 +283,7 @@ } } -void iaxc_handle_network_event(FILE *f, struct iax_event *e, struct peer *p) +void iaxc_handle_network_event(struct iax_event *e, struct peer *p) { // int len,n; // WHOUT *wh,*wh1; @@ -319,7 +317,7 @@ iaxc_answer_call(); break; case IAX_EVENT_VOICE: - handle_audio_event(f, e, p); + handle_audio_event(e, p); break; // default : //fprintf(f, "Don't know how to handle that format %d\n", e->event.voice.format); @@ -413,7 +411,7 @@ } /* handle all network requests, and a pending scheduled event, if any */ -void iaxc_service_network(int netfd, FILE *f) +void iaxc_service_network(int netfd) { fd_set readfd; struct timeval dumbtimer; @@ -431,15 +429,15 @@ { if (FD_ISSET(netfd,&readfd)) { - do_iax_event(f); + do_iax_event(); (void) iax_time_to_next_event(); } else break; } else break; } - do_iax_event(f); /* do pending event if any */ + do_iax_event(); /* do pending event if any */ } -static void do_iax_event(FILE *f) { +static void do_iax_event() { int sessions = 0; struct iax_event *e = 0; struct peer *peer; @@ -447,7 +445,7 @@ while ( (e = iax_get_event(0))) { peer = find_peer(e->session); if(peer) { - iaxc_handle_network_event(f, e, peer); + iaxc_handle_network_event(e, peer); iax_event_free(e); } else { if(e->etype != IAX_EVENT_CONNECT) { @@ -507,7 +505,7 @@ return answered_call; } -void iaxc_external_audio_event(FILE *f, struct iax_event *e, struct peer *p) +void iaxc_external_audio_event(struct iax_event *e, struct peer *p) { // To be coded in the future return; Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iaxclient_lib.h 10 Jun 2003 13:15:54 -0000 1.14 +++ iaxclient_lib.h 13 Jun 2003 18:57:24 -0000 1.15 @@ -78,8 +78,8 @@ }; long iaxc_usecdiff( struct timeval *timeA, struct timeval *timeB ); -void iaxc_handle_network_event(FILE *f, struct iax_event *e, struct peer *p); -void iaxc_service_network(int netfd, FILE *f); +void iaxc_handle_network_event(struct iax_event *e, struct peer *p); +void iaxc_service_network(int netfd); |