Changeset 1862
- Timestamp:
- 05/19/12 00:33:36 (12 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
core/dng.c (modified) (6 diffs)
-
core/main.c (modified) (1 diff)
-
core/module_exportlist.c (modified) (2 diffs)
-
include/camera.h (modified) (1 diff)
-
platform/generic/capt_seq.c (modified) (2 diffs)
-
platform/ixus40_sd300/sub/100j/capt_seq.c (modified) (1 diff)
-
platform/ixus40_sd300/sub/100k/capt_seq.c (modified) (1 diff)
-
platform/sx130is/sub/101c/capt_seq.c (modified) (1 diff)
-
platform/sx130is/sub/101d/capt_seq.c (modified) (1 diff)
-
platform/sx130is/sub/101f/capt_seq.c (modified) (1 diff)
-
platform/sx150is/sub/100a/capt_seq.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/dng.c
r1809 r1862 50 50 static int cam_AsShotNeutral[] = {1000,1000,1000,1000,1000,1000}; 51 51 static char cam_datetime[20] = ""; // DateTimeOriginal 52 static char cam_subsectime[4] = ""; // DateTimeOriginal (milliseconds component) 52 53 static int cam_shutter[2] = { 0, 1000000 }; // Shutter speed 53 54 static int cam_aperture[2] = { 0, 10 }; // Aperture … … 178 179 #define METERING_MODE_INDEX 10 // tag 0x9207 179 180 #define FLASH_MODE_INDEX 11 // tag 0x9209 181 #define SSTIME_INDEX 13 // tag 0x9290 182 #define SSTIME_ORIG_INDEX 14 // tag 0x9291 180 183 181 184 struct dir_entry exif_ifd[]={ … … 193 196 {0x9209, T_SHORT, 1, 0}, // Flash mode 194 197 {0x920A, T_RATIONAL, 1, (int)cam_focal_length}, // FocalLength 198 {0x9290, T_ASCII|T_PTR,4, (int)cam_subsectime}, // DateTime milliseconds 199 {0x9291, T_ASCII|T_PTR,4, (int)cam_subsectime}, // DateTimeOriginal milliseconds 195 200 {0xA405, T_SHORT|T_PTR,1, (int)&exif_data.effective_focal_length}, // FocalLengthIn35mmFilm 196 201 }; … … 312 317 exif_ifd[METERING_MODE_INDEX].offset = get_metering_mode_for_exif(exif_data.metering_mode); 313 318 exif_ifd[FLASH_MODE_INDEX].offset = get_flash_mode_for_exif(exif_data.flash_mode, exif_data.flash_fired); 319 exif_ifd[SSTIME_INDEX].count = exif_ifd[SSTIME_ORIG_INDEX].count = strlen(cam_subsectime)+1; 314 320 315 321 // calculating offset of RAW data and count of entries for each IFD … … 491 497 short short_prop_val; 492 498 time_t datetime; 499 long subsectime; 493 500 struct tm *ttm; 494 extern volatile long shutter_open_time; // defined in platform/generic/capt_seq.c 501 extern volatile long shutter_open_time; // defined in platform/generic/capt_seq.c 502 extern volatile long shutter_open_tick_count; // defined in platform/generic/capt_seq.c 495 503 int wb[3]; 496 504 … … 503 511 504 512 // Date & time tag (note - uses shutter speed from 'short_prop_val' code above) 505 if (shutter_open_time) { datetime = shutter_open_time + pow_calc(1, 2, 1, -short_prop_val, 96); shutter_open_time=0;} // shutter closing time 506 else datetime = time(NULL); 513 if (shutter_open_time) 514 { 515 // milliseconds component of shutter_open_time 516 subsectime = (shutter_open_tick_count - camera_info.tick_count_offset) % 1000; 517 // shutter closing time 518 datetime = shutter_open_time + ((cam_shutter[0] + (subsectime * 1000)) / 1000000); 519 shutter_open_time=0; 520 } 521 else 522 { 523 datetime = time(NULL); 524 // milliseconds component of datetime 525 subsectime = (get_tick_count() - camera_info.tick_count_offset) % 1000; 526 } 507 527 ttm = localtime(&datetime); 508 528 sprintf(cam_datetime, "%04d:%02d:%02d %02d:%02d:%02d", ttm->tm_year+1900, ttm->tm_mon+1, ttm->tm_mday, ttm->tm_hour, ttm->tm_min, ttm->tm_sec); 529 sprintf(cam_subsectime, "%02d", subsectime/10); // camera tick count is only accurate to 10 msec intervals 509 530 510 531 get_property_case(camera_info.props.av, &short_prop_val, sizeof(short_prop_val)); -
trunk/core/main.c
r1823 r1862 249 249 #endif 250 250 251 // Calculate the value of get_tick_count() when the clock ticks over to the next second 252 // Used to calculate the SubSecondTime value when saving DNG files. 253 long t1, t2; 254 t2 = time(0); 255 do 256 { 257 t1 = t2; 258 camera_info.tick_count_offset = get_tick_count(); 259 t2 = time(0); 260 msleep(10); 261 } while (t1 != t2); 262 camera_info.tick_count_offset = camera_info.tick_count_offset % 1000; 263 251 264 while (1) 252 265 { -
trunk/core/module_exportlist.c
r1828 r1862 37 37 38 38 extern long shutter_open_time; // defined in platform/generic/capt_seq.c 39 extern long shutter_open_tick_count; // defined in platform/generic/capt_seq.c 39 40 40 41 … … 280 281 281 282 &shutter_open_time, 283 &shutter_open_tick_count, 282 284 &state_shooting_progress, 283 285 get_raw_pixel, -
trunk/include/camera.h
r1830 r1862 305 305 } props; 306 306 int rombaseaddr, maxramaddr; 307 int tick_count_offset; // get_tick_count value at which the clock ticks over 1 second 307 308 } _cam_info; 308 309 -
trunk/platform/generic/capt_seq.c
r1693 r1862 16 16 17 17 static long raw_save_stage; 18 volatile long shutter_open_time=0; // for DNG EXIF creation 18 volatile long shutter_open_time=0; // for DNG EXIF creation 19 volatile long shutter_open_tick_count; // for DNG EXIF creation 19 20 20 21 void __attribute__((naked,noinline)) capt_seq_hook_raw_here() … … 76 77 }; 77 78 78 shutter_open_time=_time((void*)0); 79 shutter_open_time=_time((void*)0); 80 shutter_open_tick_count = get_tick_count(); 79 81 80 82 asm volatile("LDMFD SP!, {R0-R12,PC}\n"); -
trunk/platform/ixus40_sd300/sub/100j/capt_seq.c
r716 r1862 23 23 static long raw_save_stage; 24 24 volatile long shutter_open_time=0; // for DNG EXIF creation, dummy for this camera 25 volatile long shutter_open_tick_count; // for DNG EXIF creation 25 26 26 27 void __attribute__((naked,noinline)) capt_seq_hook_raw_here() -
trunk/platform/ixus40_sd300/sub/100k/capt_seq.c
r716 r1862 13 13 static long raw_save_stage; 14 14 volatile long shutter_open_time=0; // for DNG EXIF creation, dummy for this camera 15 volatile long shutter_open_tick_count; // for DNG EXIF creation 15 16 16 17 void __attribute__((naked,noinline)) capt_seq_hook_raw_here() -
trunk/platform/sx130is/sub/101c/capt_seq.c
r1128 r1862 14 14 15 15 shutter_open_time=_time((void*)0); 16 shutter_open_tick_count = get_tick_count(); 16 17 17 18 // Firmware also tests for 3 and 7, meaning unknown, so we don't touch them -
trunk/platform/sx130is/sub/101d/capt_seq.c
r1377 r1862 14 14 15 15 shutter_open_time=_time((void*)0); 16 shutter_open_tick_count = get_tick_count(); 16 17 17 18 // Firmware also tests for 3 and 7, meaning unknown, so we don't touch them -
trunk/platform/sx130is/sub/101f/capt_seq.c
r1377 r1862 14 14 15 15 shutter_open_time=_time((void*)0); 16 shutter_open_tick_count = get_tick_count(); 16 17 17 18 // Firmware also tests for 3 and 7, meaning unknown, so we don't touch them -
trunk/platform/sx150is/sub/100a/capt_seq.c
r1598 r1862 14 14 15 15 shutter_open_time=_time((void*)0); 16 shutter_open_tick_count = get_tick_count(); 16 17 17 18 // Firmware also tests for 3 and 7, meaning unknown, so we don't touch them
Note: See TracChangeset
for help on using the changeset viewer.