Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
a2a841fa
Commit
a2a841fa
authored
Jun 02, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PageNumber field to Exif and use it as sensor port number storage
parent
97a0469d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
303 additions
and
269 deletions
+303
-269
exif393.c
src/drivers/elphel/exif393.c
+53
-41
sensor_common.c
src/drivers/elphel/sensor_common.c
+222
-221
c313a.h
src/include/elphel/c313a.h
+1
-1
exifa.h
src/include/elphel/exifa.h
+27
-6
No files found.
src/drivers/elphel/exif393.c
View file @
a2a841fa
...
...
@@ -176,12 +176,24 @@ ssize_t minor_file_size(int minor) { //return current file size for different mi
}
ssize_t
minor_max_size
(
int
minor
)
{
//return max file size for different minors
switch
(
minor
)
{
case
X3X3_EXIF_TEMPLATE
:
return
MAX_EXIF_SIZE
;
case
X3X3_EXIF_EXIF
:
return
MAX_EXIF_SIZE
*
(
MAX_EXIF_FRAMES
+
1
);
case
X3X3_EXIF_META
:
return
MAX_EXIF_SIZE
;
case
X3X3_EXIF_METADIR
:
return
MAX_EXIF_FIELDS
*
sizeof
(
struct
exif_dir_table_t
);
case
X3X3_EXIF_TIME
:
return
sizeof
(
struct
exif_time_t
);
default:
return
0
;
case
X3X3_EXIF_TEMPLATE
:
return
MAX_EXIF_SIZE
;
case
X3X3_EXIF_EXIF_CHN_0
:
case
X3X3_EXIF_EXIF_CHN_1
:
case
X3X3_EXIF_EXIF_CHN_2
:
case
X3X3_EXIF_EXIF_CHN_3
:
return
MAX_EXIF_SIZE
*
(
MAX_EXIF_FRAMES
+
1
);
case
X3X3_EXIF_META_CHN_0
:
case
X3X3_EXIF_META_CHN_1
:
case
X3X3_EXIF_META_CHN_2
:
case
X3X3_EXIF_META_CHN_3
:
return
MAX_EXIF_SIZE
;
case
X3X3_EXIF_METADIR
:
return
MAX_EXIF_FIELDS
*
sizeof
(
struct
exif_dir_table_t
);
case
X3X3_EXIF_TIME
:
return
sizeof
(
struct
exif_time_t
);
default:
return
0
;
}
}
void
exif_invalidate
(
void
)
{
// 393: OK, only invalidates all ayt once
...
...
@@ -231,6 +243,7 @@ int exif_rebuild_chn(int sensor_port, int frames) {
return
-
1
;
}
memset
(
meta_buffer
,
0
,
aexif_meta_size
[
sensor_port
]
*
(
MAX_EXIF_FRAMES
+
1
));
ameta_buffer
[
sensor_port
]
=
meta_buffer
;
aexif_valid
[
sensor_port
]
=
1
;
return
0
;
}
...
...
@@ -507,7 +520,6 @@ static loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
int
maxsize
=
minor_max_size
(
p
);
// int sensor_port;
int
fp
;
switch
(
orig
)
{
case
SEEK_SET
:
file
->
f_pos
=
offset
;
...
...
@@ -539,44 +551,44 @@ static loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
default
:
return
-
EINVAL
;
}
break
;
case
X3X3_EXIF_EXIF_CHN_0
:
case
X3X3_EXIF_EXIF_CHN_1
:
case
X3X3_EXIF_EXIF_CHN_2
:
case
X3X3_EXIF_EXIF_CHN_3
:
// sensor_port = p - X3X3_EXIF_EXIF_CHN_0;
if
(
offset
>
MAX_EXIF_FRAMES
)
return
-
EOVERFLOW
;
//larger than buffer
// file->f_pos=exif_meta_size * offset;
file
->
f_pos
=
exif_template_size
*
offset
;
case
X3X3_EXIF_EXIF_CHN_0
:
case
X3X3_EXIF_EXIF_CHN_1
:
case
X3X3_EXIF_EXIF_CHN_2
:
case
X3X3_EXIF_EXIF_CHN_3
:
// sensor_port = p - X3X3_EXIF_EXIF_CHN_0;
if
(
offset
>
MAX_EXIF_FRAMES
)
return
-
EOVERFLOW
;
//larger than buffer
// file->f_pos=exif_meta_size * offset;
file
->
f_pos
=
exif_template_size
*
offset
;
break
;
case
X3X3_EXIF_META
:
// iterate
fp
=
dir_find_tag
(
offset
);
if
(
fp
<
0
)
return
-
EOVERFLOW
;
// tag is not in the directory
file
->
f_pos
=
fp
;
break
;
case
X3X3_EXIF_META_CHN_0
:
case
X3X3_EXIF_META_CHN_1
:
case
X3X3_EXIF_META_CHN_2
:
case
X3X3_EXIF_META_CHN_3
:
file
->
f_pos
=
offset
*
sizeof
(
struct
exif_dir_table_t
);
break
;
case
X3X3_EXIF_TIME
:
switch
(
offset
)
{
case
EXIF_LSEEK_TOMORROW_DATE
:
file
->
f_pos
=
exif_time
.
tomorrow_date
-
((
char
*
)
&
exif_time
);
break
;
case
X3X3_EXIF_META
:
// iterate
fp
=
dir_find_tag
(
offset
);
if
(
fp
<
0
)
return
-
EOVERFLOW
;
// tag is not in the directory
file
->
f_pos
=
fp
;
case
EXIF_LSEEK_TOMORROW_SEC
:
file
->
f_pos
=
((
char
*
)
&
exif_time
.
tomorrow_sec
)
-
((
char
*
)
&
exif_time
);
break
;
case
X3X3_EXIF_META_CHN_0
:
case
X3X3_EXIF_META_CHN_1
:
case
X3X3_EXIF_META_CHN_2
:
case
X3X3_EXIF_META_CHN_3
:
file
->
f_pos
=
offset
*
sizeof
(
struct
exif_dir_table_t
);
case
EXIF_LSEEK_TODAY_DATE
:
file
->
f_pos
=
exif_time
.
today_date
-
((
char
*
)
&
exif_time
);
break
;
case
X3X3_EXIF_TIME
:
switch
(
offset
)
{
case
EXIF_LSEEK_TOMORROW_DATE
:
file
->
f_pos
=
exif_time
.
tomorrow_date
-
((
char
*
)
&
exif_time
);
break
;
case
EXIF_LSEEK_TOMORROW_SEC
:
file
->
f_pos
=
((
char
*
)
&
exif_time
.
tomorrow_sec
)
-
((
char
*
)
&
exif_time
);
break
;
case
EXIF_LSEEK_TODAY_DATE
:
file
->
f_pos
=
exif_time
.
today_date
-
((
char
*
)
&
exif_time
);
break
;
case
EXIF_LSEEK_TODAY_SEC
:
file
->
f_pos
=
((
char
*
)
&
exif_time
.
today_sec
)
-
((
char
*
)
&
exif_time
);
break
;
default
:
return
-
EINVAL
;
}
case
EXIF_LSEEK_TODAY_SEC
:
file
->
f_pos
=
((
char
*
)
&
exif_time
.
today_sec
)
-
((
char
*
)
&
exif_time
);
break
;
default
:
return
-
EINVAL
;
default
:
return
-
EINVAL
;
}
break
;
default
:
return
-
EINVAL
;
}
}
break
;
...
...
src/drivers/elphel/sensor_common.c
View file @
a2a841fa
This diff is collapsed.
Click to expand it.
src/include/elphel/c313a.h
View file @
a2a841fa
...
...
@@ -4,7 +4,7 @@
*/
#ifndef _ASM_CMOSCAM_H
#define _ASM_CMOSCAM_H
PARS_FRAMES
#define _ASM_CMOSCAM_H
#define SAFE_CHECK 1 // perform more verification on the paremeters
//#define ELPHEL_DEBUG 0 //global debug on/off in multiple files
//#define ELPHEL_DEBUG_STARTUP 000a4c00 ;
...
...
src/include/elphel/exifa.h
View file @
a2a841fa
...
...
@@ -66,6 +66,8 @@ struct exif_dir_table_t {
// hack, reusing field to keep it protected
#define Exif_Image_IPTCNAA 0x083bb
#define Exif_Image_FrameNumber 0x083bb
// used for sensor number
#define Exif_Image_PageNumber 0x00129
#define Exif_Image_ExifTag 0x08769
#define Exif_Image_GPSTag 0x08825
...
...
@@ -178,13 +180,32 @@ struct meta_CompassInfo_t {
#define Exif_GPSInfo_CompassRoll_Index 0x12
#define Exif_Image_FrameNumber_Index 0x13
#define Exif_Image_Orientation_Index 0x14
#define Exif_Photo_MakerNote_Index 0x15
#define Exif_Image_PageNumber_Index 0x15
#define Exif_Photo_MakerNote_Index 0x16
/// update ExifKmlNumber to be total number of *_Index entries
#define ExifKmlNumber Exif_Photo_MakerNote_Index+1
#define EXIF_DEV_NAME "/dev/exif_exif"
//#define EXIF_DEV_NAME "/dev/exif_exif"
#define EXIFDIR_DEV_NAME "/dev/exif_metadir"
#define EXIFMETA_DEV_NAME "/dev/exif_meta"
#endif
//#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 */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment