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
7abbacd9
Commit
7abbacd9
authored
Mar 19, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing exif-related bugs
parent
2b8f9342
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
exif393.c
src/drivers/elphel/exif393.c
+14
-2
x393_devices.h
src/include/uapi/elphel/x393_devices.h
+2
-8
No files found.
src/drivers/elphel/exif393.c
View file @
7abbacd9
...
...
@@ -74,12 +74,17 @@
static
const
char
*
const
exif393_devs
[]
=
{
DEV393_DEVNAME
(
DEV393_EXIF_TEMPLATE
),
DEV393_DEVNAME
(
DEV393_TIFF_TEMPLATE
),
DEV393_DEVNAME
(
DEV393_EXIF_METADIR
),
DEV393_DEVNAME
(
DEV393_EXIF_TIME
),
DEV393_DEVNAME
(
DEV393_EXIF0
),
DEV393_DEVNAME
(
DEV393_EXIF1
),
DEV393_DEVNAME
(
DEV393_EXIF2
),
DEV393_DEVNAME
(
DEV393_EXIF3
),
DEV393_DEVNAME
(
DEV393_TIFF0
),
DEV393_DEVNAME
(
DEV393_TIFF1
),
DEV393_DEVNAME
(
DEV393_TIFF2
),
DEV393_DEVNAME
(
DEV393_TIFF3
),
DEV393_DEVNAME
(
DEV393_EXIF_META0
),
DEV393_DEVNAME
(
DEV393_EXIF_META1
),
DEV393_DEVNAME
(
DEV393_EXIF_META2
),
...
...
@@ -90,12 +95,17 @@ static const int exif393_major = DEV393_MAJOR(DEV393_EXIF_TEMPLATE);
static
const
int
exif393_minor
[]
=
{
DEV393_MINOR
(
DEV393_EXIF_TEMPLATE
),
DEV393_MINOR
(
DEV393_TIFF_TEMPLATE
),
DEV393_MINOR
(
DEV393_EXIF_METADIR
),
DEV393_MINOR
(
DEV393_EXIF_TIME
),
DEV393_MINOR
(
DEV393_EXIF0
),
DEV393_MINOR
(
DEV393_EXIF1
),
DEV393_MINOR
(
DEV393_EXIF2
),
DEV393_MINOR
(
DEV393_EXIF3
),
DEV393_MINOR
(
DEV393_TIFF0
),
DEV393_MINOR
(
DEV393_TIFF1
),
DEV393_MINOR
(
DEV393_TIFF2
),
DEV393_MINOR
(
DEV393_TIFF3
),
DEV393_MINOR
(
DEV393_EXIF_META0
),
DEV393_MINOR
(
DEV393_EXIF_META1
),
DEV393_MINOR
(
DEV393_EXIF_META2
),
...
...
@@ -202,6 +212,8 @@ ssize_t minor_max_size(int minor) { //return max file size for different minors
switch
(
minor
)
{
case
DEV393_MINOR
(
DEV393_EXIF_TEMPLATE
):
return
MAX_EXIF_SIZE
;
case
DEV393_MINOR
(
DEV393_TIFF_TEMPLATE
):
return
MAX_EXIF_SIZE
;
case
DEV393_MINOR
(
DEV393_EXIF0
):
case
DEV393_MINOR
(
DEV393_EXIF1
):
case
DEV393_MINOR
(
DEV393_EXIF2
):
...
...
@@ -609,7 +621,7 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
switch
(
p
)
{
case
DEV393_MINOR
(
DEV393_EXIF_TEMPLATE
):
// enable/disable
case
DEV393_MINOR
(
DEV393_TIFF_TEMPLATE
):
// both files offer the same lseek commands
//
case DEV393_MINOR(DEV393_TIFF_TEMPLATE): // both files offer the same lseek commands
switch
(
offset
)
{
case
EXIF_LSEEK_DISABLE
:
exif_enable
(
0
);
...
...
@@ -709,7 +721,7 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
int
disabled_err
=
0
;
dev_dbg
(
g_devfp_ptr
,
"minor=0x%x
\n
"
,
p
);
if
((
*
off
+
count
)
>
maxsize
)
{
if
((
*
off
+
count
)
>
maxsize
)
{
// dev_warn(g_devfp_ptr,"%s:%d: Data (0x%x) does not fit into 0x%x bytes\n",__FILE__,__LINE__, (int) (*off+count), maxsize);
dev_dbg
(
g_devfp_ptr
,
"Data (0x%x) does not fit into 0x%x bytes, minor = 0x%x
\n
"
,(
int
)
(
*
off
+
count
),
maxsize
,
p
);
return
-
EOVERFLOW
;
...
...
src/include/uapi/elphel/x393_devices.h
View file @
7abbacd9
...
...
@@ -20,15 +20,14 @@
#define <DEVICE_RFEFERENCE> ("<dev path>", "<driver_name>", major, minor,"<permissions>","<b/c>") [optional comment]
* Access to individual fields is provide with the macros defined below, for example:
* DEV393_PATH(DEV393_EXIF_TEMPLATE) returns "/dev/exif_template,
* DEV393_MAJOR(DEV393_EXIF_TEMPLATE) returns 2 */
* DEV393_MAJOR(DEV393_EXIF_TEMPLATE) returns 2
* DO NOT COMMET OUT defines with // ! */
#define DEV393_EXIF_TEMPLATE ("exif_template", "exif_elphel", 125, 2, "0666", "c") ///< write Exif template
#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
///< 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_EXIF1 ("exif_exif1", "exif_elphel", 125, 17, "0666", "c") ///< sensor port 1: read encoded Exif data (SEEK_END)
...
...
@@ -46,11 +45,6 @@
#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_FRAMEPARS1 ("frameparsall1","framepars_operations",130,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap)
...
...
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