| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifndef _DSP_PROTOCOL_H |
| 24 |
#define _DSP_PROTOCOL_H |
| 25 |
|
| 26 |
#define __USE_GNU |
| 27 |
#include <features.h> |
| 28 |
#include <pthread.h> |
| 29 |
#include <semaphore.h> |
| 30 |
#include "types.h" |
| 31 |
|
| 32 |
#ifdef HAVE_CONFIG_H |
| 33 |
#include <config.h> |
| 34 |
#endif |
| 35 |
|
| 36 |
|
| 37 |
typedef struct { |
| 38 |
int fd; |
| 39 |
char *device; |
| 40 |
int state; |
| 41 |
int mute; |
| 42 |
unsigned int stream_id; |
| 43 |
unsigned int bridge_buffer_size; |
| 44 |
unsigned int mmap_buffer_size; |
| 45 |
short int *mmap_buffer; |
| 46 |
pthread_mutex_t mutex; |
| 47 |
int sem_set_id; |
| 48 |
#ifdef USE_RESOURCE_MANAGER |
| 49 |
void *dbus_connection; |
| 50 |
#endif |
| 51 |
} dsp_protocol_t; |
| 52 |
|
| 53 |
int dsp_protocol_create(dsp_protocol_t ** dsp_protocol); |
| 54 |
int dsp_protocol_open_node(dsp_protocol_t * dsp_protocol, const char *device); |
| 55 |
int dsp_protocol_send_audio_params(dsp_protocol_t * dsp_protocol, |
| 56 |
audio_params_data_t * audio_params_data); |
| 57 |
int dsp_protocol_send_speech_params(dsp_protocol_t * dsp_protocol, |
| 58 |
speech_params_data_t * audio_params_data); |
| 59 |
|
| 60 |
|
| 61 |
int dsp_protocol_send_play(dsp_protocol_t * dsp_protocol); |
| 62 |
int dsp_protocol_send_audio_data(dsp_protocol_t * dsp_protocol, |
| 63 |
void *data, unsigned short int count); |
| 64 |
int dsp_protocol_receive_audio_data(dsp_protocol_t * dsp_protocol, |
| 65 |
void *data, int count); |
| 66 |
|
| 67 |
int dsp_protocol_send_pause(dsp_protocol_t * dsp_protocol); |
| 68 |
int dsp_protocol_send_stop(dsp_protocol_t * dsp_protocol); |
| 69 |
|
| 70 |
|
| 71 |
int dsp_protocol_close_node(dsp_protocol_t * dsp_protocol); |
| 72 |
int dsp_protocol_destroy(dsp_protocol_t ** dsp_protocol); |
| 73 |
|
| 74 |
|
| 75 |
int dsp_protocol_set_volume(dsp_protocol_t * dsp_protocol, |
| 76 |
unsigned char left, unsigned char right); |
| 77 |
int dsp_protocol_get_volume(dsp_protocol_t * dsp_protocol, |
| 78 |
unsigned char *left, unsigned char *right); |
| 79 |
int dsp_protocol_set_mute(dsp_protocol_t * dsp_protocol, unsigned char mute); |
| 80 |
int dsp_protocol_get_mute(dsp_protocol_t * dsp_protocol); |
| 81 |
|
| 82 |
|
| 83 |
int dsp_protocol_set_mic_enabled(dsp_protocol_t * dsp_protocol, int enabled); |
| 84 |
int dsp_protocol_probe_node(dsp_protocol_t * dsp_protocol, const char *device); |
| 85 |
int safe_strtol(const char *str, long *val); |
| 86 |
|
| 87 |
#endif |