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

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