|
Packit |
1fb8d4 |
/*
|
|
Packit |
1fb8d4 |
opensl_io.c:
|
|
Packit |
1fb8d4 |
Android OpenSL input/output module header
|
|
Packit |
1fb8d4 |
Copyright (c) 2012, Victor Lazzarini
|
|
Packit |
1fb8d4 |
All rights reserved.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
1fb8d4 |
modification, are permitted provided that the following conditions are met:
|
|
Packit Service |
5a9772 |
* Redistributions of source code must retain the above copyright
|
|
Packit Service |
5a9772 |
notice, this list of conditions and the following disclaimer.
|
|
Packit Service |
5a9772 |
* Redistributions in binary form must reproduce the above copyright
|
|
Packit Service |
5a9772 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit Service |
5a9772 |
documentation and/or other materials provided with the distribution.
|
|
Packit Service |
5a9772 |
* Neither the name of the <organization> nor the
|
|
Packit Service |
5a9772 |
names of its contributors may be used to endorse or promote products
|
|
Packit Service |
5a9772 |
derived from this software without specific prior written permission.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
Packit |
1fb8d4 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
Packit |
1fb8d4 |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
1fb8d4 |
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
Packit |
1fb8d4 |
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
Packit |
1fb8d4 |
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
Packit |
1fb8d4 |
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
Packit |
1fb8d4 |
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
Packit |
1fb8d4 |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
Packit |
1fb8d4 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
1fb8d4 |
*/
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#ifndef FREERDP_CHANNEL_AUDIN_CLIENT_OPENSL_IO_H
|
|
Packit |
1fb8d4 |
#define FREERDP_CHANNEL_AUDIN_CLIENT_OPENSL_IO_H
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#include <SLES/OpenSLES.h>
|
|
Packit |
1fb8d4 |
#include <SLES/OpenSLES_Android.h>
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#include <freerdp/api.h>
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#include <stdlib.h>
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#ifdef __cplusplus
|
|
Packit Service |
5a9772 |
extern "C"
|
|
Packit Service |
5a9772 |
{
|
|
Packit |
1fb8d4 |
#endif
|
|
Packit |
1fb8d4 |
|
|
Packit Service |
5a9772 |
typedef struct opensl_stream OPENSL_STREAM;
|
|
Packit |
1fb8d4 |
|
|
Packit Service |
5a9772 |
typedef void (*opensl_receive_t)(void* context, const void* data, size_t size);
|
|
Packit |
1fb8d4 |
|
|
Packit Service |
5a9772 |
/*
|
|
Packit Service |
5a9772 |
Open the audio device with a given sampling rate (sr), input and output channels and IO buffer
|
|
Packit Service |
5a9772 |
size in frames. Returns a handle to the OpenSL stream
|
|
Packit Service |
5a9772 |
*/
|
|
Packit Service |
5a9772 |
FREERDP_LOCAL OPENSL_STREAM* android_OpenRecDevice(void* context, opensl_receive_t receive,
|
|
Packit Service |
5a9772 |
int sr, int inchannels, int bufferframes,
|
|
Packit Service |
5a9772 |
int bits_per_sample);
|
|
Packit Service |
5a9772 |
/*
|
|
Packit Service |
5a9772 |
Close the audio device
|
|
Packit Service |
5a9772 |
*/
|
|
Packit Service |
5a9772 |
FREERDP_LOCAL void android_CloseRecDevice(OPENSL_STREAM* p);
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#ifdef __cplusplus
|
|
Packit |
1fb8d4 |
};
|
|
Packit |
1fb8d4 |
#endif
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#endif /* FREERDP_CHANNEL_AUDIN_CLIENT_OPENSL_IO_H */
|