transport.h

Go to the documentation of this file.
00001 
00034 #ifndef _TRANSPORT_H_
00035 #define _TRANSPORT_H_
00036 
00037 #include <sys/types.h>
00038 
00039 #ifdef LINUX
00040 #include <unistd.h>
00041 #endif
00042 
00043 #include "defines.h"
00044 #include "alc_session.h"
00045 #include "blocking_alg.h"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00056 typedef struct trans_unit {
00057 
00058   struct trans_unit     *prev;  
00059   struct trans_unit     *next;  
00060   unsigned int esi;                     
00061   unsigned short len;           
00062   char *data;                           
00064 #ifdef _MSC_VER
00065   __int64 offset;                       
00066 #else
00067   off64_t offset;                       
00068 #endif
00069 
00070 #ifdef USE_RETRIEVE_UNIT
00071   unsigned char used;       
00072 #endif
00073 
00074 } trans_unit_t;
00075 
00076 #ifdef USE_RETRIEVE_UNIT
00077 
00083 typedef struct trans_unit_container {
00084         struct trans_unit_container     *next;  
00085         struct trans_unit u;                            
00086 } trans_unit_container_t;
00087 #endif
00088 
00094 typedef struct trans_block {
00095 
00096   unsigned int sbn;                             
00097   struct trans_unit *unit_list; 
00098   struct trans_unit     *last_unit;     
00099   unsigned int nb_of_rx_units;  
00100   unsigned int n;                               
00101   unsigned int k;                               
00102   unsigned int max_k;                   
00103   unsigned int max_n;                   
00104   unsigned char finite_field;   
00106 } trans_block_t;
00107 
00113 typedef struct trans_obj {
00114 
00115   struct trans_obj *prev;                       
00116   struct trans_obj *next;                       
00117   struct trans_block *block_list;       
00118   unsigned int nb_of_ready_blocks;      
00119   unsigned char fec_enc_id;                     
00120   unsigned short fec_inst_id;           
00121   unsigned char content_enc_algo;       
00122   unsigned long long len;                       
00123   unsigned long long rx_bytes;          
00124   unsigned long long toi;                       
00125   unsigned int es_len;                          
00126   unsigned int max_sb_len;                      
00127   struct blocking_struct  *bs;          
00128   char *tmp_filename;                           
00129   int fd;                                                       
00130   char *tmp_st_filename;                        
00131   int fd_st;                                            
00132   double last_print_rx_percent;         
00134 } trans_obj_t;
00135 
00136 
00144 trans_obj_t* create_object(void);
00145 
00153 trans_block_t* create_block(void);
00154 
00165 trans_unit_t* create_units(unsigned int number);
00166 
00174 void free_units(trans_block_t *tb);
00175 
00176 #ifdef USE_RETRIEVE_UNIT
00177 
00188 trans_unit_t* retrieve_unit(alc_session_t *s, unsigned short es_len);
00189 
00198 void free_units2(trans_block_t *tb);
00199 #endif
00200 
00210 void insert_object(trans_obj_t *to, alc_session_t *s, int type);
00211 
00223 int insert_unit(trans_unit_t *tu, trans_block_t *tb, trans_obj_t *to);
00224 
00234 void free_object(trans_obj_t *to, alc_session_t *s, int type);
00235 
00236 #ifdef __cplusplus
00237 }; //extern "C"
00238 #endif
00239 
00240 #endif

Generated on Fri Mar 9 20:08:51 2007 for MAD-FCL by  doxygen 1.5.0