root/platform/ixus185_elph185/sub/filewrite_hdr.c

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

DEFINITIONS

This source file includes following definitions.
  1. log_fwt_msg
  2. log_fwt_start

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 
   4 // debug
   5 //#define FILEWRITE_DEBUG_LOG 1
   6 extern void _LogCameraEvent(int id,const char *fmt,...);
   7 
   8 typedef struct {
   9     unsigned int address;
  10     unsigned int length;
  11 } cam_ptp_data_chunk; //camera specific structure
  12 
  13 #define MAX_CHUNKS_FOR_JPEG 7 // filewritetask is prepared for this many chunks
  14 
  15 
  16 // comments below from elph180, firmware code appears very similar, offsets verified
  17 /*
  18  * fwt_data_struct: defined here as it's camera dependent
  19  * unneeded members are designated with unkn
  20  * file_offset, full_size, seek_flag only needs to be defined for cameras with CAM_FILEWRITETASK_SEEK/CAM_FILEWRITETASK_MULTIPASS
  21  * pdc is always required
  22  * name is not currently used
  23  */
  24 typedef struct
  25 {
  26     int unkn1; // message number
  27     int file_offset;
  28     int maybe_full_size; // maybe, on g7x wasn't always full size
  29     int unkn2, unkn3;
  30     int unkn4;
  31     cam_ptp_data_chunk pdc[MAX_CHUNKS_FOR_JPEG];
  32     int maybe_seek_flag;      // 0x2083 jpeg, 0x100 create dir, 0x200 CacheFlush
  33     int unkn5, unkn6;
  34     char name[32];      // offset from start 0x5c, from Open case
  35 } fwt_data_struct;
  36 /*
  37 observed message sequences
  38 JPEG
  39 12 maybe_full_size = 0x004437ac (=actual size), seek_flag = 0x2083
  40  0 chunk 0-0x004437ac
  41  1 chunk 0-0
  42  7 close
  43 
  44 new directory
  45 11 seek_flag = 0x100
  46 before m 12 for shot, after raw hook in capt_seq
  47 
  48 after shot
  49 10 A/ seek_flag 0x200
  50 */
  51 
  52 #include "../../../generic/filewrite.c"
  53 
  54 #ifdef FILEWRITE_DEBUG_LOG
  55 void log_fwt_msg(fwt_data_struct *fwd)
  56 {
  57     int m=fwd->unkn1;
  58     _LogCameraEvent(0x60,"fw m:%d o:0x%08x fs:0x%08x sf:0x%x",m,fwd->file_offset,fwd->maybe_full_size,fwd->maybe_seek_flag);
  59     _LogCameraEvent(0x60,"fw %s",fwd->name);
  60     if(m >= 0 && m <=6) {
  61         _LogCameraEvent(0x60,"fw chunk adr:0x%08x l:0x%08x",fwd->pdc[m].address,fwd->pdc[m].length);
  62     }
  63     _LogCameraEvent(0x60,"fw u %08x %08x %08x %08x %08x %08x",fwd->unkn2,fwd->unkn3,fwd->unkn4,fwd->unkn5,fwd->unkn6);
  64 }
  65 
  66 void log_fwt_start(void)
  67 {
  68     _LogCameraEvent(0x60,"fw start");
  69 }
  70 #endif
  71 

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