|
Packit |
675970 |
/**
|
|
Packit |
675970 |
* @file dsp-protocol.h - Definition of functions whose represents
|
|
Packit |
675970 |
* an interface to the DSP PCM Task node protocol.
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* Copyright (C) 2006 Nokia Corporation
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* Contact: Eduardo Bezerra Valentin <eduardo.valentin@indt.org.br>
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
675970 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
675970 |
* License as published by the Free Software Foundation; either
|
|
Packit |
675970 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
675970 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
675970 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
675970 |
* Library General Public License for more details.
|
|
Packit |
675970 |
*
|
|
Packit |
675970 |
* You should have received a copy of the GNU Library General Public License
|
|
Packit |
675970 |
* along with this program; if not, write to the Free Software
|
|
Packit |
675970 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit |
675970 |
* */
|
|
Packit |
675970 |
#ifndef _DSP_PROTOCOL_H
|
|
Packit |
675970 |
#define _DSP_PROTOCOL_H
|
|
Packit |
675970 |
|
|
Packit |
675970 |
#define __USE_GNU
|
|
Packit |
675970 |
#include <features.h>
|
|
Packit |
675970 |
#include <pthread.h>
|
|
Packit |
675970 |
#include <semaphore.h>
|
|
Packit |
675970 |
#include "types.h"
|
|
Packit |
675970 |
|
|
Packit |
675970 |
#ifdef HAVE_CONFIG_H
|
|
Packit |
675970 |
#include <config.h>
|
|
Packit |
675970 |
#endif
|
|
Packit |
675970 |
|
|
Packit |
675970 |
|
|
Packit |
675970 |
typedef struct {
|
|
Packit |
675970 |
int fd;
|
|
Packit |
675970 |
char *device;
|
|
Packit |
675970 |
int state;
|
|
Packit |
675970 |
int mute;
|
|
Packit |
675970 |
unsigned int stream_id;
|
|
Packit |
675970 |
unsigned int bridge_buffer_size; /* in bytes */
|
|
Packit |
675970 |
unsigned int mmap_buffer_size; /* in bytes */
|
|
Packit |
675970 |
short int *mmap_buffer;
|
|
Packit |
675970 |
pthread_mutex_t mutex;
|
|
Packit |
675970 |
int sem_set_id;
|
|
Packit |
675970 |
#ifdef USE_RESOURCE_MANAGER
|
|
Packit |
675970 |
void *dbus_connection;
|
|
Packit |
675970 |
#endif
|
|
Packit |
675970 |
} dsp_protocol_t;
|
|
Packit |
675970 |
/* Initialisation phase */
|
|
Packit |
675970 |
int dsp_protocol_create(dsp_protocol_t ** dsp_protocol);
|
|
Packit |
675970 |
int dsp_protocol_open_node(dsp_protocol_t * dsp_protocol, const char *device);
|
|
Packit |
675970 |
int dsp_protocol_send_audio_params(dsp_protocol_t * dsp_protocol,
|
|
Packit |
675970 |
audio_params_data_t * audio_params_data);
|
|
Packit |
675970 |
int dsp_protocol_send_speech_params(dsp_protocol_t * dsp_protocol,
|
|
Packit |
675970 |
speech_params_data_t * audio_params_data);
|
|
Packit |
675970 |
|
|
Packit |
675970 |
/* Execution phase */
|
|
Packit |
675970 |
int dsp_protocol_send_play(dsp_protocol_t * dsp_protocol);
|
|
Packit |
675970 |
int dsp_protocol_send_audio_data(dsp_protocol_t * dsp_protocol,
|
|
Packit |
675970 |
void *data, unsigned short int count);
|
|
Packit |
675970 |
int dsp_protocol_receive_audio_data(dsp_protocol_t * dsp_protocol,
|
|
Packit |
675970 |
void *data, int count);
|
|
Packit |
675970 |
|
|
Packit |
675970 |
int dsp_protocol_send_pause(dsp_protocol_t * dsp_protocol);
|
|
Packit |
675970 |
int dsp_protocol_send_stop(dsp_protocol_t * dsp_protocol);
|
|
Packit |
675970 |
|
|
Packit |
675970 |
/* Deletion phase */
|
|
Packit |
675970 |
int dsp_protocol_close_node(dsp_protocol_t * dsp_protocol);
|
|
Packit |
675970 |
int dsp_protocol_destroy(dsp_protocol_t ** dsp_protocol);
|
|
Packit |
675970 |
|
|
Packit |
675970 |
/* controls */
|
|
Packit |
675970 |
int dsp_protocol_set_volume(dsp_protocol_t * dsp_protocol,
|
|
Packit |
675970 |
unsigned char left, unsigned char right);
|
|
Packit |
675970 |
int dsp_protocol_get_volume(dsp_protocol_t * dsp_protocol,
|
|
Packit |
675970 |
unsigned char *left, unsigned char *right);
|
|
Packit |
675970 |
int dsp_protocol_set_mute(dsp_protocol_t * dsp_protocol, unsigned char mute);
|
|
Packit |
675970 |
int dsp_protocol_get_mute(dsp_protocol_t * dsp_protocol);
|
|
Packit |
675970 |
|
|
Packit |
675970 |
/*miscelaneos*/
|
|
Packit |
675970 |
int dsp_protocol_set_mic_enabled(dsp_protocol_t * dsp_protocol, int enabled);
|
|
Packit |
675970 |
int dsp_protocol_probe_node(dsp_protocol_t * dsp_protocol, const char *device);
|
|
Packit |
675970 |
int safe_strtol(const char *str, long *val);
|
|
Packit |
675970 |
|
|
Packit |
675970 |
#endif /* _DSP_PROTOCOL_H */
|