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

Commit 47f59cfe authored by Andreas Huber's avatar Andreas Huber
Browse files

Build the stagefright library by default.

parent 23aea977
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
ifeq ($(BUILD_WITH_STAGEFRIGHT),true)

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
@@ -62,5 +60,3 @@ include $(BUILD_EXECUTABLE)
# LOCAL_MODULE:= play
# 
# include $(BUILD_EXECUTABLE)

endif
+21 −29
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ LOCAL_SRC_FILES:= \
    MediaRecorderClient.cpp     \
    MediaPlayerService.cpp      \
    MetadataRetrieverClient.cpp \
    StagefrightPlayer.cpp       \
    TestPlayerStub.cpp          \
    VorbisPlayer.cpp            \
    MidiFile.cpp
@@ -27,7 +28,9 @@ LOCAL_SHARED_LIBRARIES := \
	libopencore_player    \
	libopencore_author    \
	libmedia              \
    libandroid_runtime
	libandroid_runtime    \
	libstagefright        \
	libstagefright_omx

ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES += libdl
@@ -35,21 +38,10 @@ endif

LOCAL_C_INCLUDES := external/tremor/Tremor                              \
	$(call include-path-for, graphics corecg)                       \
	$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
	$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include \
	$(TOP)/frameworks/base/media/libstagefright/omx

LOCAL_MODULE:= libmediaplayerservice

ifeq ($(BUILD_WITH_STAGEFRIGHT),true)
    LOCAL_SRC_FILES += StagefrightPlayer.cpp

    LOCAL_SHARED_LIBRARIES += \
	libstagefright        \
	libstagefright_omx

    LOCAL_C_INCLUDES += $(TOP)/frameworks/base/media/libstagefright/omx

    LOCAL_CFLAGS += -DBUILD_WITH_STAGEFRIGHT -DUSE_STAGEFRIGHT
endif

include $(BUILD_SHARED_LIBRARY)
+12 −38
Original line number Diff line number Diff line
@@ -58,20 +58,9 @@
#include "VorbisPlayer.h"
#include <media/PVPlayer.h>
#include "TestPlayerStub.h"

//#undef USE_STAGEFRIGHT

#if USE_STAGEFRIGHT
#include "StagefrightPlayer.h"
#endif

#ifdef BUILD_WITH_STAGEFRIGHT
#include <OMX.h>
#else
#include <media/IOMX.h>
#endif



/* desktop Linux needs a little help with gettid() */
#if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS)
@@ -199,10 +188,6 @@ typedef struct {
    const player_type playertype;
} extmap;
extmap FILE_EXTS [] =  {
#if USE_STAGEFRIGHT
        {".mp4", STAGEFRIGHT_PLAYER},
        {".3gp", STAGEFRIGHT_PLAYER},
#endif
        {".mid", SONIVOX_PLAYER},
        {".midi", SONIVOX_PLAYER},
        {".smf", SONIVOX_PLAYER},
@@ -289,11 +274,7 @@ sp<IMediaPlayer> MediaPlayerService::create(pid_t pid, const sp<IMediaPlayerClie
}

sp<IOMX> MediaPlayerService::createOMX() {
#ifdef BUILD_WITH_STAGEFRIGHT
    return new OMX;
#else
    return NULL;
#endif
}

status_t MediaPlayerService::AudioCache::dump(int fd, const Vector<String16>& args) const
@@ -620,6 +601,16 @@ void MediaPlayerService::Client::disconnect()
    IPCThreadState::self()->flushCommands();
}

static player_type getDefaultPlayerType() {
    char value[PROPERTY_VALUE_MAX];
    if (property_get("media.stagefright.enable-player", value, NULL)
        && (!strcmp(value, "1") || !strcasecmp(value, "true"))) {
        return STAGEFRIGHT_PLAYER;
    }

    return PV_PLAYER;
}

static player_type getPlayerType(int fd, int64_t offset, int64_t length)
{
    char buf[20];
@@ -650,12 +641,7 @@ static player_type getPlayerType(int fd, int64_t offset, int64_t length)
        EAS_Shutdown(easdata);
    }

#if USE_STAGEFRIGHT
    return STAGEFRIGHT_PLAYER;
#endif

    // Fall through to PV
    return PV_PLAYER;
    return getDefaultPlayerType();
}

static player_type getPlayerType(const char* url)
@@ -676,12 +662,7 @@ static player_type getPlayerType(const char* url)
        }
    }

#if USE_STAGEFRIGHT
    return STAGEFRIGHT_PLAYER;
#endif

    // Fall through to PV
    return PV_PLAYER;
    return getDefaultPlayerType();
}

static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
@@ -703,17 +684,10 @@ static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
            LOGV(" create VorbisPlayer");
            p = new VorbisPlayer();
            break;
#if USE_STAGEFRIGHT
        case STAGEFRIGHT_PLAYER:
            LOGV(" create StagefrightPlayer");
            p = new StagefrightPlayer;
            break;
#else
        case STAGEFRIGHT_PLAYER:
            LOG_ALWAYS_FATAL(
                    "Should not be here, stagefright player not enabled.");
            break;
#endif
        case TEST_PLAYER:
            LOGV("Create Test Player stub");
            p = new TestPlayerStub();
+0 −3
Original line number Diff line number Diff line
ifeq ($(BUILD_WITH_STAGEFRIGHT),true)

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

@@ -54,4 +52,3 @@ LOCAL_MODULE:= libstagefright
include $(BUILD_SHARED_LIBRARY)

include $(call all-makefiles-under,$(LOCAL_PATH))
endif
+0 −4
Original line number Diff line number Diff line
ifeq ($(BUILD_WITH_STAGEFRIGHT),true)

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

@@ -27,5 +25,3 @@ LOCAL_PRELINK_MODULE:= false
LOCAL_MODULE:= libstagefright_omx

include $(BUILD_SHARED_LIBRARY)

endif