root/include/camera.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 // camera.h
   2 
   3 #ifdef CHDK_MODULE_CODE
   4 #error camera.h cannot be #included in module code (did you mean camera_info.h).
   5 #endif
   6 
   7 // This file contains the default values for various settings that may change across camera models.
   8 // Setting values specific to each camera model can be found in the platform/XXX/platform_camera.h file for camera.
   9 
  10 // If adding a new settings value put a suitable default value in here, along with documentation on
  11 // what the setting does and how to determine the correct value.
  12 // If the setting should not have a default value then add it here using the '#undef' directive
  13 // along with appropriate documentation.
  14 
  15 #ifndef CAMERA_H
  16 #define CAMERA_H
  17 
  18 //==========================================================
  19 // Camera-dependent settings
  20 //==========================================================
  21 
  22 //----------------------------------------------------------
  23 // Default values
  24 //----------------------------------------------------------
  25 
  26     #undef  CAM_DRYOS                           // Camera is DryOS-based
  27     #undef  CAM_PROPSET                         // Camera's properties group (the generation)
  28     #define CAM_FLASHPARAMS_VERSION         3   // flash parameters structure version (every camera from 2005 on is version 3)
  29     #undef  CAM_DRYOS_2_3_R39                   // Define for cameras with DryOS release R39 or greater
  30     #undef  CAM_DRYOS_2_3_R47                   // Define for cameras with DryOS release R47 or greater -> Cameras can boot from FAT32
  31     #undef  CAM_DRYOS_2_3_R59                   // Define for cameras with DryOS release R59 or greater -> some support for 64bit files
  32 
  33     #define CAM_CIRCLE_OF_CONFUSION         5   // CoC value for camera/sensor (see http://www.dofmaster.com/digital_coc.html)
  34 
  35     #undef  CAM_HAS_CMOS                        // Camera has CMOS sensor
  36     #undef  CAM_SWIVEL_SCREEN                   // Camera has rotated LCD screen
  37     #define CAM_USE_ZOOM_FOR_MF             1   // Zoom lever can be used for manual focus adjustments
  38     #define CAM_DEFAULT_ALT_BUTTON  KEY_PRINT   // alt button for cameras without adjustable alt
  39                                                 // redefine if not print to avoid need for KEY_PRINT alias in keymap
  40     #undef  CAM_ADJUSTABLE_ALT_BUTTON           // ALT-button can be set from menu, must set next two values as well
  41     #undef  CAM_ALT_BUTTON_NAMES                // Define the list of names for the ALT button   - e.g. { "Print", "Display" }
  42     #undef  CAM_ALT_BUTTON_OPTIONS              // Define the list of options for the ALT button - e.g. { KEY_PRINT, KEY_DISPLAY }
  43     #define CAM_REMOTE                      1   // Camera supports a remote
  44     #undef  CAM_REMOTE_AtoD_CHANNEL             // Camera supports using 3rd battery terminal as well as USB for remote - value = A/D channel to poll (normally 5)
  45     #define CAM_REMOTE_AtoD_THRESHOLD       200 // 3rd battery terminal A/D reading threshold ( lower = 1, higher = 0 )
  46     #undef  CAM_REMOTE_HDMI_HPD                 // Camera supports using HDMI hotplug detect for remote signal
  47     #undef  CAM_REMOTE_HDMI_POWER_OVERRIDE      // Camera requires HDMI power to be forced on in rec mode
  48     #undef  CAM_REMOTE_ANALOG_AV                // Camera supports analog AV detect for remote signal
  49     #undef  CAM_REMOTE_USES_PRECISION_SYNC      // Disable experimental remote  precision sync patch
  50     #define CAM_ALLOWS_USB_PORT_FORCING     1   // USB remote state can be forced to be present (supported on all cameras that use common kbd code, others may undef)
  51     #define CAM_REMOTE_USB_HIGHSPEED        1   // Enable highspeed measurements of pulse width & counts on USB port 
  52     #define CAM_REMOTE_HIGHSPEED_LIMIT 1000     // Set lowest timer value settable by user
  53     #undef  GPIO_VSYNC_CURRENT                  // USB remote precision sync : might be 0xC0F070C8 or 0xC0F07008 (http://chdk.setepontos.com/index.php?topic=8312.msg104027#msg104027)
  54     #undef  CAM_MULTIPART                       // Camera supports SD-card multipartitioning
  55     #define CAM_HAS_ZOOM_LEVER              1   // Camera has dedicated zoom buttons
  56     #undef  CAM_DRAW_EXPOSITION                 // Output expo-pair on screen (for cameras which (sometimes) don't do that)
  57     #define CAM_HAS_ERASE_BUTTON            1   // Camera has dedicated erase button
  58     #define CAM_HAS_DISP_BUTTON             1   // Camera has dedicated DISP button
  59     #define CAM_HAS_IRIS_DIAPHRAGM          1   // Camera has real diaphragm mechanism (http://en.wikipedia.org/wiki/Diaphragm_%28optics%29)
  60     #undef  CAM_HAS_ND_FILTER                   // Camera has build-in ND filter
  61     #undef  CAM_HAS_NATIVE_ND_FILTER            // Camera has built-in ND filter with Canon menu support for enable/disable
  62     #undef  CAM_ND_SET_AV_VALUE                 // Camera needs AV propcase set to override ND. Only valid for cameras without iris. 1 if needed, undef if not
  63 
  64     #define CAM_HAS_MANUAL_FOCUS            1   // Camera has native manual focus mode (disables MF shortcut feature)
  65     #undef  CAM_SD_OVER_IN_AF                   // Camera allows SD override if MF & AFL not set
  66     #undef  CAM_SD_OVER_IN_AFL                  // Camera allows SD override when AFL is set
  67     #undef  CAM_SD_OVER_IN_MF                   // Camera allows SD override when MF is set
  68 
  69     #define CAM_HAS_USER_TV_MODES           1   // Camera has tv-priority or manual modes with ability to set tv value
  70     #undef  CAM_SHOW_OSD_IN_SHOOT_MENU          // On some cameras Canon shoot menu has additional functionality and useful in this case to see CHDK OSD in this mode
  71     #define CAM_CAN_UNLOCK_OPTICAL_ZOOM_IN_VIDEO 1 // Camera can unlock optical zoom in video (if it is locked)
  72     #undef  CAM_FEATURE_FEATHER                 // Cameras with "feather" or touch wheel.
  73     #define CAM_HAS_IS                      1   // Camera has image stabilizer
  74     #undef  CAM_HAS_JOGDIAL                     // Camera has a "jog dial"
  75 
  76     #undef  CAM_CONSOLE_LOG_ENABLED             // Development: internal camera stdout -> A/stdout.txt
  77     #define CAM_CHDK_HAS_EXT_VIDEO_MENU     1   // In CHDK for this camera realized adjustable video compression
  78     #undef  CAM_CAN_MUTE_MICROPHONE             // Camera has function to mute microphone
  79 
  80     #define CAM_EMUL_KEYPRESS_DELAY         40  // Delay to interpret <alt>-button press as longpress
  81     #define CAM_EMUL_KEYPRESS_DURATION      5   // Length of keypress emulation
  82 
  83     #define CAM_MENU_BORDERWIDTH            10  // Defines the width of the border on each side of the CHDK menu. The CHDK menu will have this
  84                                                 // many pixels left blank to the on each side. Should not be less than 10 to allow room for the
  85                                                 // scroll bar on the right.
  86 
  87     #undef  CAM_TOUCHSCREEN_UI                  // Define to enable touch screen U/I (e.g. IXUS 310 HS)
  88     #define CAM_TS_BUTTON_BORDER            0   // Define this to leave a border on each side of the OSD display for touch screen buttons.
  89                                                 // Used on the IXUS 310 to stop the OSD from overlapping the on screen buttons on each side
  90     #define CAM_TS_MENU_BORDER              0   // Define this to leave a border at top and bottom of menu to avoid areas where touch sensor does not work
  91                                                 // Used on the IXUS 310 to allow touch selection of menu entries
  92     #define CAM_DISP_ALT_TEXT               1   // Display the '<ALT>' message at the bottom of the screen in ALT mode (IXUS 310 changes button color instead)
  93 
  94     #undef  CAM_AF_SCAN_DURING_VIDEO_RECORD     // CHDK can make single AF scan during video record
  95     #undef  CAM_RESET_AEL_AFTER_VIDEO_AF        // Cam needs AE Lock state reset after AF in video recording
  96     #undef  CAM_HAS_VIDEO_BUTTON                // Camera can take stills in video mode, and vice versa
  97     #define CAM_MASK_VID_REC_ACTIVE    0x0400   // mask so that Canon mode does not change when cam's with video button enter video recording mode
  98     #undef  CAM_EV_IN_VIDEO                     // CHDK can change exposure in video mode
  99     #define CAM_VIDEO_CONTROL               1   // pause / unpause video recordings
 100     #undef  CAM_VIDEO_QUALITY_ONLY              // Override Video Bitrate is not supported
 101     #undef  CAM_CHDK_HAS_EXT_VIDEO_TIME         // Camera can override time limit of video record -> sx220/230
 102     #undef  CAM_SIMPLE_MOVIE_STATUS             // Firmware movie_status nonzero when recording, zero when not - makes CAM_VIDEO_CONTROL ineffective
 103     #undef  CAM_MOVIEREC_NEWSTYLE               // Define for new style video recording code in fw (DIGIC 6)
 104     #undef  CAM_HAS_MOVIE_DIGEST_MODE           // The values in the 'movie_status' variable change if the camera has this mode (see is_video_recording())
 105     #undef  CAM_HAS_SPORTS_MODE                 // Define to enable the RAW exception override control for SPORTS mode (s3is, sx30, sx40, etc)
 106 
 107     #undef  CAM_REAR_CURTAIN                    // Camera do not have front/rear curtain flash sync in menu
 108     #undef  CAM_BRACKETING                      // Cameras that have bracketing (focus & ev) in original firmware already, most likely s- & g-series (propcase for digic III not found yet!)
 109     #define CAM_EXT_TV_RANGE                1   // CHDK can make exposure time longer than 64s
 110     #define CAM_EXT_AV_RANGE                6   // Number of 1/3 stop increments to extend the Av range beyond the Canon default smallest aperture
 111                                                 //  override in platform_camera.h for cameras with different range (e.g. G1X can't go below F/16 so set this to 0)
 112     #define CAM_CHDK_PTP                    1   // include CHDK PTP support
 113 
 114     #undef  CAM_HAS_FILEWRITETASK_HOOK          // FileWriteTask hook is available (local file write can be prevented)
 115     #undef  CAM_FILEWRITETASK_SEEKS             // Camera's FileWriteTask can do Lseek() - DryOS r50 or higher, implicitly enables CAM_FILEWRITETASK_MULTIPASS when defined
 116     #undef  CAM_FILEWRITETASK_MULTIPASS         // Camera may use multiple FileWriteTask invocations to write larger JPEGs (approx. DryOS r39..49)
 117 
 118     #define CAM_UNCACHED_BIT                0x10000000 // bit indicating the uncached memory
 119 
 120     #define CAM_SENSOR_BITS_PER_PIXEL       10  // Bits per pixel. 10 is standard, 12 is supported except for curves
 121     #define CAM_WHITE_LEVEL                 ((1<<CAM_SENSOR_BITS_PER_PIXEL)-1)      // 10bpp = 1023 ((1<<10)-1), 12bpp = 4095 ((1<<12)-1)
 122     #define CAM_BLACK_LEVEL                 ((1<<(CAM_SENSOR_BITS_PER_PIXEL-5))-1)  // 10bpp = 31 ((1<<5)-1),    12bpp = 127 ((1<<7)-1)
 123 
 124     #define CAM_DEFAULT_MENU_CURSOR_BG      IDX_COLOR_BLUE      // Default menu cursor colors
 125     #define CAM_DEFAULT_MENU_CURSOR_FG      IDX_COLOR_YELLOW    // Default menu cursor colors
 126 
 127     // Older cameras had a screen/bitmap buffer that was 360 pixels wide (or 480 for wide screen models)
 128     // CHDK was built around this 360 pixel wide display model
 129     // Newer cameras have a 720 pixel wide bitmap (960 for wide screen cameras)
 130     // To accomadate this the CHDK co-ordinate system assumes a 360/480 wide buffer and the
 131     // pixel drawing routines draw every pixel twice to scale the image up to the actual buffer size
 132     // Define CAM_USES_ASPECT_CORRECTION with a value of 1 to enable this scaled display
 133     #define CAM_USES_ASPECT_CORRECTION      0
 134     #define CAM_SCREEN_WIDTH                360 // Width of bitmap screen in CHDK co-ordinates (360 or 480)
 135     #define CAM_SCREEN_HEIGHT               240 // Height of bitmap screen in CHDK co-ordinates (always 240 on all cameras so far)
 136     #define CAM_BITMAP_WIDTH                360 // Actual width of bitmap screen in bytes (may be larger than displayed area)
 137     #define CAM_BITMAP_HEIGHT               240 // Actual height of bitmap screen in rows (240 or 270)
 138 
 139     #define EDGE_HMARGIN                    0   // define sup and inf screen margins on edge overlay without overlay.  Necessary to save memory buffer space. sx200is needs values other than 0
 140 
 141     #undef CAM_QUALITY_OVERRIDE                 // define this in platform_camera.h to enable 'Super Fine' JPEG compression mode
 142                                                 // used to allow super fine JPEG option on cameras where this has been removed
 143                                                 // from the Canon menu. Note: may not actually work on all cameras.
 144 
 145     #undef  CAM_ZEBRA_NOBUF                     // zebra draws directly on bitmap buffer.
 146     #undef  CAM_HAS_VARIABLE_ASPECT             // can switch between 16:9 and 4:3 (used by zebra code)
 147     
 148     #undef  CAM_DATE_FOLDER_NAMING              // set if camera uses date based folder naming (Option "Create Folder" in Canon Menu) and get_target_dir_name is implemented
 149     
 150     #define CAM_KEY_PRESS_DELAY             30  // delay after a press - TODO can we combine this with above ?
 151     #define CAM_KEY_RELEASE_DELAY           30  // delay after a release - TODO do we really need to wait after release ?
 152     
 153     // RAW & DNG related values
 154     #define DEFAULT_RAW_EXT                 1   // extension to use for raw (see raw_exts in conf.c)
 155     #define DNG_BADPIXEL_VALUE_LIMIT        0   // Max value of 'bad' pixel - this value or lower is considered a defective pixel on the sensor
 156     #undef  CAM_RAW_ROWPIX                      // Number of pixels in RAW row (physical size of the sensor Note : as of July 2011, this value can be found in stub_entry.S for dryos cameras)
 157     #undef  CAM_RAW_ROWS                        // Number of rows in RAW (physical size of the sensor       Note : as of July 2011, this value can be found in stub_entry.S for dryos cameras)
 158     #undef  CAM_JPEG_WIDTH                      // Default crop size (width) stored in DNG (to match camera JPEG size. From dimensions of the largest size jpeg your camera produces)
 159     #undef  CAM_JPEG_HEIGHT                     // Default crop size (height) stored in DNG (to match camera JPEG size. From dimensions of the largest size jpeg your camera produces)
 160     #undef  CAM_ACTIVE_AREA_X1                  // Define usable area of the sensor - needs to be divisible by 4 - calibrate using a CHDK RAW image converted with rawconvert.exe (eg :rawconvert -12to8 -pgm -w=4480 -h=3348 photo.crw photo.pgm)
 161     #undef  CAM_ACTIVE_AREA_Y1                  // Define usable area of the sensor - needs to be divisible by 2 - "
 162     #undef  CAM_ACTIVE_AREA_X2                  // Define usable area of the sensor - needs to be divisible by 4 - "
 163     #undef  CAM_ACTIVE_AREA_Y2                  // Define usable area of the sensor - needs to be divisible by 2 = "
 164     #undef  cam_CFAPattern                      // Camera Bayer sensor data layout (DNG colors are messed up if not correct)
 165                                                 //   should be 0x01000201 = [Green Blue Red Green], 0x02010100 = [Red Green Green Blue] or 0x01020001 = [Green Red Blue Green]
 166     #undef  CAM_COLORMATRIX1                    // DNG color profile matrix
 167     #undef  cam_CalibrationIlluminant1          // DNG color profile illuminant - set it to 17 for standard light A
 168     #undef  CAM_COLORMATRIX2                    // DNG color profile matrix 2
 169     #undef  cam_CalibrationIlluminant2          // DNG color profile illuminant 2 - set it to 21 for D65
 170     #undef  CAM_CAMERACALIBRATION1              // DNG camera calibration matrix 1
 171     #undef  CAM_CAMERACALIBRATION2              // DNG camera calibration matrix 2
 172     #undef  CAM_FORWARDMATRIX1                  // DNG camera forward matrix 1
 173     #undef  CAM_FORWARDMATRIX2                  // DNG camera forward matrix 2
 174     #undef  CAM_DNG_EXPOSURE_BIAS               // Specify DNG exposure bias value (to override default of -0.5 in the dng.c code)
 175     #undef  CAM_CALC_BLACK_LEVEL                // Set this to enable dynamic Black Level calculation from RAW sensor data
 176                                                 // E.G. G1X may use black = 2048 for long exposures at high ISO
 177                                                 // TODO: Raw Merge code does not use this - merging files with different black points may give strange results
 178     #undef  DNG_EXT_FROM                        // Extension in the cameras known extensions to replace with .DNG to allow DNG
 179                                                 // files to be transfered over standard PTP. Only applicable to older cameras
 180 
 181     #undef  CAM_DNG_LENS_INFO                   // Define this to include camera lens information in DNG files
 182                                                 // Value should be an array of 4 DNG 'RATIONAL' values specifying
 183                                                 //   - min focal length in mm
 184                                                 //   - max focal length in mm
 185                                                 //   - max aperture at min focal length
 186                                                 //   - max aperture at max focal length
 187                                                 // E.G - SX30 = { 43,10, 1505,10, 27,10, 58,10 }
 188                                                 //            = 4.3 - 150.5mm, f/2.7 - f.5.8
 189                                                 // Each pair of integers is one 'RATIONAL' value (numerator,denominator)
 190 
 191     #undef  PARAM_CAMERA_NAME                   // parameter number for GetParameterData to get camera name
 192     #undef  PARAM_OWNER_NAME                    // parameter number for GetParameterData to get owner name
 193     #undef  PARAM_ARTIST_NAME                   // parameter number for GetParameterData to get artist name
 194     #undef  PARAM_COPYRIGHT                     // parameter number for GetParameterData to get copyright
 195     #undef  PARAM_DISPLAY_MODE1                 // param number for LCD display mode when camera in playback
 196     #undef  PARAM_DISPLAY_MODE2                 // param number for LCD display mode when camera in record view hold mode
 197     #define PARAMETER_DATA_FLAG     0x4000      // Added to 'id' value in calls to _GetParameterData & _SetParameterData
 198                                                 // Override if not needed or different value needed
 199 
 200     #undef  CAM_NO_MEMPARTINFO                  // VXWORKS camera does not have memPartInfoGet, fall back to memPartFindMax
 201 
 202     #undef  CAM_DRIVE_MODE_FROM_TIMER_MODE      // use PROPCASE_TIMER_MODE to check for multiple shot custom timer.
 203                                                 // Used to enabled bracketing in custom timer, required on many recent cameras
 204                                                 // see http://chdk.setepontos.com/index.php/topic,3994.405.html
 205 
 206     #undef  CAM_AV_OVERRIDE_IRIS_FIX            // for cameras that require _MoveIrisWithAv function to override Av (for bracketing).
 207 
 208     #undef  CAM_DISABLE_RAW_IN_LOW_LIGHT_MODE   // For cameras with 'low light' mode that does not work with raw define this
 209     #undef  CAM_DISABLE_RAW_IN_ISO_3200         // For cameras that don't have valid raw in ISO3200 mode (different from low light)
 210     #undef  CAM_DISABLE_RAW_IN_AUTO             // For cameras that don't have valid raw in AUTO mode
 211     #undef  CAM_DISABLE_RAW_IN_HQ_BURST         // For cameras with 'HQ Burst' mode that does not work with raw define this
 212     #undef  CAM_DISABLE_RAW_IN_HANDHELD_NIGHT_SCN // For cameras with 'HandHeld Night Scene' mode that does not work with raw define this
 213     #undef  CAM_DISABLE_RAW_IN_HYBRID_AUTO      // For cameras that lock up while saving raw in "Hybrid Auto" mode
 214     #undef  CAM_DISABLE_RAW_IN_MOVIE_DIGEST     // For cameras that lock up while saving raw in "Movie Digest" mode
 215     #undef  CAM_DISABLE_RAW_IN_DIGITAL_IS       // For cameras with 'Digital IS' mode that does not work with raw define this    
 216     #undef  CAM_DISABLE_RAW_IN_SPORTS           // For cameras that corrupt DNG/JPEG in Sports mode
 217     #undef  CAM_DISABLE_RAW_IN_HDR              // For cameras with multi-exposure HDR mode
 218     #undef  CAM_ISO_LIMIT_IN_HQ_BURST           // Defines max 'market' ISO override value for HQ Burst mode (higher values crash camera)
 219     #undef  CAM_MAX_ISO_OVERRIDE                // Defines max 'market' (non-zero) ISO override value - higher value may crash
 220     #undef  CAM_MIN_ISO_OVERRIDE                // Defines min 'market' (non-zero) ISO override value - lower value may crash if flash used [0 = AUTO, so always allowed]
 221     
 222     #undef  CAM_HAS_GPS                         // for cameras with GPS reseiver: includes the GPS coordinates in in DNG file
 223 
 224     #undef  CHDK_COLOR_BASE                     // Start color index for CHDK colors loaded into camera palette.
 225 
 226     #undef  CAM_LOAD_CUSTOM_COLORS              // Define to enable loading CHDK custom colors into the camera color palette
 227                                                 // requires load_chdk_palette() and vid_get_bitmap_active_palette() to be defined
 228                                                 // correctly for the camera along with
 229 
 230     #undef  CAM_CLEAN_OVERLAY                   // define when port supports making Canon overlay invisible (DIGIC 6)
 231 
 232     #define CAM_USB_EVENTID         0x902       // event ID for USB control. Changed to 0x202 in DryOS R49 so needs to be overridable.
 233                                                 // For DryOS only. These are "control events", and don't have the same IDs as "logical events"
 234 
 235     #undef CAM_USB_EVENTID_VXWORKS              // For vxworks cameras that need additional code to unlock mode switching
 236                                                 // this is the logical event "ConnectUSBCable", usually 0x1085
 237                                                 // different from CAM_USB_EVENTID since it should be undefined on most cameras
 238 
 239     #undef  CAM_NEED_SET_ZOOM_DELAY             // Define to add a delay after setting the zoom position before resetting the focus position in shooting_set_zoom 
 240 
 241     #undef  CAM_USE_ALT_SET_ZOOM_POINT          // Define to use the alternate code in lens_set_zoom_point()
 242     #undef  CAM_USE_ALT_PT_MoveOpticalZoomAt    // Define to use the PT_MoveOpticalZoomAt() function in lens_set_zoom_point()
 243     #undef  CAM_USE_OPTICAL_MAX_ZOOM_STATUS     // Use ZOOM_OPTICAL_MAX to reset zoom_status when switching from digital to optical zoom in gui_std_kbd_process()
 244 
 245     #undef  CAM_HAS_HI_ISO_AUTO_MODE            // Define if camera has 'HI ISO Auto' mode (as well as Auto ISO mode), needed for adjustment in user auto ISO menu 
 246 
 247     #define CAMERA_MIN_DIST         0           // Define min distance that can be set in _MoveFocusLensToDistance (allow override - e.g. G12 min dist = 1)
 248     #undef  CAMERA_MAX_DIST                     // Define max distance that can be set in _MoveFocusLensToDistance (allow override for superzooms - SX30/SX40, default defined below depending on OS)
 249 
 250     #undef  DRAW_ON_ACTIVE_BITMAP_BUFFER_ONLY   // Draw pixels on active bitmap buffer only.
 251                                                 // Requires bitmap_buffer & active_bitmap_buffer location in stubs_min.S or stubs_entry.S.
 252 
 253     #undef  CAM_SUPPORT_BITMAP_RES_CHANGE       // port can adapt to resolution change of the bitmap buffer (when composite or hdmi output is used)
 254 
 255     #undef  CAM_DETECT_BITMAP_UPDATE            // camera can detect if CHDK UI needs to be redrawn
 256 
 257     #undef  CAM_ZOOM_ASSIST_BUTTON_CONTROL      // Activate menu option to enable/disable the zoom assist button on the SX30/SX40
 258                                                 // For other cameras, requires additional support code in kbd.c (see the SX30 or SX40 version)
 259 
 260     #undef  CAM_MISSING_RAND                    // Define this if srand()/rand() functions not found in firmware (a810/a2300)
 261     #undef  MKDIR_RETURN_ONE_ON_SUCCESS         // Define this if mkdir() return 1 on success, 0 on fail (a810/a1300)
 262 
 263     #undef  CAM_OPTIONAL_EXTRA_BUTTON           // extra button (remapped, for use in ALT mode) can be set from menu, must set next two values as well
 264     #undef  CAM_EXTRA_BUTTON_NAMES              // Define the list of names for the extra button   - e.g. { "Off", "Display" }
 265     #undef  CAM_EXTRA_BUTTON_OPTIONS            // Define the list of button constants for the extra button, starting with 0 - e.g. { 0, KEY_DISPLAY }
 266 
 267     #undef  CAM_HOTSHOE_OVERRIDE                // the sense switch of the hot shoe can be overridden
 268 
 269     #define CAM_AF_LED                      -1  // ***** NOTE ***** Need to override this in platform_camera.h with correct value
 270                                                 // Defines 'led' Index value for camera_set_led function to control the AutoFocus assist LED
 271                                                 // Used for the Motion Detect & Live View buffer testing
 272 
 273     #undef CAM_FILE_COUNTER_IS_VAR              // file counter is variable file_counter_var in stubs, not a param
 274     
 275     #define CAM_GUI_FSELECT_SIZE  20, 6, 14     // filename, filesize, filedate camera file select window column widths
 276 
 277     #undef  CAM_IS_VID_REC_WORKS                // Define if the 'is_video_recording()' function works
 278 
 279     #undef  CAM_HAS_CANON_RAW                   // Define if the camera has native raw in the canon firmware
 280 
 281     // Keyboard repeat and initial delays (override in platform_camera.h if needed)
 282     #define KBD_REPEAT_DELAY                175
 283     #define KBD_INITIAL_DELAY               500
 284     #undef CAM_PTP_USE_NATIVE_BUFFER            // define to use native firmware buffers for PTP transfers
 285                                                 // for cameras that have problems transfering to cached RAM
 286                                                 // or specific alignment requirements
 287 
 288     #undef CAM_PTP_FILE_BUFFER_ID               // define to override default ID for file transfer buffer
 289 
 290 
 291 // Base 'market' ISO value. Most (all?) DryOS R49 and later use 200, use tests/isobase.lua to check
 292 #if defined(CAM_DRYOS_REL) && CAM_DRYOS_REL >= 49 // CAM_DRYOS_REL defined on command line, not from platform_camera.h
 293     #define CAM_MARKET_ISO_BASE             200
 294 #else
 295     #define CAM_MARKET_ISO_BASE             100
 296 #endif
 297 
 298     // Below limits are for the CHDK LFN support routines (DryOS only)
 299     // defaults can be overridden in camera_platform.h
 300     // file name limits used here based on what the OS functions can create/write without errors
 301     // in many cases, firmware can list, open and read longer paths
 302 #if defined(CAM_DRYOS_REL) // CAM_DRYOS_REL defined on command line, not from platform_camera.h
 303     // #if CAM_DRYOS_REL == 20 // unknown
 304     #if CAM_DRYOS_REL == 23
 305         #define CAM_MAX_FNAME_LENGTH        18 
 306         #define CAM_MAX_PATH_LENGTH         255
 307     #elif CAM_DRYOS_REL == 31
 308         #define CAM_MAX_FNAME_LENGTH        18 
 309         #define CAM_MAX_PATH_LENGTH         59
 310     #elif CAM_DRYOS_REL == 39
 311         #define CAM_MAX_FNAME_LENGTH        30 
 312         #define CAM_MAX_PATH_LENGTH         32
 313 //    #elif CAM_DRYOS_REL == 43 // unknown
 314     #elif CAM_DRYOS_REL == 45
 315         #define CAM_MAX_FNAME_LENGTH        57 
 316         #define CAM_MAX_PATH_LENGTH         59
 317     #elif CAM_DRYOS_REL == 47
 318         #define CAM_MAX_FNAME_LENGTH        31 // note sx220hs seems to allow longer
 319         #define CAM_MAX_PATH_LENGTH         59
 320     #else // >= r49, and those unknown above
 321         #define CAM_MAX_FNAME_LENGTH        99 // camera can safely use filenames not longer than this (99 is a CHDK limit actually)
 322         #define CAM_MAX_PATH_LENGTH         255 // maximum path+filename length. Some actually allow much longer
 323     #endif 
 324 #endif
 325 
 326 //----------------------------------------------------------
 327 // Overridden values for each camera
 328 //----------------------------------------------------------
 329 
 330 // Include the settings file for the camera model currently being compiled.
 331 #include "platform_camera.h"
 332 
 333 // DryOS r31 and later cameras use 32bit subject distance values
 334 // set a default limit that's high enough
 335 // earlier cameras need 65535 as default
 336 #if defined(CAM_DRYOS) && CAM_DRYOS_REL >= 31
 337     #ifndef CAMERA_MAX_DIST
 338         #define CAMERA_MAX_DIST 2000000
 339     #endif
 340 #else
 341     #ifndef CAMERA_MAX_DIST
 342         #define CAMERA_MAX_DIST 65535
 343     #endif
 344 #endif
 345 
 346 #if !defined(CAM_IS_VID_REC_WORKS)
 347 #if !defined(CAM_FILEIO_SEM_TIMEOUT)
 348     #define CAM_FILEIO_SEM_TIMEOUT          3000    // TakeSemaphore timeout
 349 #endif
 350 #else
 351 #if !defined(CAM_FILEIO_SEM_TIMEOUT)
 352     #define CAM_FILEIO_SEM_TIMEOUT          0       // TakeSemaphore timeout - is_video_recording() == false
 353 #endif
 354 #if !defined(CAM_FILEIO_SEM_TIMEOUT_VID)
 355     #define CAM_FILEIO_SEM_TIMEOUT_VID      200     // TakeSemaphore timeout - is_video_recording() == true
 356 #endif
 357 #endif
 358 
 359 #if defined(CAM_VIDEO_CONTROL) && defined(CAM_SIMPLE_MOVIE_STATUS)
 360     #error "CAM_VIDEO_CONTROL and CAM_SIMPLE_MOVIE_STATUS are mutually exclusive"
 361 #endif
 362 
 363 // video quality/bitrate defaults, moved here from conf.h
 364 #ifdef CAM_MOVIEREC_NEWSTYLE
 365     // video defaults.for D6
 366     #define VIDEO_DEFAULT_QUALITY   9   // VBR relative min bitrate, 9 = CBR
 367     #define VIDEO_MAX_QUALITY       9   // 0..9
 368     #define VIDEO_DEFAULT_BITRATE   3   // 3 = fw default
 369 
 370     #undef  CAM_VIDEO_QUALITY_ONLY
 371 #else
 372     // video quality defaults. Ideally, these should match the camera default settings
 373     #define VIDEO_DEFAULT_QUALITY   84  // ? where does 84 come from
 374     #define VIDEO_MAX_QUALITY       99
 375     #define VIDEO_DEFAULT_BITRATE   3   // should be 1 for all cams
 376 #endif
 377 
 378 // sanity check platform_camera.h defined values for some common errors
 379 #if (CAM_ACTIVE_AREA_X1&1) || (CAM_ACTIVE_AREA_Y1&1) || (CAM_ACTIVE_AREA_X2&1) || (CAM_ACTIVE_AREA_Y2&1)
 380     #error "CAM_ACTIVE_AREA values must be even"
 381 #endif
 382 
 383 #if (CAM_ACTIVE_AREA_X2 - CAM_ACTIVE_AREA_X1) < CAM_JPEG_WIDTH
 384     #error "CAM_JPEG_WIDTH larger than active area"
 385 #endif
 386 
 387 #if (CAM_ACTIVE_AREA_Y2 - CAM_ACTIVE_AREA_Y1) < CAM_JPEG_HEIGHT
 388     #error "CAM_JPEG_HEIGHT larger than active area"
 389 #endif
 390 
 391 // default PTP buffer id
 392 #ifndef CAM_PTP_FILE_BUFFER_ID
 393 #if defined(CAM_DRYOS) && CAM_DRYOS_REL >= 43 && CAM_DRYOS_REL <= 52
 394     #define CAM_PTP_FILE_BUFFER_ID 5
 395 #else
 396     #define CAM_PTP_FILE_BUFFER_ID 4
 397 #endif
 398 #endif // ifndef CAM_PTP_FILE_BUFFER_ID
 399 
 400 //==========================================================
 401 // END of Camera-dependent settings
 402 //==========================================================
 403 
 404 // For newer cameras where the screen bitmap is double the width we need to scale
 405 // the CHDK horizontal (X) co-ordinates
 406 #if CAM_USES_ASPECT_CORRECTION
 407     #define ASPECT_XCORRECTION(x)   ((x)<<1)    // See comments for CAM_USES_ASPECT_CORRECTION above
 408 #else
 409     #define ASPECT_XCORRECTION(x)   (x)         // See comments for CAM_USES_ASPECT_CORRECTION above
 410 #endif
 411 
 412 // curves only work in 10bpp for now
 413 #if CAM_SENSOR_BITS_PER_PIXEL != 10
 414     #undef OPT_CURVES
 415 #endif
 416 
 417 #ifndef OPT_PTP
 418     #undef CAM_CHDK_PTP
 419 #endif
 420 
 421 #ifdef CAM_FILEWRITETASK_SEEKS
 422     #define CAM_FILEWRITETASK_MULTIPASS 1
 423 #endif
 424 
 425 // Define default video AF scan buttons if not already defined in platform_camera.h
 426 #if CAM_AF_SCAN_DURING_VIDEO_RECORD
 427     #ifndef CAM_VIDEO_AF_BUTTON_NAMES
 428         #define CAM_VIDEO_AF_BUTTON_NAMES   { "", "Shutter", "Set" }
 429         #define CAM_VIDEO_AF_BUTTON_OPTIONS { 0, KEY_SHOOT_HALF, KEY_SET }
 430     #endif
 431 #endif
 432 
 433 // Define default value for DISP button name in shortcut text unless aready set in platform_camera.h
 434 // e.g. G1X uses Meter button as DISP in CHDK
 435 #ifndef CAM_DISP_BUTTON_NAME
 436     #define CAM_DISP_BUTTON_NAME            "DISP"
 437 #endif
 438 
 439 // used for conditional LANG strings and convenience - defined if any non-USB remote input supported
 440 #if (defined(CAM_REMOTE_AtoD_CHANNEL) || defined(CAM_REMOTE_HDMI_HPD) || defined(CAM_REMOTE_ANALOG_AV))
 441 #define CAM_REMOTE_MULTICHANNEL 1
 442 #endif
 443 //------------------------------------------------------------------- 
 444 // Keyboard / Button shortcuts - define in platform_camera.h
 445 // if the default values are not suitable
 446 // Default values are set below if not overridden
 447 //------------------------------------------------------------------
 448 
 449 // For models without ZOOM_LEVER  (#if !CAM_HAS_ZOOM_LEVER)
 450 // SHORTCUT_SET_INFINITY is not used
 451 // KEY_DISPLAY is used for gui_subj_dist_override_koef_enum;
 452 // KEY_LEFT/KEY_RIGHT is used for gui_subj_dist_override_value_enum (because of no separate ZOOM_IN/OUT)
 453 
 454 // Define keyboard / button shortcut values not already set above
 455 
 456 //Alt mode
 457 #if !defined(SHORTCUT_TOGGLE_RAW)
 458     #if CAM_HAS_ERASE_BUTTON
 459         #define SHORTCUT_TOGGLE_RAW         KEY_ERASE
 460     #else
 461         #define SHORTCUT_TOGGLE_RAW         KEY_DISPLAY
 462     #endif
 463 #endif
 464 #if !defined(CAM_HAS_MANUAL_FOCUS) && !defined(SHORTCUT_MF_TOGGLE)
 465     #if CAM_HAS_ERASE_BUTTON
 466         #define SHORTCUT_MF_TOGGLE          KEY_DISPLAY
 467     #else
 468         #define SHORTCUT_MF_TOGGLE          KEY_UP
 469     #endif
 470 #endif
 471 
 472 //Half press shoot button    
 473 #if !defined(SHORTCUT_TOGGLE_HISTO)
 474     #if CAM_HAS_ERASE_BUTTON
 475         #define SHORTCUT_TOGGLE_HISTO       KEY_UP
 476     #else
 477         #define SHORTCUT_TOGGLE_HISTO       KEY_MENU
 478     #endif
 479 #endif
 480 #if !defined(SHORTCUT_TOGGLE_ZEBRA)
 481     #define SHORTCUT_TOGGLE_ZEBRA       KEY_LEFT
 482 #endif
 483 #if !defined(SHORTCUT_TOGGLE_OSD)
 484     #define SHORTCUT_TOGGLE_OSD         KEY_RIGHT
 485 #endif
 486 #if !defined(SHORTCUT_DISABLE_OVERRIDES)
 487     #define SHORTCUT_DISABLE_OVERRIDES  KEY_DOWN
 488 #endif
 489 
 490 //Alt mode & Manual mode  
 491 #if !defined(SHORTCUT_SET_INFINITY)
 492     #if CAM_HAS_ERASE_BUTTON
 493         #define SHORTCUT_SET_INFINITY       KEY_UP
 494     #else
 495         #define SHORTCUT_SET_INFINITY       KEY_DISPLAY
 496     #endif
 497 #endif
 498 #if !defined(SHORTCUT_SET_HYPERFOCAL)
 499     #define SHORTCUT_SET_HYPERFOCAL     KEY_DOWN
 500 #endif
 501 
 502 #if CAM_HAS_ZOOM_LEVER
 503     #define SHORTCUT_SD_SUB KEY_ZOOM_OUT
 504     #define SHORTCUT_SD_ADD KEY_ZOOM_IN
 505 #endif
 506 
 507 //==========================================================
 508 
 509 // DebugAssert
 510 #ifndef CAM_3ARG_DebugAssert
 511     #ifdef THUMB_FW
 512         #define CAM_3ARG_DebugAssert        1   // Digic6 - default is 3 arg version of DebugAssert
 513     #else
 514         #define CAM_3ARG_DebugAssert        0   // All others default is 2 arg version
 515     #endif
 516 #endif
 517 
 518 //==========================================================
 519 #include "camera_info.h"
 520 //==========================================================
 521 
 522 #endif /* CAMERA_H */

/* [<][>][^][v][top][bottom][index][help] */