00001 #ifndef PHP_ELPHEL_H 00002 #define PHP_ELPHEL_H 1 00003 00004 #ifdef ZTS 00005 #include "TSRM.h" 00006 #warning Using TSRM.h 00007 #else 00008 #warning Not using TSRM.h 00009 #endif 00010 00011 #include <asm/elphel/c313a.h> 00012 #include <asm/elphel/exifa.h> 00013 #include <asm/elphel/autoexp.h> 00014 00015 ZEND_BEGIN_MODULE_GLOBALS(elphel) 00016 int fd_exif; 00017 int fd_exifdir; 00018 int fd_exifmeta; 00019 int exif_size; // to see if verify exif directory has changed 00020 struct exif_dir_table_t exif_dir[ExifKmlNumber] ; 00021 00022 00024 int fd_circ; 00025 unsigned long * ccam_dma_buf; 00026 unsigned long ccam_dma_buf_len; // in bytes 00027 //struct framepars_t *framePars; 00028 00030 00031 int fd_fparmsall; 00032 struct framepars_all_t *frameParsAll; 00033 struct framepars_t *framePars; 00034 struct framepars_past_t *pastPars; 00035 unsigned long *funcs2call; 00036 unsigned long *globalPars; 00037 00038 00040 //static struct gamma_stuct_t gammas[GAMMA_CACHE_NUMBER] __attribute__ ((aligned (PAGE_SIZE))); 00041 // struct gamma_stuct_t * gammas_p; /// to use with mmap 00042 int fd_gamma_cache; 00043 struct gamma_stuct_t * gamma_cache; 00044 00045 //static struct histogram_stuct_t histograms[HISTOGRAM_CACHE_NUMBER] __attribute__ ((aligned (PAGE_SIZE))); 00046 00047 int fd_histogram_cache; 00048 struct histogram_stuct_t * histogram_cache; 00049 00050 ZEND_END_MODULE_GLOBALS(elphel) 00052 #ifdef ZTS 00053 #define ELPHEL_G(v) TSRMG(elphel_globals_id, zend_elphel_globals *, v) 00054 #else 00055 #define ELPHEL_G(v) (elphel_globals.v) 00056 #endif 00057 00058 #define PHP_ELPHEL_VERSION "1.0" 00059 #define PHP_ELPHEL_EXTNAME "elphel" 00060 #define ELPHEL_GLOBALPARS(x) (((unsigned long *) ELPHEL_G(globalPars))[x-FRAMEPAR_GLOBALS]) 00061 00062 PHP_FUNCTION(elphel_get_frame); 00063 PHP_FUNCTION(elphel_skip_frames); 00064 PHP_FUNCTION(elphel_wait_frame_abs); 00065 PHP_FUNCTION(elphel_framepars_get_raw); 00066 PHP_FUNCTION(elphel_parse_P_name); 00067 PHP_FUNCTION(elphel_is_global_par); 00068 PHP_FUNCTION(elphel_is_frame_par); 00069 PHP_FUNCTION(elphel_get_P_value); 00070 PHP_FUNCTION(elphel_set_P_value); 00071 PHP_FUNCTION(elphel_get_P_arr); 00072 PHP_FUNCTION(elphel_set_P_arr); 00073 PHP_FUNCTION(elphel_gamma_add); 00074 PHP_FUNCTION(elphel_gamma_add_custom); 00075 PHP_FUNCTION(elphel_gamma_get); 00076 PHP_FUNCTION(elphel_gamma_get_index); 00077 PHP_FUNCTION(elphel_gamma_get_raw); 00078 PHP_FUNCTION(elphel_histogram_get_raw); 00079 PHP_FUNCTION(elphel_histogram_get); 00080 00081 PHP_FUNCTION(elphel_get_state); 00082 00083 PHP_FUNCTION(elphel_compressor_reset); 00084 PHP_FUNCTION(elphel_compressor_run); 00085 PHP_FUNCTION(elphel_compressor_stop); 00086 PHP_FUNCTION(elphel_compressor_frame); 00087 00088 PHP_FUNCTION(elphel_reset_sensor); 00089 PHP_FUNCTION(elphel_set_fpga_time); 00090 PHP_FUNCTION(elphel_get_fpga_time); 00091 PHP_FUNCTION(elphel_wait_frame); 00092 PHP_FUNCTION(elphel_fpga_read); 00093 PHP_FUNCTION(elphel_fpga_write); 00094 PHP_FUNCTION(elphel_gamma); 00095 PHP_FUNCTION(elphel_reverse_gamma); 00096 PHP_FUNCTION(elphel_histogram); 00097 PHP_FUNCTION(elphel_reverse_histogram); 00098 PHP_FUNCTION(elphel_get_exif_field); 00099 PHP_FUNCTION(elphel_set_exif_field); 00100 PHP_FUNCTION(elphel_get_interframe_meta); 00101 PHP_FUNCTION(elphel_get_exif_elphel); 00102 PHP_FUNCTION(elphel_get_circbuf_pointers); 00103 PHP_FUNCTION(elphel_update_exif); // force to rebuild directory after Exif format was changed Usually done automatically 00104 00105 00106 PHP_MINIT_FUNCTION(elphel); 00107 PHP_MSHUTDOWN_FUNCTION(elphel); 00108 PHP_RINIT_FUNCTION(elphel); 00109 PHP_MINFO_FUNCTION(elphel); 00110 extern zend_module_entry elphel_module_entry; 00111 #define phpext_elphel_ptr &elphel_module_entry 00112 //static void init_sens(); 00113 int splitConstantName(char * name); 00114 int get_histogram_index (long color,long frame, long needreverse); 00115 unsigned long get_imageParamsThat (int indx, unsigned long frame); 00116 00117 #endif