Changeset 1915


Ignore:
Timestamp:
06/11/12 08:08:25 (11 months ago)
Author:
philmoz
Message:

Updates to modules to improve platform independence.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/conf.c

    r1874 r1915  
    350350    CONF_INFO(205, conf.fast_movie_quality_control, CONF_DEF_VALUE, i:1, NULL), 
    351351    CONF_INFO(206, conf.remote_zoom_enable,         CONF_DEF_VALUE, i:0, NULL), 
    352     CONF_INFO(207, conf.zoom_timeout,               CONF_DEF_VALUE, i:5, NULL), 
     352//    CONF_INFO(207, conf.zoom_timeout,               CONF_DEF_VALUE, i:5, NULL),   // Not used 
    353353        CONF_INFO(208, conf.start_sound,                CONF_DEF_VALUE, i:0, NULL), 
    354354    CONF_INFO(209, conf.sub_batch_prefix,           CONF_DEF_VALUE, i:RAW_PREFIX_SND, NULL), // SND_ 
  • trunk/core/dng.c

    r1866 r1915  
    1 #include "camera.h" 
    2  
    31#include "stdlib.h" 
    42#include "string.h" 
     
    4846static char copyright[64]               = ""; 
    4947const short cam_PreviewBitsPerSample[]  = {8,8,8}; 
    50 const char cam_chdk_ver[]               = HDK_VERSION" ver. "BUILD_NUMBER; 
    5148const int cam_Resolution[]              = {180,1}; 
    5249static int cam_AsShotNeutral[]          = {1000,1000,1000,1000,1000,1000}; 
     
    7572#define BE(v)   ((v&0x000000FF)<<24)|((v&0x0000FF00)<<8)|((v&0x00FF0000)>>8)|((v&0xFF000000)>>24)   // Convert to big_endian 
    7673 
     74#define BADPIX_CFA_INDEX    6   // Index of CFAPattern value in badpixel_opcodes array 
     75 
    7776static unsigned int badpixel_opcode[] = 
    7877{ 
     
    8685    BE(8),              // Opcode length = 8 bytes 
    8786    BE(0),              // Constant = 0 
    88 #if   cam_CFAPattern == 0x02010100 
    89     BE(1),              // BayerPhase = 1 (top left pixel is green in a green/red row) 
    90 #elif cam_CFAPattern == 0x01020001 
    91     BE(0),              // BayerPhase = 0 (top left pixel is red) 
    92 #elif cam_CFAPattern == 0x01000201 
    93     BE(3),              // BayerPhase = 3 (top left pixel is blue) 
    94 #elif cam_CFAPattern == 0x00010102 
    95     BE(2),              // BayerPhase = 2 (top left pixel is green in a green/blue row) 
    96 #endif 
     87    BE(0),              // CFAPattern (set in code below) 
    9788}; 
    9889 
     
    10495#define THUMB_DATA_INDEX            9       // tag 0x111 
    10596#define ORIENTATION_INDEX           10      // tag 0x112 
     97#define CHDK_VER_INDEX              15      // tag 0x131 
    10698#define ARTIST_NAME_INDEX           17      // tag 0x13B 
    10799#define SUBIFDS_INDEX               18      // tag 0x14A 
     
    134126    {0x117,  T_LONG,       1,  DNG_TH_WIDTH*DNG_TH_HEIGHT*3},      // StripByteCounts = preview size 
    135127    {0x11C,  T_SHORT,      1,  1},                                 // PlanarConfiguration: 1 
    136     {0x131,  T_ASCII,      sizeof(cam_chdk_ver), (int)cam_chdk_ver},//Software 
     128    {0x131,  T_ASCII|T_PTR,32, 0},                                 // Software 
    137129    {0x132,  T_ASCII,      20, (int)cam_datetime},                 // DateTime 
    138130    {0x13B,  T_ASCII|T_PTR,64, (int)artist_name},                  // Artist: Filled at header generation. 
     
    173165    {0x102,  T_SHORT|T_PTR,1,  (int)&camera_sensor.bits_per_pixel},// BitsPerSample 
    174166    {0x103,  T_SHORT,      1,  1},                                 // Compression: Uncompressed 
    175     {0x106,  T_SHORT,      1,  0x8023},                            //PhotometricInterpretation: CFA 
    176     {0x111,  T_LONG,       1,  0},                                 //StripOffsets: Offset 
     167    {0x106,  T_SHORT,      1,  0x8023},                            // PhotometricInterpretation: CFA 
     168    {0x111,  T_LONG,       1,  0},                                 // StripOffsets: Offset 
    177169    {0x115,  T_SHORT,      1,  1},                                 // SamplesPerPixel: 1 
    178     {0x116,  T_SHORT|T_PTR,1,  (int)&camera_sensor.raw_rows},      //RowsPerStrip 
     170    {0x116,  T_SHORT|T_PTR,1,  (int)&camera_sensor.raw_rows},      // RowsPerStrip 
    179171    {0x117,  T_LONG|T_PTR, 1,  (int)&camera_sensor.raw_size},      // StripByteCounts = CHDK RAW size 
    180172    {0x11A,  T_RATIONAL,   1,  (int)cam_Resolution},               // XResolution 
     
    306298        ifd0[DNG_VERSION_INDEX].offset = BE(0x01030000); 
    307299        ifd1[BADPIXEL_OPCODE_INDEX].type &= ~T_SKIP; 
     300        // Set CFAPattern value 
     301        switch (camera_sensor.cfa_pattern) 
     302        { 
     303        case 0x02010100: 
     304            badpixel_opcode[BADPIX_CFA_INDEX] = BE(1);              // BayerPhase = 1 (top left pixel is green in a green/red row) 
     305            break; 
     306        case 0x01020001: 
     307            badpixel_opcode[BADPIX_CFA_INDEX] = BE(0);              // BayerPhase = 0 (top left pixel is red) 
     308            break; 
     309        case 0x01000201: 
     310            badpixel_opcode[BADPIX_CFA_INDEX] = BE(3);              // BayerPhase = 3 (top left pixel is blue) 
     311            break; 
     312        case 0x00010102: 
     313            badpixel_opcode[BADPIX_CFA_INDEX] = BE(2);              // BayerPhase = 2 (top left pixel is green in a green/blue row) 
     314            break; 
     315        } 
    308316    } 
    309317 
     
    327335 
    328336    ifd0[CAMERA_NAME_INDEX].count = ifd0[UNIQUE_CAMERA_MODEL_INDEX].count = strlen(cam_name) + 1; 
     337    ifd0[CHDK_VER_INDEX].offset = (int)camera_info.chdk_ver; 
     338    ifd0[CHDK_VER_INDEX].count = strlen(camera_info.chdk_ver) + 1; 
    329339    ifd0[ARTIST_NAME_INDEX].count = strlen(artist_name) + 1; 
    330340    ifd0[COPYRIGHT_INDEX].count = strlen(copyright) + 1; 
     
    724734        for (c[1]=camera_sensor.active_area.y1; c[1]<camera_sensor.active_area.y2; c[1]++) 
    725735        { 
    726             if (get_raw_pixel(c[0],c[1]) <= DNG_BADPIXEL_VALUE_LIMIT) 
     736            if (get_raw_pixel(c[0],c[1]) <= camera_sensor.dng_badpixel_value_limit) 
    727737            { 
    728738                unsigned short l; 
    729739                for (l=0; l<7 && (c[1]+l+1)<camera_sensor.active_area.y2; l++) 
    730                     if (get_raw_pixel(c[0],c[1]+l+1) > DNG_BADPIXEL_VALUE_LIMIT) 
     740                    if (get_raw_pixel(c[0],c[1]+l+1) > camera_sensor.dng_badpixel_value_limit) 
    731741                        break; 
    732742                c[1] = c[1] | (l << 13); 
     
    794804        cnt = (ptr[1] >> 13) & 7; 
    795805        for (; cnt>=0; cnt--, y++) 
    796             if (get_raw_pixel(ptr[0], y) <= DNG_BADPIXEL_VALUE_LIMIT) 
     806            if (get_raw_pixel(ptr[0], y) <= camera_sensor.dng_badpixel_value_limit) 
    797807                patch_bad_pixel(ptr[0], y); 
    798808    } 
     
    977987 
    978988    ANY_CHDK_BRANCH, 0,         // Requirements of CHDK version 
    979     PLATFORMID,                 // Specify platform dependency 
     989    ANY_PLATFORM_ALLOWED,       // Specify platform dependency 
    980990    MODULEINFO_FLAG_SYSTEM,     // flag 
    981991    (int32_t)"DNG (dll)",       // Module name 
  • trunk/core/games/gui_reversi.c

    r1594 r1915  
    1111 
    1212#include "module_load.h" 
     13#include "module_exportlist.h" 
    1314 
    1415void gui_module_menu_kbd_process(); 
  • trunk/core/games/gui_sokoban.c

    r1621 r1915  
    1212 
    1313#include "module_load.h" 
     14#include "module_exportlist.h" 
    1415 
    1516//------------------------------------------------------------------- 
  • trunk/core/games/gui_sudoku.c

    r1865 r1915  
    2222 
    2323#include "module_load.h" 
     24#include "module_exportlist.h" 
    2425 
    2526void gui_module_menu_kbd_process(); 
     
    874875                        draw|=FIELD|MENU; 
    875876                        break; 
    876                 #if CAM_HAS_ERASE_BUTTON 
    877877                case KEY_ERASE: 
    878                 #else 
    879878                case KEY_SHOOT_HALF: 
    880                 #endif 
    881879                        if (mode & (MODE_VIEW | MODE_EDIT)) 
    882880                        { 
  • trunk/core/games/gui_tetris.c

    r1612 r1915  
    1111 
    1212#include "module_load.h" 
     13#include "module_exportlist.h" 
    1314 
    1415void gui_module_menu_kbd_process(); 
  • trunk/core/gui_calendar.c

    r1612 r1915  
    1111 
    1212#include "module_load.h" 
     13#include "module_exportlist.h" 
    1314 
    1415void gui_calendar_menu_kbd_process(); 
  • trunk/core/gui_osd_edit.c

    r1865 r1915  
    1313 
    1414#include "module_load.h" 
     15#include "module_exportlist.h" 
    1516 
    1617//------------------------------------------------------------------- 
     
    202203 
    203204                                                                        ANY_CHDK_BRANCH, 0,                     // Requirements of CHDK version 
    204                                                                         ANY_PLATFORM_ALLOWED,           // Specify platform dependency 
     205                                                                        PLATFORMID,                         // Specify platform dependency (uses CAM_EV_IN_VIDEO to create array) 
    205206                                                                        MODULEINFO_FLAG_SYSTEM,     // flag 
    206207                                                                        (int32_t)"OSD Editor",          // Module name 
  • trunk/core/main.c

    r1866 r1915  
    9494    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 
    9595#endif 
     96    DNG_BADPIXEL_VALUE_LIMIT, 
    9697}; 
    9798 
     
    163164    }, 
    164165    ROMBASEADDR, MAXRAMADDR, 
     166    0, 
     167    HDK_VERSION" ver. "BUILD_NUMBER, 
    165168}; 
    166169 
  • trunk/core/modules/Makefile

    r1874 r1915  
    4141%.flt: %.elf 
    4242        @echo \-\> $@ 
    43 #       arm-elf-objdump.exe -d -r -x $< >$<.dumpobj 
     43#       arm-elf-objdump$(EXE) -d -r -x $< >$<.dumpobj 
    4444#       $(topdir)/tools/elf2flt/elf2flt$(EXE) $< $@ -e -f -h -r -s -iexportlist.txt -!$(topdir)/tools/elf2flt/stoplist.txt >$@.dump 
    4545        $(topdir)/tools/elf2flt/elf2flt$(EXE) $< $@ -iexportlist.txt -!$(topdir)/tools/elf2flt/stoplist.txt > $(DEVNULL) 
  • trunk/core/motion_detector.c

    r1828 r1915  
    3030#include "gui.h" 
    3131#include "gui_draw.h" 
     32#include "module_exportlist.h" 
    3233 
    3334 
  • trunk/include/camera.h

    r1884 r1915  
    286286    int has_forwardmatrix2; 
    287287    int forward_matrix2[18];    // DNG Camera Forward Matrix 1 
     288    int dng_badpixel_value_limit; 
    288289} _cam_sensor; 
    289290 
     
    330331    int rombaseaddr, maxramaddr; 
    331332    int tick_count_offset;      // get_tick_count value at which the clock ticks over 1 second 
     333    char* chdk_ver; 
    332334} _cam_info; 
    333335 
  • trunk/include/conf.h

    r1874 r1915  
    3939// If add field to the end of structure minor api version should be increased. 
    4040// If any other change (remove something, change order, add not to the end, change meaning), major api version should be increased 
     41// Don't make any of the entries conditionally compiled in - this will change the offsets between cameras causing problems with 
     42// making the modules camera/platform independant 
    4143typedef struct { 
    4244        int api_version;                        // version of this structure 
     
    297299    int edge_overlay_filter; 
    298300    int edge_overlay_thresh; 
    299     int edge_overlay_zoom;    // shall zoom be set when *edg file is loaded? 
    300     int edge_overlay_pano;    // whether a full press changes back to live mode 
    301     int edge_overlay_pano_overlap;    // overlap in % in pano mode 
    302     int edge_overlay_show;    // whether to show overlay even when no button is pressed 
    303     int edge_overlay_play;    // whether edge overlay is switched on also for play mode 
     301    int edge_overlay_zoom;              // shall zoom be set when *edg file is loaded? 
     302    int edge_overlay_pano;              // whether a full press changes back to live mode 
     303    int edge_overlay_pano_overlap;      // overlap in % in pano mode 
     304    int edge_overlay_show;              // whether to show overlay even when no button is pressed 
     305    int edge_overlay_play;              // whether edge overlay is switched on also for play mode 
    304306    color edge_overlay_color; 
    305307 
     
    308310    int synch_delay_enable; 
    309311    int synch_delay_value; 
    310     int synch_delay_coarse_value;               // obsolete - no longer used 
     312    //int synch_delay_coarse_value;     // obsolete - no longer used 
    311313    int remote_zoom_enable; 
    312     int zoom_timeout; 
     314    //int zoom_timeout;                 // obsolete - no longer used 
    313315 
    314316    int script_param_set; 
     
    336338    int remote_enable_scripts;  // usb remote activates scripts in <ALT> mode 
    337339     
    338 #if defined(CAM_ZOOM_ASSIST_BUTTON_CONTROL) 
    339340    int zoom_assist_button_disable;    // used to disable the zoom assist button on SX30 & SX40 for people who keep accidentaly pressing it 
    340 #endif 
    341  
    342 #ifdef CAM_HAS_GPS 
     341 
    343342    int gps_record; 
    344343    int gps_navi_show; 
     
    374373    int gps_beep_warn; 
    375374    int gps_on_off; 
    376 #endif 
    377375 
    378376    int tbox_char_map;      // Text input box language/char map 
Note: See TracChangeset for help on using the changeset viewer.