Merge change 20422

* changes:
  Build the stagefright library by default.
This commit is contained in:
Android (Google) Code Review
2009-08-07 11:09:44 -07:00
5 changed files with 33 additions and 78 deletions

View File

@@ -1,5 +1,3 @@
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

View File

@@ -7,49 +7,41 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
MediaRecorderClient.cpp \
MediaPlayerService.cpp \
MediaRecorderClient.cpp \
MediaPlayerService.cpp \
MetadataRetrieverClient.cpp \
TestPlayerStub.cpp \
VorbisPlayer.cpp \
StagefrightPlayer.cpp \
TestPlayerStub.cpp \
VorbisPlayer.cpp \
MidiFile.cpp
ifeq ($(TARGET_OS)-$(TARGET_SIMULATOR),linux-true)
LOCAL_LDLIBS += -ldl -lpthread
endif
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libvorbisidec \
libsonivox \
libopencore_player \
libopencore_author \
libmedia \
libandroid_runtime
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libvorbisidec \
libsonivox \
libopencore_player \
libopencore_author \
libmedia \
libandroid_runtime \
libstagefright \
libstagefright_omx
ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES += libdl
endif
LOCAL_C_INCLUDES := external/tremor/Tremor \
$(call include-path-for, graphics corecg) \
$(TOP)/external/opencore/extern_libs_v2/khronos/openmax/include
LOCAL_C_INCLUDES := external/tremor/Tremor \
$(call include-path-for, graphics corecg) \
$(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)

View File

@@ -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();

View File

@@ -1,5 +1,3 @@
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

View File

@@ -1,5 +1,3 @@
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