Blame channels/audin/client/opensles/opensl_io.h

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