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
1503550d
Commit
1503550d
authored
Feb 21, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: compile audio interface without errors
parent
f14bec39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
audio.cpp
src/audio.cpp
+6
-9
audio.h
src/audio.h
+12
-9
No files found.
src/audio.cpp
View file @
1503550d
/**
/**
* @file
FILENAME
* @file
audio.cpp
* @brief
BRIEF DESCRIPTION
* @brief
Provides audio interface for streamer
* @copyright Copyright (C)
YEAR
Elphel Inc.
* @copyright Copyright (C)
2017
Elphel Inc.
* @author AUTHOR <EMAIL>
* @author AUTHOR <EMAIL>
*
*
* @par License:
* @par License:
...
@@ -27,10 +27,6 @@
...
@@ -27,10 +27,6 @@
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <asm/elphel/c313a.h>
#include "parameters.h"
#undef AUDIO_DEBUG
#undef AUDIO_DEBUG
//#define AUDIO_DEBUG
//#define AUDIO_DEBUG
#undef AUDIO_DEBUG_2
#undef AUDIO_DEBUG_2
...
@@ -54,12 +50,13 @@
...
@@ -54,12 +50,13 @@
using
namespace
std
;
using
namespace
std
;
Audio
::
Audio
(
bool
enable
,
int
sample_rate
,
int
channels
)
{
Audio
::
Audio
(
bool
enable
,
Parameters
*
pars
,
int
sample_rate
,
int
channels
)
{
//cerr << "Audio::Audio()" << endl;
//cerr << "Audio::Audio()" << endl;
snd_pcm_hw_params_t
*
hw_params
;
snd_pcm_hw_params_t
*
hw_params
;
snd_pcm_sw_params_t
*
sw_params
;
snd_pcm_sw_params_t
*
sw_params
;
_present
=
false
;
_present
=
false
;
stream_name
=
"audio"
;
stream_name
=
"audio"
;
params
=
pars
;
// normalize audio settings
// normalize audio settings
if
(
sample_rate
==
0
)
sample_rate
=
SAMPLE_RATE
;
if
(
sample_rate
==
0
)
sample_rate
=
SAMPLE_RATE
;
...
@@ -216,7 +213,7 @@ D( cerr << "Audio ---> Start !!!" << endl;)
...
@@ -216,7 +213,7 @@ D( cerr << "Audio ---> Start !!!" << endl;)
//cerr << "Audio ---> Start !!! - done" << endl;
//cerr << "Audio ---> Start !!! - done" << endl;
// get FPGA/sys time delta
// get FPGA/sys time delta
Parameters
*
params
=
Parameters
::
instance
();
//
Parameters *params = Parameters::instance();
unsigned
long
write_data
[
6
];
unsigned
long
write_data
[
6
];
write_data
[
0
]
=
FRAMEPARS_GETFPGATIME
;
write_data
[
0
]
=
FRAMEPARS_GETFPGATIME
;
write_data
[
1
]
=
0
;
write_data
[
1
]
=
0
;
...
...
src/audio.h
View file @
1503550d
/**
/**
* @file
FILENAME
* @file
audio.h
* @brief
BRIEF DESCRIPTION
* @brief
Provides audio interface for streamer
* @copyright Copyright (C)
YEAR
Elphel Inc.
* @copyright Copyright (C)
2017
Elphel Inc.
* @author AUTHOR <EMAIL>
* @author AUTHOR <EMAIL>
*
*
* @par License:
* @par License:
...
@@ -23,10 +23,15 @@
...
@@ -23,10 +23,15 @@
#define _AUDIO__H_
#define _AUDIO__H_
#include <string>
#include <string>
#ifdef __cplusplus
#undef __cplusplus
#endif
#define __cplusplus 1
#define __cplusplus 1
#include <alsa/asoundlib.h>
#include <alsa/asoundlib.h>
#include <pthread.h>
#include <pthread.h>
#include "rtp_stream.h"
#include "rtp_stream.h"
#include "parameters.h"
using
namespace
std
;
using
namespace
std
;
...
@@ -35,7 +40,7 @@ using namespace std;
...
@@ -35,7 +40,7 @@ using namespace std;
class
Audio
:
public
RTP_Stream
{
class
Audio
:
public
RTP_Stream
{
public
:
public
:
Audio
(
bool
enable
,
int
sample_rate
=
SAMPLE_RATE
,
int
channels
=
SAMPLE_CHANNELS
);
Audio
(
bool
enable
,
Parameters
*
pars
,
int
sample_rate
=
SAMPLE_RATE
,
int
channels
=
SAMPLE_CHANNELS
);
virtual
~
Audio
(
void
);
virtual
~
Audio
(
void
);
long
sample_rate
(
void
)
{
return
_sample_rate
;
};
long
sample_rate
(
void
)
{
return
_sample_rate
;
};
long
channels
(
void
)
{
return
_channels
;
};
long
channels
(
void
)
{
return
_channels
;
};
...
@@ -61,11 +66,9 @@ protected:
...
@@ -61,11 +66,9 @@ protected:
void
set_capture_volume
(
int
volume
);
void
set_capture_volume
(
int
volume
);
uint64_t
timestamp_rtcp
;
uint64_t
timestamp_rtcp
;
long
delta_fpga_sys
;
// A/V clocks delta for RTCP
long
delta_fpga_sys
;
// A/V clocks delta for RTCP
bool
is_first
;
bool
is_first
;
bool
is_first2
;
bool
is_first2
;
};
};
//extern Audio *audio;
#endif // _AUDIO__H_
#endif // _AUDIO__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