Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c5b2102 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru
Browse files

Deal better with situations where OpenCORE is disabled.

parent 8374f8fc
Loading
Loading
Loading
Loading
+15 −3
Original line number Original line Diff line number Diff line
@@ -7,12 +7,16 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
include $(CLEAR_VARS)


LOCAL_SRC_FILES:=               \
LOCAL_SRC_FILES:=               \
	MediaRecorderClient.cpp \
	MediaPlayerService.cpp \
	MediaPlayerService.cpp \
	MetadataRetrieverClient.cpp \
	MetadataRetrieverClient.cpp \
	VorbisPlayer.cpp \
	VorbisPlayer.cpp \
	MidiFile.cpp
	MidiFile.cpp


ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_SRC_FILES+=               \
	MediaRecorderClient.cpp
endif

ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
LOCAL_LDLIBS += -ldl -lpthread
endif
endif
@@ -22,14 +26,22 @@ LOCAL_SHARED_LIBRARIES := \
	libutils \
	libutils \
	libvorbisidec \
	libvorbisidec \
	libsonivox \
	libsonivox \
	libopencore_player \
	libopencore_author \
	libmedia \
	libmedia \
	libandroid_runtime
	libandroid_runtime


ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_SHARED_LIBRARIES += \
	libopencore_player \
	libopencore_author
endif

LOCAL_C_INCLUDES := external/tremor/Tremor \
LOCAL_C_INCLUDES := external/tremor/Tremor \
	$(call include-path-for, graphics corecg)
	$(call include-path-for, graphics corecg)


ifeq ($(BUILD_WITHOUT_PV),true)
LOCAL_CFLAGS := -DNO_OPENCORE
endif

LOCAL_MODULE:= libmediaplayerservice
LOCAL_MODULE:= libmediaplayerservice


include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
+6 −0
Original line number Original line Diff line number Diff line
@@ -105,7 +105,11 @@ MediaPlayerService::~MediaPlayerService()


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


#ifndef NO_OPENCORE
    mRetriever = new PVMetadataRetriever();
    mRetriever = new PVMetadataRetriever();
#else
    mRetriever = NULL;
#endif
    if (mRetriever == NULL) {
    if (mRetriever == NULL) {
        LOGE("failed to initialize the retriever");
        LOGE("failed to initialize the retriever");
    }
    }