mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-24 00:05:53 +08:00
Initial Android OpenSL ES implementation, contributed by ANTA
This commit is contained in:
+2
-1
@@ -20,6 +20,7 @@ LOCAL_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/audio/openslES/*.c) \
|
||||
$(LOCAL_PATH)/src/atomic/SDL_atomic.c.arm \
|
||||
$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
|
||||
$(wildcard $(LOCAL_PATH)/src/core/android/*.c) \
|
||||
@@ -69,7 +70,7 @@ LOCAL_CFLAGS += \
|
||||
LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare
|
||||
|
||||
|
||||
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
|
||||
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
|
||||
|
||||
ifeq ($(NDK_DEBUG),1)
|
||||
cmd-strip :=
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
|
||||
/* Enable various audio drivers */
|
||||
#define SDL_AUDIO_DRIVER_ANDROID 1
|
||||
#define SDL_AUDIO_DRIVER_OPENSLES 1
|
||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
||||
|
||||
/* Enable various input drivers */
|
||||
|
||||
@@ -92,6 +92,9 @@ static const AudioBootStrap *const bootstrap[] = {
|
||||
#if SDL_AUDIO_DRIVER_ANDROID
|
||||
&ANDROIDAUDIO_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_OPENSLES
|
||||
&openslES_bootstrap,
|
||||
#endif
|
||||
#if SDL_AUDIO_DRIVER_PSP
|
||||
&PSPAUDIO_bootstrap,
|
||||
#endif
|
||||
|
||||
@@ -205,6 +205,7 @@ extern AudioBootStrap DISKAUDIO_bootstrap;
|
||||
extern AudioBootStrap DUMMYAUDIO_bootstrap;
|
||||
extern AudioBootStrap FUSIONSOUND_bootstrap;
|
||||
extern AudioBootStrap ANDROIDAUDIO_bootstrap;
|
||||
extern AudioBootStrap openslES_bootstrap;
|
||||
extern AudioBootStrap PSPAUDIO_bootstrap;
|
||||
extern AudioBootStrap EMSCRIPTENAUDIO_bootstrap;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#ifndef _SDL_openslesaudio_h
|
||||
#define _SDL_openslesaudio_h
|
||||
|
||||
#include "../SDL_sysaudio.h"
|
||||
|
||||
/* Hidden "this" pointer for the audio functions */
|
||||
#define _THIS SDL_AudioDevice *this
|
||||
|
||||
struct SDL_PrivateAudioData
|
||||
{
|
||||
/* The file descriptor for the audio device */
|
||||
Uint8 *mixbuf;
|
||||
Uint32 mixlen;
|
||||
Uint32 write_delay;
|
||||
Uint32 initial_calls;
|
||||
};
|
||||
|
||||
#endif /* _SDL_openslesaudio_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
Reference in New Issue
Block a user