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

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