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
54b616c4
Commit
54b616c4
authored
Oct 18, 2017
by
d.basulto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add code format
parent
6f71c5b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
StreamRecorder.cpp
StreamRecorder.cpp
+12
-3
No files found.
StreamRecorder.cpp
View file @
54b616c4
...
...
@@ -32,6 +32,7 @@ using namespace std;
* @param source streaming url
* @param time split recording in segments of time seconds.
*/
StreamRecorder
::
StreamRecorder
(
const
char
*
source
,
int
time
)
{
...
...
@@ -60,9 +61,9 @@ StreamRecorder::StreamRecorder(const char* source, int time)
/**
* Connect to the stream
* @param uri streaing uri
* @return unimplemented
* @return 0 if success
*/
int
StreamRecorder
::
connect
()
{
disconnect
();
...
...
@@ -81,8 +82,9 @@ int StreamRecorder::connect()
/**
* disconnect from the stream
* @return
unimplemented
* @return
0 if success
*/
int
StreamRecorder
::
disconnect
()
{
gst_element_unlink
(
streamSrc
,
audioConvert
);
...
...
@@ -96,6 +98,7 @@ int StreamRecorder::disconnect()
* Create main pipeline
* @return 0 on success else on error
*/
int
StreamRecorder
::
createMainPipeline
()
{
mainPipeline
=
gst_pipeline_new
(
"stream-recorder"
);
...
...
@@ -152,6 +155,7 @@ int StreamRecorder::createMainPipeline()
* @param class instance
* @return False if an error occurs
*/
gboolean
StreamRecorder
::
reconnectURIStream
(
void
*
instance
)
{
cout
<<
"Trying to reconnect with the stream..."
<<
endl
<<
endl
;
...
...
@@ -239,12 +243,14 @@ void StreamRecorder::saveBuffer()
}
//------------------------------------------------------------------------------
/**
* CallBack to link the pads created by uridecodebin
* @param element The uridecodebin element
* @param pad The pad added
* @param data this
*/
void
StreamRecorder
::
srcNewPad_callback
(
GstElement
*
element
,
GstPad
*
pad
,
void
*
data
)
{
...
...
@@ -339,12 +345,14 @@ int StreamRecorder::filter_handoff_callback(GstElement* filter, GstBuffer* buffe
}
//------------------------------------------------------------------------------
/**
* Add audio data to audioBuffer
* @param data Audio data to add
* @param length Data length
* @return Bytes writen
*/
int
StreamRecorder
::
addToBuffer
(
unsigned
char
*
data
,
int
length
)
{
...
...
@@ -399,6 +407,7 @@ int StreamRecorder::addToBuffer(unsigned char* data, int length)
* Save audio data (audioBuffer) in flac format
* @return unimplemented
*/
int
StreamRecorder
::
compressBuffer
()
{
...
...
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