Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GStreamer_audioRecorder
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
m3
GStreamer_audioRecorder
Commits
b0b7b6bc
Commit
b0b7b6bc
authored
Oct 02, 2017
by
d.basulto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change some debug messages
parent
b8dc7be7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
StreamRecorder.cpp
StreamRecorder.cpp
+14
-18
StreamRecorder.h
StreamRecorder.h
+1
-0
No files found.
StreamRecorder.cpp
View file @
b0b7b6bc
...
@@ -183,9 +183,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
...
@@ -183,9 +183,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
if
(((
StreamRecorder
*
)
user_data
)
->
isConnectionLost
)
//Enter only if the connection is lost
if
(((
StreamRecorder
*
)
user_data
)
->
isConnectionLost
)
//Enter only if the connection is lost
{
{
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
long
int
actualRecordTime
;
long
int
actualRecordTime
;
long
int
currentTime
=
time
(
NULL
);
long
int
currentTime
=
time
(
NULL
);
long
int
addTime
;
long
int
addTime
;
...
@@ -195,7 +193,6 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
...
@@ -195,7 +193,6 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
//cout << "Actual time (timestamp): " << currentTime << endl;
//cout << "Actual time (timestamp): " << currentTime << endl;
actualRecordTime
=
currentTime
-
((
StreamRecorder
*
)
user_data
)
->
timestamp
;
actualRecordTime
=
currentTime
-
((
StreamRecorder
*
)
user_data
)
->
timestamp
;
cout
<<
"Record time: "
<<
actualRecordTime
<<
endl
;
cout
<<
"Record time: "
<<
actualRecordTime
<<
endl
;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
/** The calculated record time is greater? */
/** The calculated record time is greater? */
...
@@ -229,7 +226,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
...
@@ -229,7 +226,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
((
StreamRecorder
*
)
user_data
)
->
isConnectionLost
=
false
;
((
StreamRecorder
*
)
user_data
)
->
isConnectionLost
=
false
;
/** Try reconnect with the radio stream*/
/** Try reconnect with the radio stream*/
g_timeout_add
(
1
*
1000
,
reconnectURIStream
,
user_data
);
g_timeout_add
(
RECONNECTION_DELAY
*
1000
,
reconnectURIStream
,
user_data
);
}
}
break
;
break
;
...
@@ -256,20 +253,19 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
...
@@ -256,20 +253,19 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
/** Not audio stream received */
/** Not audio stream received */
if
(((
StreamRecorder
*
)
user_data
)
->
timestamp
==
0
)
if
(((
StreamRecorder
*
)
user_data
)
->
timestamp
==
0
)
{
{
g_timeout_add
(
1
*
1000
,
reconnectURIStream
,
user_data
);
g_timeout_add
(
RECONNECTION_DELAY
*
1000
,
reconnectURIStream
,
user_data
);
}
}
else
else
{
{
// ----------------------------------------------------------------------------------------
long
int
actualRecordTime
;
long
int
currentTime
=
time
(
NULL
);
//long int addTime;
long
int
bytesToAdd
;
long
int
actualRecordTime
;
long
int
currentTime
=
time
(
NULL
);
long
int
addTime
;
cout
<<
"Actual time (timestamp): "
<<
currentTime
<<
endl
;
actualRecordTime
=
currentTime
-
((
StreamRecorder
*
)
user_data
)
->
timestamp
;
actualRecordTime
=
currentTime
-
((
StreamRecorder
*
)
user_data
)
->
timestamp
;
cout
<<
"Record time: "
<<
actualRecordTime
<<
endl
;
cout
<<
"Record time: "
<<
actualRecordTime
<<
endl
;
// ----------------------------------------------------------------------------------------
/** Record time is greater than th required */
/** Record time is greater than th required */
if
(
actualRecordTime
>=
((
StreamRecorder
*
)
user_data
)
->
audioFileDuration
)
if
(
actualRecordTime
>=
((
StreamRecorder
*
)
user_data
)
->
audioFileDuration
)
...
@@ -279,12 +275,12 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
...
@@ -279,12 +275,12 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
}
}
else
else
{
{
/** Moves the pointer to the position corresponding to the difference of the timestamps */
/** Moves the pointer to the position corresponding to the difference of the timestamps */
addTime
=
currentTime
-
((
StreamRecorder
*
)
user_data
)
->
oldTmpTimestamp
;
//
addTime = currentTime - ((StreamRecorder *) user_data)->oldTmpTimestamp;
cout
<<
"Time to add: "
<<
1
<<
endl
;
cout
<<
"Time to add: "
<<
1
<<
endl
;
long
int
bytesToAdd
=
1
*
READSIZE
*
STREAMRECORDER_BYTESPERSAMPLE
*
10
;
bytesToAdd
=
1
*
READSIZE
*
STREAMRECORDER_BYTESPERSAMPLE
*
10
;
cout
<<
"-------------------------------------"
<<
endl
;
cout
<<
"-------------------------------------"
<<
endl
;
cout
<<
"Actual Bytes number: "
<<
"("
<<
((
StreamRecorder
*
)
user_data
)
->
nBytes
<<
") + "
;
cout
<<
"Actual Bytes number: "
<<
"("
<<
((
StreamRecorder
*
)
user_data
)
->
nBytes
<<
") + "
;
...
@@ -303,7 +299,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
...
@@ -303,7 +299,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
((
StreamRecorder
*
)
user_data
)
->
isConnectionLost
=
false
;
((
StreamRecorder
*
)
user_data
)
->
isConnectionLost
=
false
;
/** Try reconnect with the radio stream*/
/** Try reconnect with the radio stream*/
g_timeout_add
(
1
*
1000
,
reconnectURIStream
,
user_data
);
g_timeout_add
(
RECONNECTION_DELAY
*
1000
,
reconnectURIStream
,
user_data
);
}
}
}
}
...
...
StreamRecorder.h
View file @
b0b7b6bc
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#define ERROR_MSG_SIZE 50
#define ERROR_MSG_SIZE 50
#define DST_URI_SIZE 80
#define DST_URI_SIZE 80
#define RECONNECTION_DELAY 1
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
...
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