Changeset 1516
- Timestamp:
- 12/30/11 13:24:15 (18 months ago)
- Location:
- branches/reyalp-flt
- Files:
-
- 31 edited
-
core/conf.c (modified) (1 diff)
-
core/curves.c (modified) (5 diffs)
-
core/curves.h (modified) (1 diff)
-
core/dng.c (modified) (2 diffs)
-
core/dng.h (modified) (2 diffs)
-
core/edgeoverlay.c (modified) (2 diffs)
-
core/edgeoverlay.h (modified) (1 diff)
-
core/gui.c (modified) (5 diffs)
-
core/gui_debug.c (modified) (1 diff)
-
core/gui_fselect.c (modified) (3 diffs)
-
core/gui_mpopup.c (modified) (1 diff)
-
core/gui_palette.c (modified) (1 diff)
-
core/gui_read.c (modified) (2 diffs)
-
core/gui_snake.c (modified) (1 diff)
-
core/gui_sokoban.c (modified) (1 diff)
-
core/gui_tetris.c (modified) (1 diff)
-
core/luascript.c (modified) (5 diffs)
-
core/main.c (modified) (3 diffs)
-
core/module_exportlist.c (modified) (1 diff)
-
core/module_load.h (modified) (1 diff)
-
core/modules.c (modified) (21 diffs)
-
core/modules.h (modified) (2 diffs)
-
core/modules/module_inspector.c (modified) (1 diff)
-
core/modules/module_menu.c (modified) (1 diff)
-
core/modules/simple_game.c (modified) (1 diff)
-
core/modules/simple_module.c (modified) (1 diff)
-
core/raw.c (modified) (5 diffs)
-
core/raw_merge.c (modified) (2 diffs)
-
core/raw_merge.h (modified) (2 diffs)
-
include/camera.h (modified) (3 diffs)
-
include/gui.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/reyalp-flt/core/conf.c
r1514 r1516 490 490 if ( !module_dng_load(LIBDNG_OWNED_BY_RAW) ) 491 491 return; 492 if (!libdng .badpixel_list_loaded_b()) libdng.load_bad_pixels_list_b("A/CHDK/badpixel.bin");493 if (!libdng .badpixel_list_loaded_b()) conf.dng_raw=0;492 if (!libdng->badpixel_list_loaded_b()) libdng->load_bad_pixels_list_b("A/CHDK/badpixel.bin"); 493 if (!libdng->badpixel_list_loaded_b()) conf.dng_raw=0; 494 494 } 495 else if ( libdng .load_bad_pixels_list_b ) {496 libdng .load_bad_pixels_list_b(0); //unload badpixel.bin495 else if ( libdng && libdng->load_bad_pixels_list_b ) { 496 libdng->load_bad_pixels_list_b(0); //unload badpixel.bin 497 497 module_dng_unload(LIBDNG_OWNED_BY_RAW); 498 498 } -
branches/reyalp-flt/core/curves.c
r1514 r1516 103 103 current_curve_type = curve_type; 104 104 return 1; 105 }106 107 void curve_set_mode(int value) {108 if((value>=0) && (value<=4)) *conf_curve_enable=value;109 curve_init_mode();110 105 } 111 106 … … 411 406 412 407 408 struct libcurves_sym libcurves = { 409 MAKE_API_VERSION(1,0), // apiver: increase major if incomplatible changes made in module, 410 // increase minor if compatible changes made(including extending this struct) 411 curve_init_mode, 412 curve_apply 413 }; 414 413 415 int module_idx=-1; 414 416 … … 419 421 void* MODULE_EXPORT_LIST[] = { 420 422 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER, 421 /* 1 */ (void*)5, 422 423 curve_set_mode, 424 curve_init_mode, 425 curve_apply, 423 /* 1 */ (void*)3, 424 &libcurves 426 425 }; 427 426 … … 438 437 return 1; 439 438 439 if ( !API_VERSION_MATCH_REQUIREMENT( camera_sensor.api_version, 1, 0 ) ) 440 return 1; 441 440 442 // Safe bind of conf. 441 443 tConfigVal configVal; … … 459 461 // This could be happens only if on-load mistake 460 462 // CHDK never unload this library (but load only if needed) 461 // Reason: a) curve_set_mode by LUA is not stored anywhere 462 // b) perfomance reason - to avoid load on each raw_processing 463 // Reason: perfomance reason - to avoid load on each raw_processing 463 464 return 0; 464 465 } -
branches/reyalp-flt/core/curves.h
r1467 r1516 4 4 #define CURVE_DIR "A/CHDK/CURVES" 5 5 6 struct libcurves_sym { 7 int version; 8 9 void (*curve_init_mode)(); 10 void (*curve_apply)(); 11 }; 12 6 13 7 14 // Defines of exported to chdk symbols 8 15 #ifdef THIS_IS_CHDK_CORE 9 16 // This section is for CHDK core 10 extern void (*curve_set_mode)(); 11 extern void (*curve_init_mode)(); 12 extern void (*curve_apply)(); 17 extern struct libcurves_sym* libcurves; 13 18 #else 14 19 // This section is for module 15 extern void curve_set_mode();16 20 extern void curve_init_mode(); 17 21 extern void curve_apply(); -
branches/reyalp-flt/core/dng.c
r1515 r1516 749 749 #include "module_load.h" 750 750 751 void* MODULE_EXPORT_LIST[]= {752 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER,753 /* 1 */ (void*)9,751 struct libdng_sym libdng = { 752 MAKE_API_VERSION(1,0), // apiver: increase major if incomplatible changes made in module, 753 // increase minor if compatible changes made(including extending this struct) 754 754 755 755 create_badpixel_bin, … … 760 760 761 761 convert_dng_to_chdk_raw, 762 write_dng ,762 write_dng 763 763 }; 764 764 765 766 //------------------------------------------- 767 void* MODULE_EXPORT_LIST[] = { 768 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER, 769 /* 1 */ (void*)3, 770 771 &libdng 772 }; 773 774 //-------------------------------------------- 765 775 int _module_loader( void** chdk_export_list ) 766 776 { 767 777 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 768 778 return 1; 779 780 if ( !API_VERSION_MATCH_REQUIREMENT( camera_sensor.api_version, 1, 0 ) ) 781 return 1; 782 if ( !API_VERSION_MATCH_REQUIREMENT( camera_info.api_version, 1, 0 ) ) 783 return 1; 769 784 770 785 return 0; -
branches/reyalp-flt/core/dng.h
r1515 r1516 6 6 // This is to minimize export list to different modules 7 7 struct libdng_sym { 8 int size; // simple guard to detect changing list of exported by library symbols8 int version; 9 9 void (*create_badpixel_bin)(); 10 10 int (*raw_init_badpixel_bin)(); … … 21 21 22 22 // This section is for CHDK core 23 extern struct libdng_sym libdng;23 extern struct libdng_sym* libdng; 24 24 #else 25 25 -
branches/reyalp-flt/core/edgeoverlay.c
r1514 r1516 767 767 **************************************************************/ 768 768 769 void* MODULE_EXPORT_LIST[]= {770 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER,771 /* 1 */ (void*)5,769 struct libedgeovr_sym libedgeovr = { 770 MAKE_API_VERSION(1,0), // apiver: increase major if incomplatible changes made in module, 771 // increase minor if compatible changes made(including extending this struct) 772 772 773 773 edge_overlay, 774 774 save_edge_overlay, 775 775 load_edge_overlay 776 }; 777 778 779 void* MODULE_EXPORT_LIST[] = { 780 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER, 781 /* 1 */ (void*)3, 782 783 &libedgeovr 776 784 }; 777 785 … … 787 795 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 788 796 return 1; 797 798 if ( !API_VERSION_MATCH_REQUIREMENT( camera_sensor.api_version, 1, 0 ) ) 799 return 1; 800 789 801 790 802 tConfigVal configVal; -
branches/reyalp-flt/core/edgeoverlay.h
r1467 r1516 9 9 #define EDGE_SAVE_DIR "A/CHDK/EDGE" 10 10 11 struct libedgeovr_sym { 12 int version; 13 void (*edge_overlay)(); 14 void (*save_edge_overlay)(void); 15 void (*load_edge_overlay)( const char* ); 16 }; 17 18 11 19 // Defines of exported to chdk symbols 12 20 #ifdef THIS_IS_CHDK_CORE 13 21 // This section is for CHDK core 14 extern void (*edge_overlay)(); 15 extern void (*save_edge_overlay)(void); 16 extern void (*load_edge_overlay)( const char* ); 22 extern struct libedgeovr_sym* libedgeovr; 17 23 #else 18 24 // This section is for module -
branches/reyalp-flt/core/gui.c
r1514 r1516 47 47 #define OPTIONS_AUTOSAVE 48 48 #define SPLASH_TIME 20 49 50 struct gui_common_api_ver gui_version = { 51 MAKE_API_VERSION(1,0), // ver of common api: gui_mode, mbox, this structure 52 MAKE_API_VERSION(1,0) // ver of menu structure 53 }; 54 49 55 50 56 //shortcuts … … 1002 1008 // because not clear when it finished 1003 1009 if ( module_dng_load(LIBDNG_OWNED_BY_CREATEBADPIXEL) ) 1004 libdng .create_badpixel_bin();1010 libdng->create_badpixel_bin(); 1005 1011 } 1006 1012 #endif … … 1042 1048 gui_enum_value_change(&conf.curve_enable,change,sizeof(modes)/sizeof(modes[0])); 1043 1049 1044 if(change && curve_init_mode)1045 curve_init_mode();1050 if(change && libcurves && libcurves->curve_init_mode) 1051 libcurves->curve_init_mode(); 1046 1052 return modes[conf.curve_enable]; 1047 1053 } … … 1646 1652 // TODO we could sanity check here, but curve_set_type should fail gracefullish 1647 1653 strcpy(conf.curve_file,fn); 1648 if(conf.curve_enable == 1 && curve_init_mode)1649 curve_init_mode();1654 if(conf.curve_enable == 1 && libcurves && libcurves->curve_init_mode) 1655 libcurves->curve_init_mode(); 1650 1656 } 1651 1657 } … … 2687 2693 static void gui_load_edge_selected( const char* fn ) { 2688 2694 if( fn && module_edgeovr_load()) 2689 l oad_edge_overlay(fn);2695 libedgeovr->load_edge_overlay(fn); 2690 2696 } 2691 2697 2692 2698 void gui_menuproc_edge_save(int arg) { 2693 2699 if ( module_edgeovr_load() ) 2694 save_edge_overlay();2700 libedgeovr->save_edge_overlay(); 2695 2701 } 2696 2702 -
branches/reyalp-flt/core/gui_debug.c
r1514 r1516 183 183 return 1; 184 184 185 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 186 return 1; 187 185 188 tConfigVal configVal; 186 189 CONF_BIND_INT(195, conf_mem_view_addr_init); -
branches/reyalp-flt/core/gui_fselect.c
r1514 r1516 965 965 if (!librawop_p) 966 966 return; //exit if fail 967 if ( !API_VERSION_MATCH_REQUIREMENT( librawop_p->version, 1, 0 ) ) 968 return; 967 969 968 970 if ((fselect_marked_count()>1) && librawop_p->raw_merge_start(raw_operation)) { … … 987 989 if (!librawop_p) 988 990 return; //exit if fail 991 if ( !API_VERSION_MATCH_REQUIREMENT( librawop_p->version, 1, 0 ) ) 992 return; 989 993 990 994 if(!(raw_subtract_from = malloc(300))) //3x full path … … 1325 1329 return 1; 1326 1330 1331 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 1332 return 1; 1333 1327 1334 tConfigVal configVal; 1328 1335 CONF_BIND_INT(209, conf_sub_batch_prefix); -
branches/reyalp-flt/core/gui_mpopup.c
r1513 r1516 173 173 return 1; 174 174 175 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 176 return 1; 177 175 178 return 0; 176 179 } -
branches/reyalp-flt/core/gui_palette.c
r1514 r1516 150 150 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 151 151 return 1; 152 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 153 return 1; 152 154 153 155 return 0; -
branches/reyalp-flt/core/gui_read.c
r1514 r1516 267 267 268 268 reader_is_active = 0; 269 if (!rbf_load(conf_menu_rbf_file))270 rbf_load_from_8x16(current_font);271 rbf_set_codepage(FONT_CP_WIN);269 if (!rbf_load(conf_menu_rbf_file)) 270 rbf_load_from_8x16(current_font); 271 rbf_set_codepage(FONT_CP_WIN); 272 272 if (read_file >= 0) { 273 close(read_file);274 read_file=-1;273 close(read_file); 274 read_file=-1; 275 275 } 276 276 } … … 300 300 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 301 301 return 1; 302 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 303 return 1; 302 304 303 305 tConfigVal configVal; -
branches/reyalp-flt/core/gui_snake.c
r1514 r1516 460 460 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 461 461 return 1; 462 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 463 return 1; 462 464 463 465 return 0; -
branches/reyalp-flt/core/gui_sokoban.c
r1514 r1516 474 474 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 475 475 return 1; 476 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 477 return 1; 476 478 477 479 // Safe bind of conf. -
branches/reyalp-flt/core/gui_tetris.c
r1514 r1516 755 755 return 1; 756 756 757 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 758 return 1; 757 759 758 760 return 0; -
branches/reyalp-flt/core/luascript.c
r1514 r1516 21 21 #include "gui_lang.h" 22 22 #include "gui_draw.h" 23 #include "module_load.h" 23 24 24 25 #include "../lib/lua/lstate.h" // for L->nCcalls, baseCcalls … … 269 270 int value; 270 271 value=luaL_checknumber( L, 1 ); 271 if (module_curves_load()) 272 return luaL_argerror(L,1,"fail to load curves module"); 273 curve_set_mode(value); 272 273 conf.curve_enable = value; 274 if ( libcurves && libcurves->curve_init_mode) 275 libcurves->curve_init_mode(); 276 274 277 return 0; 275 278 } … … 1389 1392 if (!module_rawop_load()) 1390 1393 return luaL_argerror(L,1,"fail to load raw merge module"); 1391 if (op == RAW_OPERATION_SUM || op == RAW_OPERATION_AVERAGE) { 1392 librawop.raw_merge_start(op); 1394 1395 if ( API_VERSION_MATCH_REQUIREMENT( librawop->version, 1, 0 ) && 1396 (op == RAW_OPERATION_SUM || op == RAW_OPERATION_AVERAGE) ) { 1397 librawop->raw_merge_start(op); 1393 1398 } 1394 1399 else { … … 1403 1408 if (!module_rawop_load()) 1404 1409 return luaL_argerror(L,1,"fail to load raw merge module"); 1405 librawop .raw_merge_add_file(luaL_checkstring( L, 1 ));1410 librawop->raw_merge_add_file(luaL_checkstring( L, 1 )); 1406 1411 return 0; 1407 1412 } … … 1411 1416 if (!module_rawop_load()) 1412 1417 return luaL_argerror(L,1,"fail to load raw merge module"); 1413 librawop .raw_merge_end();1418 librawop->raw_merge_end(); 1414 1419 return 0; 1415 1420 } -
branches/reyalp-flt/core/main.c
r1515 r1516 19 19 20 20 _cam_sensor camera_sensor = { 21 MAKE_API_VERSION(1,0), 22 21 23 CAM_SENSOR_BITS_PER_PIXEL, 22 24 CAM_BLACK_LEVEL, CAM_WHITE_LEVEL, … … 63 65 _cam_info camera_info = 64 66 { 67 MAKE_API_VERSION(1,0), 68 65 69 { 66 70 #if defined(PARAM_CAMERA_NAME) … … 275 279 } 276 280 else if (module_edgeovr_load()) { 277 edge_overlay();281 libedgeovr->edge_overlay(); 278 282 } 279 283 } -
branches/reyalp-flt/core/module_exportlist.c
r1515 r1516 301 301 &camera_sensor, 302 302 &altGuiHandler, 303 &gui_version, 303 304 0 304 305 }; -
branches/reyalp-flt/core/module_load.h
r1493 r1516 60 60 #define CONF_BIND_STR(idConf,var) if ( conf_getValue(idConf, &configVal) == CONF_CHAR_PTR ) { var = (char*)configVal.str; } else { return 1;} 61 61 62 // API versions check 63 //--------------------------- 64 #define MAKE_CHDKVER(major,minor,last) (major*10000+minor*100+last) 65 #define MAKE_API_VERSION(major,minor) ((major<<16)+minor) 66 #define API_VERSION_MATCH_REQUIREMENT( api_ver, req_major, req_minor ) ((api_ver>>16)==req_major && (api_ver&0xffff)>=req_minor) 67 62 68 63 69 #endif /* __MODULE_LOAD_H__ */ -
branches/reyalp-flt/core/modules.c
r1512 r1516 17 17 /************* DYNAMIC LIBRARY RAWOPERATION ******/ 18 18 19 int (*raw_merge_start)(int action);20 void (*raw_merge_add_file)(const char * filename);21 void (*raw_merge_end)(void);22 int (*raw_subtract)(const char *from, const char *sub, const char *dest);23 24 19 #if CAM_SENSOR_BITS_PER_PIXEL==10 25 20 #define MODULE_NAME_RAWOP "_rawop10.flt" … … 31 26 32 27 // This is to minimize sharing sym to use this lib in other modules 33 struct librawop_sym librawop;28 struct librawop_sym* librawop; 34 29 35 30 static int bind_module_rawop( void** export_list ) … … 37 32 // Unbind 38 33 if ( !export_list ) { 39 librawop.raw_merge_start =0; 40 librawop.raw_merge_add_file =0; 41 librawop.raw_merge_end =0; 42 librawop.raw_subtract =0; 34 librawop=0; 43 35 return 0; 44 36 } … … 47 39 if ( (unsigned int)export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 48 40 return 1; 49 if ( (unsigned int)export_list[1] <6 ) 50 return 1; 51 52 librawop.raw_merge_start = export_list[2]; 53 librawop.raw_merge_add_file = export_list[3]; 54 librawop.raw_merge_end = export_list[4]; 55 librawop.raw_subtract = export_list[5]; 41 if ( (unsigned int)export_list[1] <3 ) 42 return 1; 43 44 librawop = export_list[2]; 45 46 if ( !librawop ) 47 return 1; 48 49 /* NO API VERSION CHECK HERE - EACH MODULE CHECK THIS AGAINST ITS REQUIREMENT 50 if ( !API_VERSION_MATCH_REQUIREMENT( librawop->version, 1, 0 ) ) { 51 librawop=0; 52 return 1; 53 } 54 */ 55 56 56 return 0; 57 57 } … … 59 59 void module_rawop_unload() 60 60 { 61 if (librawop .raw_merge_start==0)61 if (librawop==0) 62 62 return; 63 63 … … 71 71 static int module_idx=-1; 72 72 73 if (librawop .raw_merge_start)74 return &librawop;73 if (librawop) 74 return librawop; 75 75 76 76 module_idx=module_load(MODULE_NAME_RAWOP, bind_module_rawop ); 77 if ( module_idx<0 ) {77 if ( module_idx<0 ) 78 78 module_unload(MODULE_NAME_RAWOP); 79 } 80 81 82 return (librawop.raw_merge_start)?&librawop:0 ; 79 80 return librawop; 83 81 } 84 82 … … 89 87 #define MODULE_NAME_EDGEOVR "edgeovr.flt" 90 88 91 void (*edge_overlay)(); 92 void (*save_edge_overlay)(void); 93 void (*load_edge_overlay)( const char* ); 89 struct libedgeovr_sym* libedgeovr; 94 90 95 91 static int bind_module_edgeovr( void** export_list ) … … 97 93 // Unbind 98 94 if ( !export_list ) { 99 edge_overlay =0; 100 save_edge_overlay =0; 101 load_edge_overlay =0; 95 libedgeovr =0; 102 96 return 0; 103 97 } … … 106 100 if ( (unsigned int)export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 107 101 return 1; 108 if ( (unsigned int)export_list[1] <5 ) 109 return 1; 110 111 edge_overlay = export_list[2]; 112 save_edge_overlay = export_list[3]; 113 load_edge_overlay = export_list[4]; 102 if ( (unsigned int)export_list[1] <3 ) 103 return 1; 104 105 libedgeovr = export_list[2]; 106 if ( !libedgeovr ) 107 return 1; 108 if ( !API_VERSION_MATCH_REQUIREMENT( libedgeovr->version, 1, 0 ) ) { 109 libedgeovr=0; 110 return 1; 111 } 112 114 113 return 0; 115 114 } 116 115 117 116 // Return: 0-fail, 1-ok 118 intmodule_edgeovr_load()119 { 120 if ( edge_overlay)121 return 1;117 struct libedgeovr_sym* module_edgeovr_load() 118 { 119 if (libedgeovr) 120 return libedgeovr; 122 121 123 122 // This flag is because edgeovr called each tick … … 141 140 } 142 141 143 return (edge_overlay==0)?0:1; 144 } 145 142 return libedgeovr; 143 } 144 145 146 // edgeovr module will never unload to keep its picture 147 // void module_edgeovr_unload() {} 146 148 147 149 … … 150 152 #define MODULE_NAME_CURVES "curves.flt" 151 153 152 void (*curve_set_mode)(); 153 void (*curve_init_mode)(); 154 void (*curve_apply)(); 155 154 struct libcurves_sym* libcurves; 156 155 157 156 static int bind_module_curves( void** export_list ) … … 159 158 // Unbind 160 159 if ( !export_list ) { 161 curve_set_mode =0; 162 curve_init_mode =0; 163 curve_apply =0; 160 libcurves=0; 164 161 return 0; 165 162 } … … 168 165 if ( (unsigned int)export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 169 166 return 1; 170 if ( (unsigned int)export_list[1] <5 ) 171 return 1; 172 173 curve_set_mode = export_list[2]; 174 curve_init_mode = export_list[3]; 175 curve_apply = export_list[4]; 176 return 0; 177 } 178 179 // Return: 0-fail, 1-ok 180 int module_curves_load() 181 { 182 183 if (curve_apply) 184 return 1; 167 if ( (unsigned int)export_list[1] <3 ) 168 return 1; 169 170 libcurves = export_list[2]; 171 172 if ( !libcurves ) 173 return 1; 174 if ( !API_VERSION_MATCH_REQUIREMENT( libcurves->version, 1, 0 ) ) { 175 librawop=0; 176 return 1; 177 } 178 179 return 0; 180 } 181 182 // Return: 0-fail, addr-ok 183 struct libcurves_sym* module_curves_load() 184 { 185 if (libcurves) 186 return libcurves; 185 187 186 188 static int module_idx=-1; … … 198 200 } 199 201 200 return (curve_apply==0)?0:1;202 return libcurves; 201 203 } 202 204 … … 253 255 static int module_dng_semaphore; 254 256 255 struct libdng_sym libdng;257 struct libdng_sym* libdng; 256 258 257 259 #if DNG_SUPPORT … … 260 262 // Unbind 261 263 if ( !export_list ) { 262 memset(&libdng, 0, sizeof(libdng));264 libdng=0; 263 265 return 0; 264 266 } … … 267 269 if ( (unsigned int)export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 268 270 return 1; 269 if ( (unsigned int)export_list[1] < 9)270 return 1; 271 272 libdng .size = ((int)export_list[1])-2;273 libdng.create_badpixel_bin=export_list[2]; 274 libdng.raw_init_badpixel_bin=export_list[3];275 libdng.capture_data_for_exif=export_list[4]; 276 libdng.load_bad_pixels_list_b=export_list[5];277 libdng.badpixel_list_loaded_b=export_list[6];278 279 libdng.convert_dng_to_chdk_raw=export_list[7];280 libdng.write_dng=export_list[8]; 271 if ( (unsigned int)export_list[1] < 3 ) 272 return 1; 273 274 libdng = export_list[2]; 275 if ( libdng==0 ) 276 return 1; 277 278 if ( !API_VERSION_MATCH_REQUIREMENT( libdng->version, 1, 0 ) ) { 279 libdng=0; 280 return 1; 281 } 282 281 283 return 0; 282 284 } … … 286 288 { 287 289 #if DNG_SUPPORT 288 if (libdng .create_badpixel_bin==0)290 if (libdng==0) 289 291 return; 290 292 … … 305 307 306 308 module_dng_semaphore|=owner; 307 if (libdng .create_badpixel_bin)308 return &libdng;309 if (libdng) 310 return libdng; 309 311 310 312 module_idx=module_load(MODULE_NAME_DNG, bind_module_dng ); … … 318 320 } 319 321 320 return (libdng.create_badpixel_bin)?&libdng:0;322 return libdng; 321 323 #else 322 324 return 0; … … 335 337 if ( !module_dng_load(LIBDNG_OWNED_BY_CONVERT) ) 336 338 return 0; 337 libdng .convert_dng_to_chdk_raw(fn);339 libdng->convert_dng_to_chdk_raw(fn); 338 340 module_dng_unload(LIBDNG_OWNED_BY_CONVERT); 339 341 return 1; -
branches/reyalp-flt/core/modules.h
r1512 r1516 14 14 #include "edgeoverlay.h" 15 15 16 int module_edgeovr_load(); // 0fail, 1ok16 struct libedgeovr_sym* module_edgeovr_load(); // 0fail, addr-ok 17 17 18 18 // MODULE "CURVES" … … 20 20 #include "curves.h" 21 21 22 int module_curves_load(); // 0fail, 1ok22 struct libcurves_sym* module_curves_load(); // 0fail, addr-ok 23 23 24 24 // MODULE "PALETTE" -
branches/reyalp-flt/core/modules/module_inspector.c
r1514 r1516 31 31 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 32 32 return 1; 33 34 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 35 return 1; 33 36 34 37 _getmeminfo = chdk_export_list[MODULESYM_GETMEMINFO]; -
branches/reyalp-flt/core/modules/module_menu.c
r1514 r1516 296 296 if ( chdk_export_list[MODULESYM_GUI_MENU_RUN_FLTMODULE] == 0) 297 297 return 1; 298 299 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.menu_api, 1, 0 ) ) 300 return 1; 298 301 299 302 return 0; -
branches/reyalp-flt/core/modules/simple_game.c
r1514 r1516 32 32 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 33 33 return 1; 34 35 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 36 return 1; 34 37 35 38 return 0; -
branches/reyalp-flt/core/modules/simple_module.c
r1483 r1516 29 29 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 30 30 return 1; 31 32 if ( !API_VERSION_MATCH_REQUIREMENT( gui_version.common_api, 1, 0 ) ) 33 return 1; 31 34 32 35 return 0; -
branches/reyalp-flt/core/raw.c
r1514 r1516 52 52 if (conf.dng_raw) { 53 53 if ( module_dng_load(LIBDNG_OWNED_BY_RAW) ) 54 libdng .capture_data_for_exif();54 libdng->capture_data_for_exif(); 55 55 } 56 56 #endif … … 63 63 #if DNG_SUPPORT 64 64 // count/save badpixels if requested 65 if( libdng .raw_init_badpixel_bin &&66 libdng .raw_init_badpixel_bin()) {65 if( libdng->raw_init_badpixel_bin && 66 libdng->raw_init_badpixel_bin()) { 67 67 return 0; 68 68 } … … 79 79 if (conf.curve_enable) { 80 80 if (module_curves_load()) 81 curve_apply();81 libcurves->curve_apply(); 82 82 } 83 83 #endif … … 148 148 { 149 149 if ( module_dng_load(LIBDNG_OWNED_BY_RAW) ) { 150 libdng .write_dng(fd, rawadr, altrawadr, CAM_UNCACHED_BIT );150 libdng->write_dng(fd, rawadr, altrawadr, CAM_UNCACHED_BIT ); 151 151 } 152 152 } … … 179 179 if (conf.curve_enable) { 180 180 if (module_curves_load()) 181 curve_apply();181 libcurves->curve_apply(); 182 182 } 183 183 #endif -
branches/reyalp-flt/core/raw_merge.c
r1514 r1516 379 379 **************************************************************/ 380 380 381 void* MODULE_EXPORT_LIST[] = { 382 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER, 383 /* 1 */ (void*)6, 384 381 struct librawop_sym librawop = { 382 MAKE_API_VERSION(1,0), // apiver: increase major if incomplatible changes made in module, 383 // increase minor if compatible changes made(including extending this struct) 385 384 raw_merge_start, 386 385 raw_merge_add_file, 387 386 raw_merge_end, 388 387 raw_subtract 388 }; 389 390 391 void* MODULE_EXPORT_LIST[] = { 392 /* 0 */ (void*)EXPORTLIST_MAGIC_NUMBER, 393 /* 1 */ (void*)3, 394 395 &librawop 389 396 }; 390 397 … … 400 407 if ( (unsigned int)chdk_export_list[0] != EXPORTLIST_MAGIC_NUMBER ) 401 408 return 1; 409 410 if ( !API_VERSION_MATCH_REQUIREMENT( camera_sensor.api_version, 1, 0 ) ) 411 return 1; 402 412 403 413 return 0; -
branches/reyalp-flt/core/raw_merge.h
r1467 r1516 7 7 8 8 struct librawop_sym{ 9 int version; 9 10 int (*raw_merge_start)(int action); 10 11 void (*raw_merge_add_file)(const char * filename); … … 16 17 #ifdef THIS_IS_CHDK_CORE 17 18 // This section is for CHDK core 18 19 extern struct librawop_sym librawop; 20 19 extern struct librawop_sym* librawop; 21 20 #else 22 21 // This section is for module 23 24 22 int raw_merge_start(int action); 25 23 void raw_merge_add_file(const char * filename); -
branches/reyalp-flt/include/camera.h
r1515 r1516 223 223 224 224 typedef struct { 225 int api_version; // version of this structure 226 225 227 int bits_per_pixel; 226 228 int black_level; … … 256 258 extern _cam_sensor camera_sensor; 257 259 260 // if this struct changed, please change gui_version.common_api 258 261 typedef struct 259 262 { … … 267 270 typedef struct 268 271 { 272 int api_version; // version of this structure 273 269 274 struct 270 275 { -
branches/reyalp-flt/include/gui.h
r1513 r1516 78 78 extern void gui_menu_run_fltmodule(int arg); 79 79 80 //---------------------------- 81 struct gui_common_api_ver { 82 unsigned int common_api; // common gui version: gui_mode handling, mbox, this structure 83 unsigned int menu_api; // cmenu structure version 84 }; 85 86 // Defined in gui.c 87 extern struct gui_common_api_ver gui_version; 88 80 89 #endif
Note: See TracChangeset
for help on using the changeset viewer.