Commit 2b8f9342 authored by Andrey Filippov's avatar Andrey Filippov

Working on exif, fixing some other problems

parent 527b91bf
...@@ -294,46 +294,46 @@ static int __init elphelmem_init(void) ...@@ -294,46 +294,46 @@ static int __init elphelmem_init(void)
pr_err("ERROR allocating Bidirectional DMA memory buffer\n"); pr_err("ERROR allocating Bidirectional DMA memory buffer\n");
} }
pr_info("Coherent buffer vaddr: 0x%08X\n",(u32) pElphel_buf -> vaddr); pr_info("Coherent buffer vaddr: 0x%08x\n",(u32) pElphel_buf -> vaddr);
pr_info("Coherent buffer paddr: 0x%08X\n",(u32) pElphel_buf -> paddr); pr_info("Coherent buffer paddr: 0x%08x\n",(u32) pElphel_buf -> paddr);
pr_info("Coherent buffer length: 0x%08X\n",(u32) pElphel_buf -> size * PAGE_SIZE); pr_info("Coherent buffer length: 0x%08lx\n",(u32) pElphel_buf -> size * PAGE_SIZE);
pr_info(" circbuf channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn0_vaddr, (u32) pElphel_buf -> circbuf_chn0_vaddr,
(u32) pElphel_buf -> circbuf_chn0_paddr, (u32) pElphel_buf -> circbuf_chn0_paddr,
(u32) pElphel_buf-> circbuf_chn0_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn0_size * PAGE_SIZE);
pr_info(" circbuf channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn1_vaddr, (u32) pElphel_buf -> circbuf_chn1_vaddr,
(u32) pElphel_buf -> circbuf_chn1_paddr, (u32) pElphel_buf -> circbuf_chn1_paddr,
(u32) pElphel_buf-> circbuf_chn1_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn1_size * PAGE_SIZE);
pr_info(" circbuf channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn2_vaddr, (u32) pElphel_buf -> circbuf_chn2_vaddr,
(u32) pElphel_buf -> circbuf_chn2_paddr, (u32) pElphel_buf -> circbuf_chn2_paddr,
(u32) pElphel_buf-> circbuf_chn2_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn2_size * PAGE_SIZE);
pr_info(" circbuf channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> circbuf_chn3_vaddr, (u32) pElphel_buf -> circbuf_chn3_vaddr,
(u32) pElphel_buf -> circbuf_chn3_paddr, (u32) pElphel_buf -> circbuf_chn3_paddr,
(u32) pElphel_buf-> circbuf_chn3_size * PAGE_SIZE); (u32) pElphel_buf-> circbuf_chn3_size * PAGE_SIZE);
pr_info(" raw channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn0_vaddr, (u32) pElphel_buf -> raw_chn0_vaddr,
(u32) pElphel_buf -> raw_chn0_paddr, (u32) pElphel_buf -> raw_chn0_paddr,
(u32) pElphel_buf-> raw_chn0_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn0_size * PAGE_SIZE);
pr_info(" raw channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn1_vaddr, (u32) pElphel_buf -> raw_chn1_vaddr,
(u32) pElphel_buf -> raw_chn1_paddr, (u32) pElphel_buf -> raw_chn1_paddr,
(u32) pElphel_buf-> raw_chn1_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn1_size * PAGE_SIZE);
pr_info(" raw channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn2_vaddr, (u32) pElphel_buf -> raw_chn2_vaddr,
(u32) pElphel_buf -> raw_chn2_paddr, (u32) pElphel_buf -> raw_chn2_paddr,
(u32) pElphel_buf-> raw_chn2_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn2_size * PAGE_SIZE);
pr_info(" raw channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n",
(u32) pElphel_buf -> raw_chn3_vaddr, (u32) pElphel_buf -> raw_chn3_vaddr,
(u32) pElphel_buf -> raw_chn3_paddr, (u32) pElphel_buf -> raw_chn3_paddr,
(u32) pElphel_buf-> raw_chn3_size * PAGE_SIZE); (u32) pElphel_buf-> raw_chn3_size * PAGE_SIZE);
......
This diff is collapsed.
...@@ -1354,14 +1354,14 @@ int multisensor_pgm_multisens (int sensor_port, ///< sensor port n ...@@ -1354,14 +1354,14 @@ int multisensor_pgm_multisens (int sensor_port, ///< sensor port n
// int old_sensor=prev_selected-1; // may be <0 // int old_sensor=prev_selected-1; // may be <0
// int new_sensor=selected-1; // >=0 // int new_sensor=selected-1; // >=0
if (multi_unitialized[sensor_port] && (!prev_composite) && (old_sensor>=0)) { // was single-sensor mode, copy P_WOI_* to individual sensor WOI and FLIPS if (multi_unitialized[sensor_port] && (!prev_composite) && (old_sensor>=0)) { // was single-sensor mode, copy P_WOI_* to individual sensor WOI and FLIPS
dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized, old_sensor, multi_fliph,multi_flipv); dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized[old_sensor], old_sensor, multi_fliph,multi_flipv);
wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_WIDTH]; wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_WIDTH];
wois[(P_MULTI_HEIGHT1-P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_HEIGHT]; wois[(P_MULTI_HEIGHT1-P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_HEIGHT];
wois[(P_MULTI_LEFT1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_LEFT]; wois[(P_MULTI_LEFT1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_LEFT];
wois[(P_MULTI_TOP1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_TOP]; wois[(P_MULTI_TOP1- P_MULTI_WOI)+old_sensor]= prevpars->pars[P_WOI_TOP];
multi_fliph= (multi_fliph & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPH] & 1) << old_sensor); multi_fliph= (multi_fliph & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPH] & 1) << old_sensor);
multi_flipv= (multi_flipv & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPV] & 1) << old_sensor); multi_flipv= (multi_flipv & (~(1<<old_sensor))) | ((prevpars->pars[P_FLIPV] & 1) << old_sensor);
dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized, old_sensor, multi_fliph,multi_flipv); dev_dbg(g_dev_ptr,"multi_unitialized=%d old_sensor=%x, multi_fliph=%x multi_flipv=%x\n", multi_unitialized[old_sensor], old_sensor, multi_fliph,multi_flipv);
} }
if (multi_unitialized[sensor_port] && (!composite) && (prev_composite || ((new_sensor>=0) && (old_sensor!=new_sensor)))) { // now single-sensor mode, set P_WOI* from saved parameters if (multi_unitialized[sensor_port] && (!composite) && (prev_composite || ((new_sensor>=0) && (old_sensor!=new_sensor)))) { // now single-sensor mode, set P_WOI* from saved parameters
if ((wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+new_sensor]==0) || (wois[(P_MULTI_HEIGHT1- P_MULTI_WOI)+new_sensor]==0)) { if ((wois[(P_MULTI_WIDTH1- P_MULTI_WOI)+new_sensor]==0) || (wois[(P_MULTI_HEIGHT1- P_MULTI_WOI)+new_sensor]==0)) {
...@@ -2181,9 +2181,11 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3) ...@@ -2181,9 +2181,11 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3)
#endif #endif
} }
for (i=0; i<8;i++) printk (" %02x ",i); printk("\n"); for (i=0; i<8;i++) printk (" %02x ",i);
printk("\n");
for (n=0;n<64;n+=8) { for (n=0;n<64;n+=8) {
for (i=0; i<8;i++) printk ("%04lx ", data[n+i]); printk("\n"); for (i=0; i<8;i++) printk ("%04lx ", data[n+i]);
printk("\n");
} }
for (i=0;i<8;i++) setbits[i]=0; for (i=0;i<8;i++) setbits[i]=0;
for (n=0;n<64;n++) { for (n=0;n<64;n++) {
...@@ -2198,7 +2200,8 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3) ...@@ -2198,7 +2200,8 @@ int multisensor_memphase_debug (int sensor_port, ///< Sesnor port number (0..3)
} }
} }
OK=(setbits[0]==0) && (setbits[1]==0) && (setbits[2]==0) && (setbits[3]==0x80) && (setbits[4]==0x80) && (setbits[5]==0x80) && (setbits[6]==0) && (setbits[7]==0); OK=(setbits[0]==0) && (setbits[1]==0) && (setbits[2]==0) && (setbits[3]==0x80) && (setbits[4]==0x80) && (setbits[5]==0x80) && (setbits[6]==0) && (setbits[7]==0);
for (i=0; i<8;i++) printk (" %03x ",setbits[i]); printk("\n"); for (i=0; i<8;i++) printk (" %03x ",setbits[i]);
printk("\n");
n=(0x10000*sx)/s; n=(0x10000*sx)/s;
printk ("Centroid - 0x%x, sx=0x%x, s=0x%x. OK=%d\n",n, sx,s,OK); printk ("Centroid - 0x%x, sx=0x%x, s=0x%x. OK=%d\n",n, sx,s,OK);
return n; return n;
......
...@@ -450,6 +450,7 @@ extern struct sensor_port_config_t *pSensorPortConfig; ...@@ -450,6 +450,7 @@ extern struct sensor_port_config_t *pSensorPortConfig;
#define SET_SENSOR_MIBPAR_COND_LUT(p,f,i,r,v) {\ #define SET_SENSOR_MIBPAR_COND_LUT(p,f,i,r,v) {\
int _MINDEX= MULTIREG(p,P_SENSOR_REGS+(r),(i));\ int _MINDEX= MULTIREG(p,P_SENSOR_REGS+(r),(i));\
int _I = (i);\ int _I = (i);\
int _ADDR;\
if (_MINDEX) { \ if (_MINDEX) { \
if ((v) != thispars->pars[_MINDEX]) { \ if ((v) != thispars->pars[_MINDEX]) { \
pars_to_update[nupdate ].num= _MINDEX ;\ pars_to_update[nupdate ].num= _MINDEX ;\
...@@ -462,7 +463,7 @@ extern struct sensor_port_config_t *pSensorPortConfig; ...@@ -462,7 +463,7 @@ extern struct sensor_port_config_t *pSensorPortConfig;
_I = pSensorPortConfig[(p)].broadcast_addr;\ _I = pSensorPortConfig[(p)].broadcast_addr;\
} \ } \
} \ } \
int _ADDR = pSensorPortConfig[(p)].par2addr[_I][(r)];\ _ADDR = pSensorPortConfig[(p)].par2addr[_I][(r)];\
if (!(_ADDR&0xffff0000)) {\ if (!(_ADDR&0xffff0000)) {\
X3X3_I2C_SEND2_LUT((p), (f), _I, _ADDR, (v));\ X3X3_I2C_SEND2_LUT((p), (f), _I, _ADDR, (v));\
}\ }\
......
...@@ -160,14 +160,21 @@ u32 get_compressor_frame(unsigned int chn) ///< Sensor port number (0..3) ...@@ -160,14 +160,21 @@ u32 get_compressor_frame(unsigned int chn) ///< Sensor port number (0..3)
* will have offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page) * will have offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page)
*/ */
static struct meta_offsets_t { // static struct meta_offsets_t { //
int Image_DateTime; ///< EXIF Date/Time offset int Image_DateTime; ///< EXIF Date/Time offset
///< Has offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page) ///< Has offset of the Exif_Image_DateTime data in meta page (Exif_Photo_SubSecTime should go immediately after in meta page)
int Photo_DateTimeOriginal; ///< EXIF Date/Time Original offset int Photo_DateTimeOriginal; ///< EXIF Date/Time Original offset
int Photo_ExposureTime; ///< EXIF exposure offset int Photo_ExposureTime; ///< EXIF exposure offset
int Image_ImageNumber; ///< EXIF image number offset int Image_ImageNumber; ///< EXIF image number offset
int Image_Orientation; ///< EXIF image orientation offset int Image_Orientation; ///< EXIF image orientation offset
int Photo_MakerNote; ///< EXIF maker note (custom data for multi-frame composite images) offset int Photo_MakerNote; ///< EXIF maker note (custom data for multi-frame composite images) offset
int PageNumber; ///< EXIF subchannel (0..3) number offset int PageNumber; ///< EXIF subchannel (0..3) number offset
int ImageWidth; ///< TIFF image width (long, 1)
int ImageLength; ///< TIFF image height (long,1)
int Image_BitsPerSample; ///< TIFF bits per sample, now 8 or 16 (short, 1)
int Image_SamplesPerPixel; ///< TIFF samples per pixel, now always 1 (short, 1)
int RowsPerStrip; ///< TIFF now image height (short, 1)
int StripByteCounts ; ///< TIFF with single strip - byte size of the image (W*H*Image_SamplesPerPixel*ceil(Image_BitsPerSample/8)
} meta_offsets; } meta_offsets;
#ifdef TEST_DISABLE_CODE #ifdef TEST_DISABLE_CODE
...@@ -498,11 +505,12 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer ...@@ -498,11 +505,12 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer
int index_time = jptr->jpeg_wp - 11; int index_time = jptr->jpeg_wp - 11;
char time_buff[27]; char time_buff[27];
char * exif_meta_time_string; char * exif_meta_time_string;
// calcualte bayer without flips - extra xor // calculate bayer without flips - extra xor
int global_flips, extra_flips, bayer; int global_flips, extra_flips, bayer;
unsigned char orientations[]="1638274545273816"; unsigned char orientations[]="1638274545273816";
unsigned char orientation_short[2]; unsigned char orientation_short[2];
int maker_offset; int maker_offset;
unsigned long width, height, bits;
u32 frame = jptr->frame; u32 frame = jptr->frame;
// int frame_index = frame & PASTPARS_SAVE_ENTRIES_MASK; // int frame_index = frame & PASTPARS_SAVE_ENTRIES_MASK;
// NC393: current parameters are valid at compressor done interrupt (after frame sync interrupts latest valid is new frame number - 2 // NC393: current parameters are valid at compressor done interrupt (after frame sync interrupts latest valid is new frame number - 2
...@@ -523,7 +531,7 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer ...@@ -523,7 +531,7 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer
global_flips=extra_flips & 3; global_flips=extra_flips & 3;
} }
// calculate bayer without flips // calculate Bayer without flips
bayer = get_imageParamsFrame(sensor_port, P_COMP_BAYER, frame); bayer = get_imageParamsFrame(sensor_port, P_COMP_BAYER, frame);
bayer ^= get_imageParamsFrame(sensor_port, P_COMPMOD_BYRSH, frame); bayer ^= get_imageParamsFrame(sensor_port, P_COMPMOD_BYRSH, frame);
// subtract flips // subtract flips
...@@ -577,6 +585,22 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer ...@@ -577,6 +585,22 @@ inline void updateIRQ_Exif(struct jpeg_ptr_t *jptr, ///< pointer
//get_globalParam(G_TASKLET_CTL) //get_globalParam(G_TASKLET_CTL)
// left 1 long spare (+44) // left 1 long spare (+44)
} }
// Tiff-related data:
width = get_imageParamsFrame(sensor_port, P_WOI_WIDTH, frame);
height = get_imageParamsFrame(sensor_port, P_WOI_HEIGHT, frame);
bits = get_imageParamsFrame(sensor_port, P_BITS, frame);
putlong_meta_irq(sensor_port, width, &meta_offsets.ImageWidth, Exif_Image_ImageWidth);
putlong_meta_irq(sensor_port, height, &meta_offsets.ImageLength, Exif_Image_ImageLength);
short_buff[0] = 0;
short_buff[1] = bits; // assuming non 8/16 (10, 12) are OK?
write_meta_irq(sensor_port, short_buff, &meta_offsets.Image_BitsPerSample, Exif_Image_BitsPerSample, 2);
short_buff[1] = 1;
write_meta_irq(sensor_port, short_buff, &meta_offsets.Image_SamplesPerPixel, Exif_Image_SamplesPerPixel, 2);
short_buff[0] = height >> 8;
short_buff[1] = height & 0xff;
write_meta_irq(sensor_port, short_buff, &meta_offsets.RowsPerStrip, Exif_Image_RowsPerStrip, 2);
putlong_meta_irq(sensor_port, height * width * ((bits + 7) >> 3), &meta_offsets.StripByteCounts, Exif_Image_StripByteCounts);
interframe->meta_index=store_meta(sensor_port); interframe->meta_index=store_meta(sensor_port);
} }
......
...@@ -51,9 +51,11 @@ struct __attribute__((__packed__)) exif_dir_table_t { ...@@ -51,9 +51,11 @@ struct __attribute__((__packed__)) exif_dir_table_t {
unsigned short tag; // Exif tag as defined in the standard unsigned short tag; // Exif tag as defined in the standard
}; };
}; };
unsigned long len; // Number of bytes to be copied from metadata to Exif unsigned long len; // Number of bytes to be copied from metadata to Exif
unsigned long src; // offset in meta data page unsigned long src; // offset in meta data page
unsigned long dst; // offset in output Exif page // unsigned long dst; // offset in output Exif page
unsigned short dst_exif; // offset in output Exif page, 0 - not in file
unsigned short dst_tiff; // offset in output Tiff page, 0 - not in file
}; };
#define MAX_EXIF_FIELDS 256 // number of Exif tags in the header #define MAX_EXIF_FIELDS 256 // number of Exif tags in the header
#define MAX_EXIF_SIZE 4096 // Exif data size #define MAX_EXIF_SIZE 4096 // Exif data size
...@@ -77,8 +79,20 @@ struct __attribute__((__packed__)) exif_dir_table_t { ...@@ -77,8 +79,20 @@ struct __attribute__((__packed__)) exif_dir_table_t {
#define Exif_Image_ExifTag 0x08769 #define Exif_Image_ExifTag 0x08769
#define Exif_Image_GPSTag 0x08825 #define Exif_Image_GPSTag 0x08825
// used for Tiff
#define Exif_Image_NewSubfileType 0x000fe // static: long, count = 1, value = 0 (not reduced, not multipage, not mask)
#define Exif_Image_ImageWidth 0x00100 // long, count = 1
#define Exif_Image_ImageLength 0x00101 // long, count = 1
#define Exif_Image_BitsPerSample 0x00102 // short, count = 1 (8/16)
#define Exif_Image_PhotometricInterpretation 0x00106 // static, short, count = 1, value = 1 (black is zero)
#define Exif_Image_StripOffsets 0x00111 // static long, count = 1 for a single strip (otherwise 1 long for each strip
#define Exif_Image_SamplesPerPixel 0x00115 // short, count = 1. Value = 1 for mono (static?)
#define Exif_Image_RowsPerStrip 0x00116 // short, count = 1. Same as height for a single strip
#define Exif_Image_StripByteCounts 0x00117 // long, count = 1 for a single strip (otherwise 1 long for each strip) = width*height*components*(bits/8)
//Sub IFD //Sub IFD
#define Exif_Photo_ExposureTime 0x1829a #define Exif_Photo_ExposureTime 0x1829a // rational, fixed denominator=1,000,000
#define Exif_Photo_DateTimeOriginal 0x19003 #define Exif_Photo_DateTimeOriginal 0x19003
#define Exif_Photo_MakerNote 0x1927c #define Exif_Photo_MakerNote 0x1927c
#define Exif_Photo_SubSecTime 0x19290 #define Exif_Photo_SubSecTime 0x19290
...@@ -164,8 +178,8 @@ struct __attribute__((__packed__)) meta_CompassInfo_t { ...@@ -164,8 +178,8 @@ struct __attribute__((__packed__)) meta_CompassInfo_t {
#define EXIF_COMPASS_ROLL_ASCII "EW" // use for roll +/- #define EXIF_COMPASS_ROLL_ASCII "EW" // use for roll +/-
/// Exif data (variable, stored with each frame) used for KML (not only) /// Exif data (variable, stored with each frame) used for KML (not only)
#define Exif_Image_ImageDescription_Index 0x00 #define Exif_Image_ImageDescription_Index 0x00 // -
#define Exif_Photo_DateTimeOriginal_Index 0x01 #define Exif_Photo_DateTimeOriginal_Index 0x01 //
#define Exif_Photo_SubSecTimeOriginal_Index 0x02 #define Exif_Photo_SubSecTimeOriginal_Index 0x02
#define Exif_Photo_ExposureTime_Index 0x03 #define Exif_Photo_ExposureTime_Index 0x03
#define Exif_GPSInfo_GPSLatitudeRef_Index 0x04 #define Exif_GPSInfo_GPSLatitudeRef_Index 0x04
...@@ -185,32 +199,24 @@ struct __attribute__((__packed__)) meta_CompassInfo_t { ...@@ -185,32 +199,24 @@ struct __attribute__((__packed__)) meta_CompassInfo_t {
#define Exif_GPSInfo_CompassRoll_Index 0x12 #define Exif_GPSInfo_CompassRoll_Index 0x12
#define Exif_Image_ImageNumber_Index 0x13 #define Exif_Image_ImageNumber_Index 0x13
#define Exif_Image_Orientation_Index 0x14 #define Exif_Image_Orientation_Index 0x14
#define Exif_Image_PageNumber_Index 0x15 #define Exif_Image_PageNumber_Index 0x15 // -
#define Exif_Photo_MakerNote_Index 0x16 #define Exif_Photo_MakerNote_Index 0x16
#define Exif_Image_ImageWidth_Index 0x17 // long, count = 1
#define Exif_Image_ImageLength_Index 0x18 // long, count = 1
#define Exif_Image_BitsPerSample_Index 0x19 // short, count = 1 (8/16)
#define Exif_Image_SamplesPerPixel_Index 0x1a // short, count = 1. Value = 1 for mono (static?) keep for future, don't change from 1
#define Exif_Image_RowsPerStrip_Index 0x1b // short, count = 1. Same as height for a single strip
#define Exif_Image_StripByteCounts_Index 0x1c // long, count = 1 for a single strip (otherwise 1 long for each strip) = width*height*components*(bits/8)
/// update ExifKmlNumber to be total number of *_Index entries /// update ExifKmlNumber to be total number of *_Index entries
#define ExifKmlNumber Exif_Photo_MakerNote_Index+1 //#define ExifKmlNumber Exif_Photo_MakerNote_Index+1
#define ExifKmlNumber Exif_Image_StripByteCounts_Index+1
//#define EXIF_DEV_NAME "/dev/exif_exif" //#define EXIF_DEV_NAME "/dev/exif_exif"
#define EXIFDIR_DEV_NAME "/dev/exif_metadir" #define EXIFDIR_DEV_NAME "/dev/exif_metadir"
//#define EXIFMETA_DEV_NAME "/dev/exif_meta" //#define EXIFMETA_DEV_NAME "/dev/exif_meta"
/**
* @brief This macro is used to construct file names in user space applications. Example
* of usage: <e>const char *exif_file_names[SENSOR_PORTS] = { EXIF_DEV_NAMES };</e>. Then the
* sensor port number can be used to access file name.
*/
#define EXIF_DEV_NAMES "/dev/exif_exif0", \
"/dev/exif_exif1", \
"/dev/exif_exif2", \
"/dev/exif_exif3"
/**
* @brief This macro is used to construct file names in user space applications. Example
* of usage: <e>const char *exifmeta_file_names[SENSOR_PORTS] = { EXIFMETA_DEV_NAMES };</e>. Then
* the sensor port number can be used to access file name.
*/
#define EXIFMETA_DEV_NAMES "/dev/exif_meta0", \
"/dev/exif_meta1", \
"/dev/exif_meta2", \
"/dev/exif_meta3"
#endif /* _ASM_EXIF_H */ #endif /* _ASM_EXIF_H */
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
#define DEV393_EXIF_METADIR ("exif_metadir", "exif_elphel", 125, 3, "0666", "c") ///< write metadata to Exif header translation (dir_table[MAX_EXIF_FIELDS]) #define DEV393_EXIF_METADIR ("exif_metadir", "exif_elphel", 125, 3, "0666", "c") ///< write metadata to Exif header translation (dir_table[MAX_EXIF_FIELDS])
#define DEV393_EXIF_TIME ("exif_time", "exif_elphel", 125, 4, "0666", "c") ///< write today/tomorrow date (YYYY:MM:DD) and number of seconds at today/tomorrow #define DEV393_EXIF_TIME ("exif_time", "exif_elphel", 125, 4, "0666", "c") ///< write today/tomorrow date (YYYY:MM:DD) and number of seconds at today/tomorrow
///< midnight (00:00:00) in seconds from epoch (long, starting from LSB) ///< midnight (00:00:00) in seconds from epoch (long, starting from LSB)
#define DEV393_TIFF_TEMPLATE ("tiff_template", "exif_elphel", 125, 5, "0666", "c") ///< write Tiff template
//#define DEV393_TIFF_METADIR ("tiff_metadir", "exif_elphel", 125, 6, "0666", "c") ///< write metadata to Tiff header translation (dir_table[MAX_EXIF_FIELDS])
#define DEV393_EXIF0 ("exif_exif0", "exif_elphel", 125, 16, "0666", "c") ///< sensor port 0: read encoded Exif data (SEEK_END) #define DEV393_EXIF0 ("exif_exif0", "exif_elphel", 125, 16, "0666", "c") ///< sensor port 0: read encoded Exif data (SEEK_END)
#define DEV393_EXIF1 ("exif_exif1", "exif_elphel", 125, 17, "0666", "c") ///< sensor port 1: read encoded Exif data (SEEK_END) #define DEV393_EXIF1 ("exif_exif1", "exif_elphel", 125, 17, "0666", "c") ///< sensor port 1: read encoded Exif data (SEEK_END)
...@@ -37,6 +40,18 @@ ...@@ -37,6 +40,18 @@
#define DEV393_EXIF_META2 ("exif_meta2", "exif_elphel", 125, 34, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic #define DEV393_EXIF_META2 ("exif_meta2", "exif_elphel", 125, 34, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic
#define DEV393_EXIF_META3 ("exif_meta3", "exif_elphel", 125, 35, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic #define DEV393_EXIF_META3 ("exif_meta3", "exif_elphel", 125, 35, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic
#define DEV393_TIFF0 ("tiff_tiff0", "exif_elphel", 125, 24, "0666", "c") ///< sensor port 0: read encoded Tiff data (SEEK_END)
#define DEV393_TIFF1 ("tiff_tiff1", "exif_elphel", 125, 25, "0666", "c") ///< sensor port 1: read encoded Tiff data (SEEK_END)
#define DEV393_TIFF2 ("tiff_tiff2", "exif_elphel", 125, 26, "0666", "c") ///< sensor port 2: read encoded Tiff data (SEEK_END)
#define DEV393_TIFF3 ("tiff_tiff3", "exif_elphel", 125, 27, "0666", "c") ///< sensor port 3: read encoded Tiff data (SEEK_END)
// Meta data common for Exif and Tiff
//#define DEV393_TIFF_META0 ("tiff_meta0", "exif_elphel", 125, 40, "0666", "c") ///< sensor port 0: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META1 ("tiff_meta1", "exif_elphel", 125, 41, "0666", "c") ///< sensor port 1: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META2 ("tiff_meta2", "exif_elphel", 125, 42, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic
//#define DEV393_TIFF_META3 ("tiff_meta3", "exif_elphel", 125, 43, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic
#define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",130,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap) #define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",130,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",130,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap) #define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",130,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS2 ("frameparsall2","framepars_operations",130,82, "0666", "c") ///< Access frame parameters for channel 2 (schedule modification, read with mmap) #define DEV393_FRAMEPARS2 ("frameparsall2","framepars_operations",130,82, "0666", "c") ///< Access frame parameters for channel 2 (schedule modification, read with mmap)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment