00001 /* CONFIG.H */ 00002 00003 #ifndef _CONFIG_H_ 00004 #define _CONFIG_H_ 00005 00006 #include "al.h" 00007 #include "al_sending.h" 00008 #include "al_receiving.h" 00009 #include "mux.h" 00010 #include "demux.h" 00011 #include "video_codec.h" 00012 #include "audio.h" 00013 00014 #define MAX_VIDEO_CODECS 10 00015 #define MAX_AUDIO_CODECS 10 00016 #define MAX_DATA_CODECS 10 00017 00018 00019 typedef struct { 00020 al_sending_entity *output; 00021 al_receiving_entity *input; 00022 00023 /* Put some other stuff here */ 00024 00025 } data_codec; 00026 00027 typedef struct { 00028 al_sending_entity *output; 00029 al_receiving_entity *input; 00030 00031 /* Put some other stuff here */ 00032 00033 } control; 00034 00035 00036 typedef struct { 00037 control *Control; 00038 channel_info ciControl; 00039 00040 audio_codec *Audio; 00041 channel_info ciAudio; 00042 00043 video_codec *Video; 00044 channel_info ciVideo; 00045 00046 mux *Mux; 00047 demux *Demux; 00048 channel *Channel; /* outgoing channel */ 00049 mux_parameters *mux_params; 00050 } _side; 00051 00052 00053 typedef struct { 00054 00055 _side local, remote; 00056 00057 } _session; 00058 00059 /* 00060 * Function prototypes: 00061 * 00062 * The functions in this file are all used only by the other 00063 * functions in this file, except one. 00064 * set_config(argc, argv); is called from the outside to 00065 * do the whole system configuration. 00066 * 00067 * Called from main.c 00068 */ 00069 00070 static void usage(void); 00071 /* 00072 * This function prints out the users command-line options 00073 */ 00074 00075 static void add_alse(mux *m, al_sending_entity *alse); 00076 /* 00077 * This function adds an al_sending_entity to its appropriate 00078 * place in the mux structure 00079 * Note: this function does NOT create a new alse, the calling 00080 * function must call new_al_sending_entity(..) first 00081 */ 00082 00083 static void add_alre(demux *d, al_receiving_entity *alre); 00084 /* 00085 * This function adds an al_receiving entity to its appropriate 00086 * place in the demux structure 00087 * Note: this function does NOT create a new alre, the calling 00088 * function must call new_al_receiving_entity(..) first 00089 */ 00090 00091 control *new_control(void); 00092 /* 00093 * This function allocates memory for a new control structure 00094 */ 00095 00096 static void parse_line(char *s, char *name, char *arg); 00097 /* 00098 * This function parses a line of the config file 00099 */ 00100 00101 void video_config(video_codec *video); 00102 /* 00103 * This function is called when the video portion of the config 00104 * file is reached, and it sets up the video_codec 00105 */ 00106 00107 void audio_config(audio_codec *A); 00108 /* 00109 * This function is called when the audio portion of the config 00110 * file is reached, and it sets up the audio_codec 00111 */ 00112 00113 void control_config(control *C); 00114 /* 00115 * Sets up a control structure, expects nothing for now 00116 */ 00117 00118 void mux_table_config(mux *M); 00119 /* 00120 * This function gets the mux table entries that are in 00121 * the config file 00122 */ 00123 00124 void mux_config(mux *M); 00125 /* 00126 * This gets general multiplexing protocol settings from the config file 00127 */ 00128 00129 void channel_config(channel *C); 00130 /* 00131 * Gets the channel characteristics from the config file 00132 */ 00133 00134 void side_config(_side *side); 00135 /* 00136 * for one "side" of the connection, takes care of calling 00137 * the audio, video and control config functions 00138 */ 00139 00140 void get_config(); 00141 /* 00142 * calls side_config(..) for both the local and remote "sides" 00143 */ 00144 00145 void start_config(); 00146 /* 00147 * This makes sure that all the structures have been created 00148 * so the rest of the functions have something to configurate 00149 */ 00150 00151 void finish_config(); 00152 /* 00153 * This sets up the logical channels 00154 */ 00155 00156 void set_config(int argc, char *argv[]); 00157 /* 00158 * This function is called by the main function to set up the system. 00159 * It makes changes to the session structure. 00160 */ 00161 00162 #endif 00163