Deal better with situations where OpenCORE is disabled.

This commit is contained in:
Jean-Baptiste Queru
2009-03-21 11:40:18 -07:00
parent 2a73de7b21
commit 680f8c77d5
5 changed files with 29 additions and 8 deletions

View File

@ -1,7 +1,8 @@
ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_SRC_FILES:= \
android_media_MediaPlayer.cpp \
android_media_MediaRecorder.cpp \
@ -38,6 +39,7 @@ LOCAL_MODULE:= libmedia_jni
include $(BUILD_SHARED_LIBRARY)
endif
# build libsoundpool.so
include $(LOCAL_PATH)/soundpool/Android.mk
endif

View File

@ -7,12 +7,16 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
MediaRecorderClient.cpp \
MediaPlayerService.cpp \
MetadataRetrieverClient.cpp \
VorbisPlayer.cpp \
MidiFile.cpp
ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_SRC_FILES+= \
MediaRecorderClient.cpp
endif
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
endif
@ -22,14 +26,22 @@ LOCAL_SHARED_LIBRARIES := \
libutils \
libvorbisidec \
libsonivox \
libopencore_player \
libopencore_author \
libmedia \
libandroid_runtime
ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_SHARED_LIBRARIES += \
libopencore_player \
libopencore_author
endif
LOCAL_C_INCLUDES := external/tremor/Tremor \
$(call include-path-for, graphics corecg)
ifeq ($(BUILD_WITHOUT_PV),true)
LOCAL_CFLAGS := -DNO_OPENCORE
endif
LOCAL_MODULE:= libmediaplayerservice
include $(BUILD_SHARED_LIBRARY)

View File

@ -105,7 +105,11 @@ MediaPlayerService::~MediaPlayerService()
sp<IMediaRecorder> MediaPlayerService::createMediaRecorder(pid_t pid)
{
#ifndef NO_OPENCORE
sp<MediaRecorderClient> recorder = new MediaRecorderClient(pid);
#else
sp<MediaRecorderClient> recorder = NULL;
#endif
LOGV("Create new media recorder client from pid %d", pid);
return recorder;
}
@ -531,10 +535,12 @@ static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
{
sp<MediaPlayerBase> p;
switch (playerType) {
#ifndef NO_OPENCORE
case PV_PLAYER:
LOGV(" create PVPlayer");
p = new PVPlayer();
break;
#endif
case SONIVOX_PLAYER:
LOGV(" create MidiFile");
p = new MidiFile();

View File

@ -49,7 +49,11 @@ MetadataRetrieverClient::MetadataRetrieverClient(pid_t pid)
mThumbnail = NULL;
mAlbumArt = NULL;
#ifndef NO_OPENCORE
mRetriever = new PVMetadataRetriever();
#else
mRetriever = NULL;
#endif
if (mRetriever == NULL) {
LOGE("failed to initialize the retriever");
}

View File

@ -177,9 +177,6 @@ android.graphics.drawable.TransitionDrawable$TransitionState
android.graphics.drawable.shapes.RoundRectShape
android.location.ILocationManager$Stub
android.media.AudioManager
android.media.MediaPlayer
android.media.MediaRecorder
android.media.MediaScanner
android.net.LocalSocket
android.net.LocalSocketAddress
android.net.LocalSocketAddress$Namespace