Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-astreamer
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-astreamer
Commits
e7b3122e
Commit
e7b3122e
authored
Feb 22, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update debug macros for streamer and video classes
parent
99103819
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
251 additions
and
229 deletions
+251
-229
main.cpp
src/main.cpp
+12
-4
parameters.h
src/parameters.h
+1
-0
streamer.cpp
src/streamer.cpp
+116
-108
video.cpp
src/video.cpp
+122
-117
No files found.
src/main.cpp
View file @
e7b3122e
...
...
@@ -38,11 +38,17 @@ using namespace std;
* @return None
*/
void
clean_up
(
pthread_t
*
threads
,
size_t
sz
)
{
for
(
size_t
i
=
0
;
i
<
sz
;
i
++
)
pthread_cancel
(
threads
[
i
]);
int
ret_val
;
for
(
size_t
i
=
0
;
i
<
sz
;
i
++
)
{
ret_val
=
pthread_cancel
(
threads
[
i
]);
if
(
!
ret_val
)
cout
<<
"pthread_cancel returned "
<<
ret_val
<<
", sensor port "
<<
i
<<
endl
;
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
ret_val
;
string
opt
;
map
<
string
,
string
>
args
;
pthread_t
threads
[
SENSOR_PORTS
];
...
...
@@ -72,8 +78,10 @@ int main(int argc, char *argv[]) {
streamers
[
i
]
=
new
Streamer
(
args
,
i
);
pthread_attr_init
(
&
attr
);
if
(
!
pthread_create
(
&
threads
[
i
],
&
attr
,
Streamer
::
pthread_f
,
(
void
*
)
streamers
[
i
]))
{
cerr
<<
"Can not spawn streamer thread for port "
<<
i
<<
endl
;
ret_val
=
pthread_create
(
&
threads
[
i
],
&
attr
,
Streamer
::
pthread_f
,
(
void
*
)
streamers
[
i
]);
if
(
ret_val
!=
0
)
{
cerr
<<
"Can not spawn streamer thread for port "
<<
i
;
cerr
<<
", pthread_create returned "
<<
ret_val
<<
endl
;
clean_up
(
threads
,
SENSOR_PORTS
);
exit
(
EXIT_FAILURE
);
}
...
...
src/parameters.h
View file @
e7b3122e
...
...
@@ -47,6 +47,7 @@ public:
off_t
lseek
(
off_t
offset
,
int
whence
)
{
return
::
lseek
(
fd_fparmsall
,
offset
,
whence
);
}
bool
daemon_enabled
(
void
);
void
setPValue
(
unsigned
long
*
val_array
,
int
count
);
inline
int
get_port_num
()
const
{
return
sensor_port
;}
protected
:
// static Parameters *_parameters;
...
...
src/streamer.cpp
View file @
e7b3122e
This diff is collapsed.
Click to expand it.
src/video.cpp
View file @
e7b3122e
This diff is collapsed.
Click to expand it.
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