2
* @file dsp-protocol.h - Definition of functions whose represents
3
* an interface to the DSP PCM Task node protocol.
5
* Copyright (C) 2006 Nokia Corporation
7
* Contact: Eduardo Bezerra Valentin <eduardo.valentin@indt.org.br>
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Library General Public
11
* License as published by the Free Software Foundation; either
12
* version 2 of the License, or (at your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Library General Public License for more details.
19
* You should have received a copy of the GNU Library General Public
20
* License along with this library; if not, write to the
21
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
* Boston, MA 02111-1307, USA.
24
#ifndef _DSP_PROTOCOL_H
25
#define _DSP_PROTOCOL_H
30
#include <semaphore.h>
43
unsigned int stream_id;
44
unsigned int bridge_buffer_size; /* in bytes */
45
unsigned int mmap_buffer_size; /* in bytes */
46
short int *mmap_buffer;
47
pthread_mutex_t mutex;
49
#ifdef USE_RESOURCE_MANAGER
50
void *dbus_connection;
53
/* Initialisation phase */
54
int dsp_protocol_create(dsp_protocol_t ** dsp_protocol);
55
int dsp_protocol_open_node(dsp_protocol_t * dsp_protocol, const char *device);
56
int dsp_protocol_send_audio_params(dsp_protocol_t * dsp_protocol,
57
audio_params_data_t * audio_params_data);
58
int dsp_protocol_send_speech_params(dsp_protocol_t * dsp_protocol,
59
speech_params_data_t * audio_params_data);
62
int dsp_protocol_send_play(dsp_protocol_t * dsp_protocol);
63
int dsp_protocol_send_audio_data(dsp_protocol_t * dsp_protocol,
64
void *data, unsigned short int count);
65
int dsp_protocol_receive_audio_data(dsp_protocol_t * dsp_protocol,
66
void *data, int count);
68
int dsp_protocol_send_pause(dsp_protocol_t * dsp_protocol);
69
int dsp_protocol_send_stop(dsp_protocol_t * dsp_protocol);
72
int dsp_protocol_close_node(dsp_protocol_t * dsp_protocol);
73
int dsp_protocol_destroy(dsp_protocol_t ** dsp_protocol);
76
int dsp_protocol_set_volume(dsp_protocol_t * dsp_protocol,
77
unsigned char left, unsigned char right);
78
int dsp_protocol_get_volume(dsp_protocol_t * dsp_protocol,
79
unsigned char *left, unsigned char *right);
80
int dsp_protocol_set_mute(dsp_protocol_t * dsp_protocol, unsigned char mute);
81
int dsp_protocol_get_mute(dsp_protocol_t * dsp_protocol);
84
int dsp_protocol_set_mic_enabled(dsp_protocol_t * dsp_protocol, int enabled);
85
int dsp_protocol_probe_node(dsp_protocol_t * dsp_protocol, const char *device);
86
int safe_strtol(const char *str, long *val);
88
#endif /* _DSP_PROTOCOL_H */