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
4debbbaa
Commit
4debbbaa
authored
Jun 07, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change default settings
parent
13e75796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
camogm.c
camogm.c
+5
-6
camogm_jpeg.c
camogm_jpeg.c
+10
-6
No files found.
camogm.c
View file @
4debbbaa
...
...
@@ -173,8 +173,8 @@ struct framepars_all_t *frameParsAll[SENSOR_PORTS];
struct
framepars_t
*
framePars
[
SENSOR_PORTS
];
unsigned
long
*
globalPars
[
SENSOR_PORTS
];
/// parameters that are not frame-related, their changes do not initiate any actions
#define DEFAULT_DURATION 60
/*!default segment duration (seconds) */
#define DEFAULT_LENGTH 10
0000000
/*!default segment length (B) */
#define DEFAULT_DURATION 60
0
/*!default segment duration (seconds) */
#define DEFAULT_LENGTH 10
73741824
/*!default segment length (B) */
#define DEFAULT_GREEDY 0
/*!behavior for the files: 0 clean buffer, 1 - save as much as possible */
#define DEFAULT_IGNORE_FPS 0
/*!0 restartf file if fps changed, 1 - ignore variable fps (and skip less frames) */
...
...
@@ -183,7 +183,6 @@ unsigned long *globalPars[SENSOR_PORTS]; /// parameters that are not
#define DEFAULT_FRAMES 16384
/* Maximal number of frames in file segment (each need 4* (1 + 1/frames_per_chunk) bytes for the frame index */
#define DEFAULT_FRAMES_PER_CHUNK 10
/*second sparse index - for Quicktime fast forward */
#define DEFAULT_LENGTH 100000000
/*!default segment length (B) */
#define DEFAULT_EXIF 1
/* use Exif */
static
char
cmdbuf
[
1024
];
...
...
@@ -304,7 +303,7 @@ void camogm_init(camogm_state *state, unsigned int port, char *pipe_name)
strcpy
(
state
->
debug_name
,
"stderr"
);
camogm_set_timescale
(
state
,
1
.
0
);
camogm_set_frames_skip
(
state
,
0
);
// don't skip
camogm_set_format
(
state
,
CAMOGM_FORMAT_
OGM
);
camogm_set_format
(
state
,
CAMOGM_FORMAT_
MOV
);
state
->
exifSize
=
0
;
state
->
exif
=
DEFAULT_EXIF
;
state
->
frame_lengths
=
NULL
;
...
...
@@ -969,7 +968,7 @@ void camogm_status(camogm_state *state, char * fn, int xml)
"other"
)))
:
"none"
;
_using_exif
=
state
->
exif
?
"yes"
:
"no"
;
_using_global_pointer
=
state
->
save_gp
?
"yes"
:
"no"
;
_compressor_state
=
(
getGPValue
(
state
->
port_num
,
P_COMPRESSOR_RUN
)
==
2
)
?
"running"
:
"stopp
p
ed"
;
_compressor_state
=
(
getGPValue
(
state
->
port_num
,
P_COMPRESSOR_RUN
)
==
2
)
?
"running"
:
"stopped"
;
if
(
state
->
frames_skip
>
0
)
{
_frames_remain
=
state
->
frames_skip_left
;
_frames_skip
=
state
->
frames_skip
;
...
...
@@ -1538,7 +1537,7 @@ int listener_loop(camogm_state *state)
/**
* @brief Return disk size in bytes
*
* This function reads disk size using ioctl call.
* This function reads disk size using ioctl call
and returns it in bytes
.
* @param name pointer to disk name string
* @return disk size in bytes if it was read correctly and 0 otherwise
*/
...
...
camogm_jpeg.c
View file @
4debbbaa
...
...
@@ -69,10 +69,10 @@
/** @brief Size of iovec structures holding data to be written */
#define IOVEC_SIZE 10
/** @brief
Start of file marker, contains "elphelst
" string in ASCII symbols */
const
unsigned
char
elphelst
[]
=
{
0x
65
,
0x6c
,
0x70
,
0x68
,
0x65
,
0x6c
,
0x73
,
0x74
};
/** @brief
End of file marker, contains "elphelen
" string in ASCII symbols */
const
unsigned
char
elphelen
[]
=
{
0x65
,
0x6
c
,
0x70
,
0x68
,
0x65
,
0x6c
,
0x65
,
0x6e
};
/** @brief
File starting marker, contains "stelphel
" string in ASCII symbols */
const
unsigned
char
elphelst
[]
=
{
0x
73
,
0x74
,
0x65
,
0x6c
,
0x70
,
0x68
,
0x65
,
0x6c
};
/** @brief
File ending marker, contains "enelphel
" string in ASCII symbols */
const
unsigned
char
elphelen
[]
=
{
0x65
,
0x6
e
,
0x65
,
0x6c
,
0x70
,
0x68
,
0x65
,
0x6c
};
static
struct
iovec
start_marker
=
{
.
iov_base
=
elphelst
,
.
iov_len
=
sizeof
(
elphelst
)
...
...
@@ -173,6 +173,8 @@ int camogm_frame_jpeg(camogm_state *state)
}
}
chunks_iovec
[
0
]
=
start_marker
;
l
+=
start_marker
.
iov_len
;
chunks_used
++
;
for
(
int
i
=
1
;
i
<
chunks_used
;
i
++
)
{
if
(
i
==
split_index
)
{
// one of the chunks rolls over the end of the raw storage, split it into two segments and
...
...
@@ -193,9 +195,11 @@ int camogm_frame_jpeg(camogm_state *state)
l
+=
chunks_iovec
[
i
].
iov_len
;
}
}
assert
(
chunks_used
<
IOVEC_SIZE
);
// consider start_marker here and increment chunks_used
chunks_iovec
[
chunks_used
++
]
=
end_marker
;
assert
(
chunks_used
<
IOVEC_SIZE
);
chunks_iovec
[
chunks_used
]
=
end_marker
;
l
+=
end_marker
.
iov_len
;
chunks_used
++
;
/* debug code follows */
fprintf
(
debug_file
,
"
\n
=== raw device write, iovec dump ===
\n
"
);
...
...
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