Main Page | Class List | File List | Class Members | File Members

main.c File Reference

#include "standard.h"
#include "config.h"

Go to the source code of this file.

Functions

void program_info (void)
void main_loop (void)
void cleanup (void)
void sig_int ()
void sig_quit ()
int main (int argc, char *argv[])

Variables

_session session
int debug
int Quit_Mux
char * mux_version
char * build_date
int mux_build


Function Documentation

void cleanup void   )  [static]
 

Definition at line 79 of file main.c.

References _side::Audio, _side::Channel, close_audio_codec(), close_channel(), close_demux(), close_mux(), close_video_codec(), _side::Demux, _session::local, _side::Mux, _session::remote, session, and _side::Video.

Referenced by main().

00080 {
00081 
00082   /*
00083    * Close received audio files. 
00084    */
00085   close_audio_codec(session.local.Audio);
00086   close_audio_codec(session.remote.Audio);
00087 
00088   /*
00089    * Close video codecs. 
00090    */
00091   close_video_codec(session.local.Video);
00092   close_video_codec(session.remote.Video);
00093 
00094   /*
00095    * Close muxes.
00096    */
00097 
00098   close_mux(session.local.Mux);
00099   close_mux(session.remote.Mux);
00100 
00101   /*
00102    * Close demuxes.
00103    */
00104 
00105   close_demux(session.local.Demux);
00106   close_demux(session.remote.Demux);
00107 
00108   /* 
00109    * Close channels
00110    */
00111 
00112   close_channel(session.local.Channel);
00113   close_channel(session.remote.Channel);
00114 
00115 }

int main int  argc,
char *  argv[]
 

Definition at line 131 of file main.c.

References cleanup(), main_loop(), program_info(), set_config(), sig_int(), and sig_quit().

00132 {
00133   if (signal(SIGINT, SIG_IGN) != SIG_IGN)
00134     signal(SIGINT, sig_int);
00135   if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
00136     signal(SIGQUIT, sig_quit);
00137 
00138   program_info();
00139   
00140   set_config(argc, argv);
00141   
00142   main_loop();
00143   
00144   cleanup();
00145 
00146   exit(0);
00147 }

void main_loop void   )  [static]
 

Definition at line 47 of file main.c.

References _side::Audio, code_audio(), code_video(), decode_audio(), decode_video(), demultiplex(), _side::Demux, increment_clock(), interface(), _session::local, multiplex(), _side::Mux, print_time(), Quit_Mux, _session::remote, session, and _side::Video.

Referenced by main().

00048 {
00049   int *jblock;
00050   int j;
00051 
00052   Quit_Mux = 0;
00053   while (!Quit_Mux) { 
00054     printf("%s Main Loop\n", print_time());
00055     interface();
00056 
00057     code_video(session.local.Video);
00058     code_video(session.remote.Video);  
00059       
00060     code_audio(session.local.Audio);
00061     code_audio(session.remote.Audio);  
00062     
00063     multiplex(session.local.Mux, 3);   /* num channels hard coded to 3 */
00064     multiplex(session.remote.Mux, 3);  /* num channels hard coded to 3 */
00065       
00066     demultiplex(session.local.Demux);
00067     demultiplex(session.remote.Demux);
00068       
00069     decode_audio(session.local.Audio);
00070     decode_audio(session.remote.Audio);
00071      
00072     decode_video(session.local.Video);
00073     decode_video(session.remote.Video);
00074      
00075     increment_clock();
00076   }
00077 }

void program_info void   )  [static]
 

Definition at line 34 of file main.c.

References build_date, mux_build, and mux_version.

Referenced by main().

00035 {
00036   printf("\n");
00037   printf("H.223 Multiplex Simulator Version %s\n",mux_version);
00038   printf("Copyright (C) 1997 UCLA and Samsung Electronics Company\n");
00039   printf("This simulator comes with ABSOLUTELY NO WARRANTY, for details see\n");
00040   printf("the GNU Public license included with the distribution (LICENSE)\n");
00041   printf("\n");
00042   printf("build %d %s\n", mux_build, build_date);
00043   printf("\n");
00044 }

void sig_int  ) 
 

Definition at line 118 of file main.c.

References mux_version.

Referenced by main().

00119 {
00120   fprintf(stderr, "\n\n%s: Caught SIGINT.  Exiting.\n\n", mux_version);
00121   exit(1);
00122 }

void sig_quit  ) 
 

Definition at line 124 of file main.c.

References mux_version.

Referenced by main().

00125 {
00126   fprintf(stderr, "\n\n%s: Caught SIGQUIT.  Exiting.\n\n", mux_version);
00127   exit(1);
00128 }


Variable Documentation

char* build_date
 

Definition at line 4 of file version.c.

Referenced by program_info().

int debug
 

Definition at line 23 of file main.c.

int mux_build
 

Definition at line 5 of file version.c.

Referenced by program_info().

char* mux_version
 

Definition at line 3 of file version.c.

Referenced by program_info(), sig_int(), and sig_quit().

int Quit_Mux
 

Definition at line 24 of file main.c.

Referenced by do_cmd(), and main_loop().

_session session
 

Definition at line 22 of file main.c.

Referenced by cleanup(), finish_config(), get_config(), main_loop(), and start_config().


Generated on Sun Jul 16 16:27:47 2006 by  doxygen 1.3.9.1