summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-08-07 09:30:32 -0700
committerAndreas Huber <andih@google.com>2009-08-07 10:40:34 -0700
commit47f59cfe40b0ebb3afd6c39f97dcd1eac2e966f7 (patch)
tree7b4d59814d6e75d323b07ff752de2bb5598f305d /media
parent23aea9771d800ce43ffd8a23ad64ed6cead4b159 (diff)
downloadframeworks_av-47f59cfe40b0ebb3afd6c39f97dcd1eac2e966f7.zip
frameworks_av-47f59cfe40b0ebb3afd6c39f97dcd1eac2e966f7.tar.gz
frameworks_av-47f59cfe40b0ebb3afd6c39f97dcd1eac2e966f7.tar.bz2
Build the stagefright library by default.
Diffstat (limited to 'media')
-rw-r--r--media/libmediaplayerservice/Android.mk50
-rw-r--r--media/libmediaplayerservice/MediaPlayerService.cpp50
-rw-r--r--media/libstagefright/Android.mk3
-rw-r--r--media/libstagefright/omx/Android.mk4
4 files changed, 33 insertions, 74 deletions
diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk
index f74ef3a..84f858c 100644
--- a/media/libmediaplayerservice/Android.mk
+++ b/media/libmediaplayerservice/Android.mk
@@ -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)
diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp
index 95d61cd..eeb4e49 100644
--- a/media/libmediaplayerservice/MediaPlayerService.cpp
+++ b/media/libmediaplayerservice/MediaPlayerService.cpp
@@ -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();
diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk
index 0a44762..00ba1ac 100644
--- a/media/libstagefright/Android.mk
+++ b/media/libstagefright/Android.mk
@@ -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
diff --git a/media/libstagefright/omx/Android.mk b/media/libstagefright/omx/Android.mk
index 2e564e9..ecd3b2e 100644
--- a/media/libstagefright/omx/Android.mk
+++ b/media/libstagefright/omx/Android.mk
@@ -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