|
a/sc2src/rcvqueue.h |
|
b/sc2src/rcvqueue.h |
|
... |
|
... |
73 |
class AudioEater {
|
73 |
class AudioEater {
|
74 |
public:
|
74 |
public:
|
75 |
enum BOrder {BO_MSB, BO_LSB, BO_HOST};
|
75 |
enum BOrder {BO_MSB, BO_LSB, BO_HOST};
|
76 |
struct Context {
|
76 |
struct Context {
|
77 |
Context(WorkQueue<AudioMessage*> *q) : queue(q) {}
|
77 |
Context(WorkQueue<AudioMessage*> *q) : queue(q) {}
|
78 |
WorkQueue<AudioMessage*> *queue;
|
78 |
WorkQueue<AudioMessage*> *queue{nullptr};
|
79 |
ConfSimple *config;
|
79 |
ConfSimple *config{nullptr};
|
80 |
};
|
80 |
};
|
81 |
|
81 |
|
82 |
// Constructor called by downstream module to set its params
|
82 |
// Constructor called by downstream module to set its params
|
83 |
AudioEater(BOrder o, void *(*w)(void *))
|
83 |
AudioEater(BOrder o, void *(*w)(void *))
|
84 |
: input_border(o), worker(w) {
|
84 |
: input_border(o), worker(w) {
|
|
... |
|
... |
86 |
|
86 |
|
87 |
BOrder input_border;
|
87 |
BOrder input_border;
|
88 |
/** Worker routine for fetching bufs from the rcvqueue and sending them
|
88 |
/** Worker routine for fetching bufs from the rcvqueue and sending them
|
89 |
* further. The param is actually an AudioEater::Context */
|
89 |
* further. The param is actually an AudioEater::Context */
|
90 |
void *(*worker)(void *);
|
90 |
void *(*worker)(void *);
|
|
|
91 |
|
|
|
92 |
/** Packet counter. This is only used from the watcher thread to
|
|
|
93 |
detect activity/inactivity, by polling every few seconds, so no
|
|
|
94 |
need to guard against wraparounds */
|
|
|
95 |
unsigned int pktcounter{0};
|
91 |
};
|
96 |
};
|
92 |
|
97 |
|
93 |
extern void copyswap(unsigned char *dest, const unsigned char *src,
|
98 |
extern void copyswap(unsigned char *dest, const unsigned char *src,
|
94 |
unsigned int bytes, unsigned int bits);
|
99 |
unsigned int bytes, unsigned int bits);
|
95 |
|
100 |
|
96 |
extern AudioEater httpAudioEater;
|
101 |
extern AudioEater httpAudioEater;
|
97 |
extern AudioEater alsaAudioEater;
|
102 |
extern AudioEater alsaAudioEater;
|
|
|
103 |
/* Used by the watcher to close alsa on inactivity if configured to do
|
|
|
104 |
so. The watcher is only used with alsadirect, and we should move
|
|
|
105 |
this to alsadirect.h (if it existed...) */
|
|
|
106 |
extern void alsa_close();
|
|
|
107 |
|
|
|
108 |
extern bool g_quitrequest;
|
98 |
|
109 |
|
99 |
#endif /* _RCVQUEUE_H_INCLUDED_ */
|
110 |
#endif /* _RCVQUEUE_H_INCLUDED_ */
|