summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MediaPlayerFactory.cpp
diff options
context:
space:
mode:
authorMingming Yin <mingming@codeaurora.org>2015-07-08 18:23:52 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:24:13 -0600
commit2d846a1474e999db2a09ab00bb92e1b6079a0573 (patch)
treef689c133d1c9ab0e1b206c797595386cb7f80d67 /media/libmediaplayerservice/MediaPlayerFactory.cpp
parentf48b75f9c6407a2e5b361ec57cefd812404eb02d (diff)
downloadframeworks_av-2d846a1474e999db2a09ab00bb92e1b6079a0573.zip
frameworks_av-2d846a1474e999db2a09ab00bb92e1b6079a0573.tar.gz
frameworks_av-2d846a1474e999db2a09ab00bb92e1b6079a0573.tar.bz2
stagefright: Disable AwesomePlayer
Permanently remove StagefrightPlayer codebase & remove its entry from MediaPlayerFactory as AwesomePlayer is completely replaced by NuPlayer. Keep the AwesomePlayer codebase to make libstagefright_timedtext available to NuPlayer via libstagefright. Conflicts: media/libmediaplayerservice/MediaPlayerFactory.cpp Change-Id: Idfecdc519919ee940817c7bb515433fc37588bd3
Diffstat (limited to 'media/libmediaplayerservice/MediaPlayerFactory.cpp')
-rw-r--r--media/libmediaplayerservice/MediaPlayerFactory.cpp67
1 files changed, 1 insertions, 66 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerFactory.cpp b/media/libmediaplayerservice/MediaPlayerFactory.cpp
index d5d12f7..1be86d0 100644
--- a/media/libmediaplayerservice/MediaPlayerFactory.cpp
+++ b/media/libmediaplayerservice/MediaPlayerFactory.cpp
@@ -31,7 +31,6 @@
#include "MediaPlayerFactory.h"
#include "TestPlayerStub.h"
-#include "StagefrightPlayer.h"
#include "nuplayer/NuPlayerDriver.h"
namespace android {
@@ -64,12 +63,6 @@ status_t MediaPlayerFactory::registerFactory_l(IFactory* factory,
}
static player_type getDefaultPlayerType() {
- char value[PROPERTY_VALUE_MAX];
- if (property_get("media.stagefright.use-awesome", value, NULL)
- && (!strcmp("1", value) || !strcasecmp("true", value))) {
- return STAGEFRIGHT_PLAYER;
- }
-
return NU_PLAYER;
}
@@ -87,7 +80,7 @@ void MediaPlayerFactory::unregisterFactory(player_type type) {
#define GET_PLAYER_TYPE_IMPL(a...) \
Mutex::Autolock lock_(&sLock); \
\
- player_type ret = STAGEFRIGHT_PLAYER; \
+ player_type ret = NU_PLAYER; \
float bestScore = 0.0; \
\
for (size_t i = 0; i < sFactoryMap.size(); ++i) { \
@@ -176,63 +169,6 @@ sp<MediaPlayerBase> MediaPlayerFactory::createPlayer(
* *
*****************************************************************************/
-class StagefrightPlayerFactory :
- public MediaPlayerFactory::IFactory {
- public:
- virtual float scoreFactory(const sp<IMediaPlayer>& /*client*/,
- int fd,
- int64_t offset,
- int64_t length,
- float /*curScore*/) {
- if (legacyDrm()) {
- sp<DataSource> source = new FileSource(dup(fd), offset, length);
- String8 mimeType;
- float confidence;
- if (SniffWVM(source, &mimeType, &confidence, NULL /* format */)) {
- return 1.0;
- }
- }
-
- if (getDefaultPlayerType() == STAGEFRIGHT_PLAYER) {
- char buf[20];
- lseek(fd, offset, SEEK_SET);
- read(fd, buf, sizeof(buf));
- lseek(fd, offset, SEEK_SET);
-
- uint32_t ident = *((uint32_t*)buf);
-
- // Ogg vorbis?
- if (ident == 0x5367674f) // 'OggS'
- return 1.0;
- }
-
- return 0.0;
- }
-
- virtual float scoreFactory(const sp<IMediaPlayer>& /*client*/,
- const char* url,
- float /*curScore*/) {
- if (legacyDrm() && !strncasecmp("widevine://", url, 11)) {
- return 1.0;
- }
- return 0.0;
- }
-
- virtual sp<MediaPlayerBase> createPlayer(pid_t /* pid */) {
- ALOGV(" create StagefrightPlayer");
- return new StagefrightPlayer();
- }
- private:
- bool legacyDrm() {
- char value[PROPERTY_VALUE_MAX];
- if (property_get("persist.sys.media.legacy-drm", value, NULL)
- && (!strcmp("1", value) || !strcasecmp("true", value))) {
- return true;
- }
- return false;
- }
-};
-
class NuPlayerFactory : public MediaPlayerFactory::IFactory {
public:
virtual float scoreFactory(const sp<IMediaPlayer>& /*client*/,
@@ -310,7 +246,6 @@ void MediaPlayerFactory::registerBuiltinFactories() {
if (sInitComplete)
return;
- registerFactory_l(new StagefrightPlayerFactory(), STAGEFRIGHT_PLAYER);
registerFactory_l(new NuPlayerFactory(), NU_PLAYER);
registerFactory_l(new TestPlayerFactory(), TEST_PLAYER);