Commit 1503550d authored by Mikhail Karpenko's avatar Mikhail Karpenko

WIP: compile audio interface without errors

parent f14bec39
/**
* @file FILENAME
* @brief BRIEF DESCRIPTION
* @copyright Copyright (C) YEAR Elphel Inc.
* @file audio.cpp
* @brief Provides audio interface for streamer
* @copyright Copyright (C) 2017 Elphel Inc.
* @author AUTHOR <EMAIL>
*
* @par License:
......@@ -27,10 +27,6 @@
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <asm/elphel/c313a.h>
#include "parameters.h"
#undef AUDIO_DEBUG
//#define AUDIO_DEBUG
#undef AUDIO_DEBUG_2
......@@ -54,12 +50,13 @@
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;
snd_pcm_hw_params_t *hw_params;
snd_pcm_sw_params_t *sw_params;
_present = false;
stream_name = "audio";
params = pars;
// normalize audio settings
if(sample_rate == 0) sample_rate = SAMPLE_RATE;
......@@ -216,7 +213,7 @@ D( cerr << "Audio ---> Start !!!" << endl;)
//cerr << "Audio ---> Start !!! - done" << endl;
// get FPGA/sys time delta
Parameters *params = Parameters::instance();
// Parameters *params = Parameters::instance();
unsigned long write_data[6];
write_data[0] = FRAMEPARS_GETFPGATIME;
write_data[1] = 0;
......
/**
* @file FILENAME
* @brief BRIEF DESCRIPTION
* @copyright Copyright (C) YEAR Elphel Inc.
* @file audio.h
* @brief Provides audio interface for streamer
* @copyright Copyright (C) 2017 Elphel Inc.
* @author AUTHOR <EMAIL>
*
* @par License:
......@@ -23,10 +23,15 @@
#define _AUDIO__H_
#include <string>
#ifdef __cplusplus
#undef __cplusplus
#endif
#define __cplusplus 1
#include <alsa/asoundlib.h>
#include <pthread.h>
#include "rtp_stream.h"
#include "parameters.h"
using namespace std;
......@@ -35,7 +40,7 @@ using namespace std;
class Audio : public RTP_Stream {
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);
long sample_rate(void) { return _sample_rate; };
long channels(void) { return _channels; };
......@@ -61,11 +66,9 @@ protected:
void set_capture_volume(int volume);
uint64_t timestamp_rtcp;
long delta_fpga_sys; // A/V clocks delta for RTCP
bool is_first;
bool is_first2;
long delta_fpga_sys; // A/V clocks delta for RTCP
bool is_first;
bool is_first2;
};
//extern Audio *audio;
#endif // _AUDIO__H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment