Skip to content

Commit

Permalink
Implement audio support
Browse files Browse the repository at this point in the history
Audio playback still has a delay about 1-2 seconds but it's usable.

This also moves the platform policy class into its own namespace to be
not specific to just window management.
  • Loading branch information
morphis committed Jan 12, 2017
1 parent 23392b9 commit d729b8b
Show file tree
Hide file tree
Showing 27 changed files with 1,243 additions and 770 deletions.
23 changes: 18 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,27 @@ LOCAL_SRC_FILES := \
LOCAL_MODULE := hwcomposer.anbox
LOCAL_CFLAGS:= -DLOG_TAG=\"hwcomposer\"
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../device/generic/goldfish/opengl/host/include/libOpenglRender \
$(LOCAL_PATH)/../device/generic/goldfish/opengl/shared/OpenglCodecCommon \
$(LOCAL_PATH)/../device/generic/goldfish/opengl/system/renderControl_enc \
$(LOCAL_PATH)/../device/generic/goldfish/opengl/system/OpenglSystemCommon
$(LOCAL_PATH)/android/opengl/host/include/libOpenglRender \
$(LOCAL_PATH)/android/opengl/shared/OpenglCodecCommon \
$(LOCAL_PATH)/android/opengl/system/renderControl_enc \
$(LOCAL_PATH)/android/opengl/system/OpenglSystemCommon
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := audio.primary.goldfish
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils liblog
LOCAL_SRC_FILES := \
android/audio/audio_hw.cpp
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/src
LOCAL_SHARED_LIBRARIES += libdl
LOCAL_CFLAGS := -Wno-unused-parameter

include $(BUILD_SHARED_LIBRARY)

# Include the Android.mk files below will override LOCAL_PATH so we
# have to take a copy of it here.
TMP_PATH := $(LOCAL_PATH)
Expand All @@ -89,7 +103,6 @@ include $(TMP_PATH)/android/fingerprint/Android.mk
include $(TMP_PATH)/android/power/Android.mk
include $(TMP_PATH)/android/qemu-props/Android.mk
include $(TMP_PATH)/android/qemud/Android.mk
include $(TMP_PATH)/android/audio/Android.mk
include $(TMP_PATH)/android/sensors/Android.mk
include $(TMP_PATH)/android/opengl/Android.mk
include $(TMP_PATH)/android/gps/Android.mk
Expand Down
7 changes: 7 additions & 0 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ set(HWCOMPOSER_SOURCES

add_library(hwcomposer.anbox SHARED ${HWCOMPOSER_SOURCES})

set(AUDIO_SOURCES
audio/audio_hw.cpp)
add_library(audio.goldfish SHARED ${AUDIO_SOURCES})

# As we're adding Android specific bits in this project we can't
# build this safely within default build anymore. We keep this
# for easy integration into used IDEs.
Expand All @@ -38,3 +42,6 @@ set_target_properties(anboxd
set_target_properties(hwcomposer.anbox
PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

set_target_properties(audio.goldfish
PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

31 changes: 0 additions & 31 deletions android/audio/Android.mk

This file was deleted.

Loading

0 comments on commit d729b8b

Please sign in to comment.