Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-camogm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-camogm
Commits
d28b8a87
Commit
d28b8a87
authored
Jun 23, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create JPEG file names from Exif data
parent
13e03a7d
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
387 additions
and
142 deletions
+387
-142
Doxyfile
Doxyfile
+1
-1
Makefile
Makefile
+2
-2
camogm.c
camogm.c
+8
-3
camogm.h
camogm.h
+23
-0
camogm_jpeg.c
camogm_jpeg.c
+19
-3
camogm_kml.c
camogm_kml.c
+3
-3
camogm_mov.c
camogm_mov.c
+3
-3
camogm_ogm.c
camogm_ogm.c
+3
-3
camogm_read.c
camogm_read.c
+301
-124
camogm_read.h
camogm_read.h
+24
-0
No files found.
Doxyfile
View file @
d28b8a87
...
...
@@ -714,7 +714,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED =
YES
WARN_IF_UNDOCUMENTED =
NO
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
...
...
Makefile
View file @
d28b8a87
...
...
@@ -17,9 +17,9 @@ PROGS = camogm
PHPFILES
=
camogmstate.php
SRCS
=
camogm.c camogm_ogm.c camogm_jpeg.c camogm_mov.c camogm_kml.c
SRCS
=
camogm.c camogm_ogm.c camogm_jpeg.c camogm_mov.c camogm_kml.c
camogm_read.c
OBJS
=
camogm.o camogm_ogm.o camogm_jpeg.o camogm_mov.o camogm_kml.o
OBJS
=
camogm.o camogm_ogm.o camogm_jpeg.o camogm_mov.o camogm_kml.o
camogm_read.o
CFLAGS
+=
-Wall
-I
$(ELPHEL_KERNEL_DIR)
/include/elphel
#CFLAGS += -Wall -I$(INCDIR) -I$(ELPHEL_KERNEL_DIR)/include/elphel
...
...
camogm.c
View file @
d28b8a87
...
...
@@ -123,16 +123,17 @@
#include <sys/mman.h>
/* mmap */
#include <sys/ioctl.h>
#include <c313a.h>
//
#include <c313a.h>
#include <exifa.h>
#include <asm/byteorder.h>
#include <ogg/ogg.h> // has to be before ogmstreams.h
#include "ogmstreams.h"
//
#include <ogg/ogg.h> // has to be before ogmstreams.h
//
#include "ogmstreams.h"
#include "camogm_ogm.h"
#include "camogm_jpeg.h"
#include "camogm_mov.h"
#include "camogm_kml.h"
#include "camogm_read.h"
#include "camogm.h"
#define COMMAND_LOOP_DELAY 500000 //0.5sec
...
...
@@ -1343,6 +1344,10 @@ int parse_cmd(camogm_state *state, FILE* npipe)
state
->
rawdev
.
rawdev_path
[
0
]
=
'\0'
;
}
return
28
;
}
else
if
(
strcmp
(
cmd
,
"rawdev_read"
)
==
0
)
{
if
(
state
->
rawdev_op
)
camogm_read
(
state
);
return
29
;
}
return
-
1
;
...
...
camogm.h
View file @
d28b8a87
...
...
@@ -32,6 +32,9 @@
//#include "camogm_exif.h"
#include <exifa.h>
#include <c313a.h>
#include <ogg/ogg.h> // has to be before ogmstreams.h
#include "ogmstreams.h" // move it to <>?
/*
...
...
@@ -78,6 +81,25 @@
/** @brief Maximum length of file or raw device path */
#define ELPHEL_PATH_MAX 300
/**
* @struct rawdev_buffer
* @brief Holds pointers related to raw device buffer operation
* @var rawdv_buffer::rawdev_fd
* File descriptor of open raw device
* @var rawdev_buffer::rawdev_path
* A string containing full path to raw device
* @var rawdev_buffer::overrun
* The number of times the buffer has overrun during current work session
* @var rawdev_buffer::start_pos
* The start position of raw device buffer
* @var rawdev_buffer::end_pos
* The end position of raw device buffer
* @var rawdev_buffer::curr_pos
* Current read position in raw device buffer
* @var rawdev_buffer::file_start
* Pointer to the beginning of current file. This pointer is set during raw device reading and
* updated every time new file is found.
*/
typedef
struct
{
int
rawdev_fd
;
char
rawdev_path
[
ELPHEL_PATH_MAX
];
...
...
@@ -85,6 +107,7 @@ typedef struct {
uint64_t
start_pos
;
uint64_t
end_pos
;
uint64_t
curr_pos
;
uint64_t
file_start
;
}
rawdev_buffer
;
typedef
struct
{
...
...
camogm_jpeg.c
View file @
d28b8a87
...
...
@@ -57,11 +57,11 @@
//#include <sys/mman.h> /* mmap */
//#include <sys/ioctl.h>
#include <c313a.h>
//
#include <c313a.h>
#include <asm/byteorder.h>
#include <ogg/ogg.h> // has to be before ogmstreams.h
#include "ogmstreams.h" // move it to <>?
//
#include <ogg/ogg.h> // has to be before ogmstreams.h
//
#include "ogmstreams.h" // move it to <>?
#include "camogm_jpeg.h"
...
...
@@ -119,6 +119,17 @@ int camogm_start_jpeg(camogm_state *state)
return
0
;
}
void
dump_chunk
(
struct
iovec
*
vec
)
{
unsigned
char
*
ptr
=
vec
->
iov_base
;
for
(
int
i
=
0
;
i
<
vec
->
iov_len
;
i
++
)
{
printf
(
"0x%02x "
,
ptr
[
i
]);
if
(
i
%
15
==
0
)
printf
(
"
\n
"
);
}
}
/**
* @brief Write single JPEG frame
*
...
...
@@ -144,6 +155,11 @@ int camogm_frame_jpeg(camogm_state *state)
l
+=
chunks_iovec
[
i
].
iov_len
;
}
printf
(
"0 chunk dump:
\n
"
);
dump_chunk
(
&
chunks_iovec
[
0
]);
printf
(
"1 chunk dump
\n
"
);
dump_chunk
(
&
chunks_iovec
[
1
]);
sprintf
(
state
->
path
,
"%s%010ld_%06ld.jpeg"
,
state
->
path_prefix
,
state
->
this_frame_params
[
port
].
timestamp_sec
,
state
->
this_frame_params
[
port
].
timestamp_usec
);
if
(((
state
->
ivf
=
open
(
state
->
path
,
O_RDWR
|
O_CREAT
,
0777
)))
<
0
)
{
D0
(
fprintf
(
debug_file
,
"Error opening %s for writing, returned %d, errno=%d
\n
"
,
state
->
path
,
state
->
ivf
,
errno
));
...
...
camogm_kml.c
View file @
d28b8a87
...
...
@@ -55,12 +55,12 @@
#include <sys/mman.h>
/* mmap */
#include <sys/ioctl.h>
#include <c313a.h>
//
#include <c313a.h>
#include <asm/byteorder.h>
#include <ogg/ogg.h> // has to be before ogmstreams.h
#include "ogmstreams.h" // move it to <>?
//
#include <ogg/ogg.h> // has to be before ogmstreams.h
//
#include "ogmstreams.h" // move it to <>?
#include "camogm_kml.h"
...
...
camogm_mov.c
View file @
d28b8a87
...
...
@@ -58,12 +58,12 @@
#include <sys/mman.h>
/* mmap */
#include <sys/ioctl.h>
#include <c313a.h>
//
#include <c313a.h>
#include <asm/byteorder.h>
#include <ogg/ogg.h> // has to be before ogmstreams.h
#include "ogmstreams.h" // move it to <>?
//
#include <ogg/ogg.h> // has to be before ogmstreams.h
//
#include "ogmstreams.h" // move it to <>?
#include "camogm_mov.h"
...
...
camogm_ogm.c
View file @
d28b8a87
...
...
@@ -51,11 +51,11 @@
#include <sys/mman.h>
/* mmap */
#include <sys/ioctl.h>
#include <c313a.h>
//
#include <c313a.h>
#include <asm/byteorder.h>
#include <ogg/ogg.h> // has to be before ogmstreams.h
#include "ogmstreams.h" // move it to <>?
//
#include <ogg/ogg.h> // has to be before ogmstreams.h
//
#include "ogmstreams.h" // move it to <>?
#include "camogm_ogm.h"
...
...
camogm_read.c
View file @
d28b8a87
This diff is collapsed.
Click to expand it.
camogm_read.h
0 → 100644
View file @
d28b8a87
/** @file camogm_read.h
* @brief Provides reading data written to raw device storage and saving the data to a device with file system.
* @copyright Copyright (C) 2016 Elphel, Inc.
*
* <b>License:</b>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOGM_READ_H
#define _CAMOGM_READ_H
#include "camogm.h"
int
camogm_read
(
camogm_state
*
state
);
#endif
/* _CAMOGM_READ_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