diff options
-rw-r--r-- | Android.mk | 6 | ||||
-rw-r--r-- | audio_hw.c | 12 | ||||
-rw-r--r-- | audio_hw.h | 7 | ||||
-rw-r--r-- | audio_in.c | 16 | ||||
-rw-r--r-- | audio_out.c | 12 |
5 files changed, 34 insertions, 19 deletions
@@ -15,12 +15,14 @@ LOCAL_PATH := $(call my-dir) -ifeq ($(strip $(BOARD_USES_TINYALSA_LIBAUDIO)),true) +ifeq ($(strip $(BOARD_USES_TINYALSA_LIBAUDIO)),true) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ - audio_hw.c + audio_hw.c \ + audio_out.c \ + audio_in.c LOCAL_C_INCLUDES += \ external/tinyalsa/include \ @@ -30,18 +30,6 @@ #include "audio_hw.h" /* - * Output - */ - -#include "audio_out.c" - -/* - * Input - */ - -#include "audio_in.c" - -/* * Functions */ @@ -42,8 +42,13 @@ struct tinyalsa_audio_device { int audio_hw_open_output_stream(struct audio_hw_device *dev, uint32_t devices, int *format, uint32_t *channels, uint32_t *sample_rate, struct audio_stream_out **stream_out); - void audio_hw_close_output_stream(struct audio_hw_device *dev, struct audio_stream_out *stream); +int audio_hw_open_input_stream(struct audio_hw_device *dev, + uint32_t devices, int *format, uint32_t *channels, uint32_t *sample_rate, + audio_in_acoustics_t acoustics, struct audio_stream_in **stream_in); +void audio_hw_close_input_stream(struct audio_hw_device *dev, + struct audio_stream_in *stream); + #endif @@ -18,9 +18,19 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#undef LOG_TAG #define LOG_TAG "audio_in" +#include <errno.h> +#include <pthread.h> +#include <stdint.h> +#include <sys/time.h> + +#include <cutils/log.h> + +#define EFFECT_UUID_NULL EFFECT_UUID_NULL_IN +#define EFFECT_UUID_NULL_STR EFFECT_UUID_NULL_STR_IN +#include "audio_hw.h" + /* * Functions */ @@ -129,7 +139,7 @@ static int audio_in_remove_audio_effect(const struct audio_stream *stream, effec * Interface */ -static void audio_hw_close_input_stream(struct audio_hw_device *dev, +void audio_hw_close_input_stream(struct audio_hw_device *dev, struct audio_stream_in *stream) { LOGD("%s(%p)", __func__, stream); @@ -138,7 +148,7 @@ static void audio_hw_close_input_stream(struct audio_hw_device *dev, free(stream); } -static int audio_hw_open_input_stream(struct audio_hw_device *dev, +int audio_hw_open_input_stream(struct audio_hw_device *dev, uint32_t devices, int *format, uint32_t *channels, uint32_t *sample_rate, audio_in_acoustics_t acoustics, struct audio_stream_in **stream_in) { diff --git a/audio_out.c b/audio_out.c index 04655e0..2b3c854 100644 --- a/audio_out.c +++ b/audio_out.c @@ -18,9 +18,19 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#undef LOG_TAG #define LOG_TAG "audio_out" +#include <errno.h> +#include <pthread.h> +#include <stdint.h> +#include <sys/time.h> + +#include <cutils/log.h> + +#define EFFECT_UUID_NULL EFFECT_UUID_NULL_OUT +#define EFFECT_UUID_NULL_STR EFFECT_UUID_NULL_STR_OUT +#include "audio_hw.h" + /* * Functions */ |