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

Commit e7bac8fa authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Reorganize some of the stagefright implementation related to metadata."

parents 1df26b1e e4a83805
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@

namespace android {

struct StagefrightMetadataRetriever;

struct StagefrightMediaScanner : public MediaScanner {
    StagefrightMediaScanner();
    virtual ~StagefrightMediaScanner();
@@ -33,6 +35,8 @@ struct StagefrightMediaScanner : public MediaScanner {
    virtual char *extractAlbumArt(int fd);

private:
    sp<StagefrightMetadataRetriever> mRetriever;

    StagefrightMediaScanner(const StagefrightMediaScanner &);
    StagefrightMediaScanner &operator=(const StagefrightMediaScanner &);
};
+11 −1
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@ LOCAL_SHARED_LIBRARIES := \
    libbinder \
    libmedia \
    libskia \
    libui
    libui \
    libcutils

ifneq ($(BUILD_WITHOUT_PV),true)
LOCAL_SRC_FILES += \
@@ -28,6 +29,15 @@ else
    LOCAL_CFLAGS += -DNO_OPENCORE
endif

ifeq ($(BUILD_WITH_FULL_STAGEFRIGHT),true)

LOCAL_CFLAGS += -DBUILD_WITH_FULL_STAGEFRIGHT=1

LOCAL_SHARED_LIBRARIES += \
    libstagefright

endif

LOCAL_STATIC_LIBRARIES :=

LOCAL_C_INCLUDES += \
+21 −7
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include <cutils/properties.h>
#include <utils/threads.h>

#include "jni.h"
@@ -32,8 +33,10 @@

#ifndef NO_OPENCORE
#include "pvmediascanner.h"
#else
#include "StagefrightMediaScanner.h"
#endif

#if BUILD_WITH_FULL_STAGEFRIGHT
#include <media/stagefright/StagefrightMediaScanner.h>
#endif

// ----------------------------------------------------------------------------
@@ -283,14 +286,25 @@ android_media_MediaScanner_native_init(JNIEnv *env)
    }
}

static MediaScanner *createMediaScanner() {
#if BUILD_WITH_FULL_STAGEFRIGHT
    char value[PROPERTY_VALUE_MAX];
    if (property_get("media.stagefright.enable-scan", value, NULL)
        && (!strcmp(value, "1") || !strcasecmp(value, "true"))) {
        return new StagefrightMediaScanner;
    }
#endif
#ifndef NO_OPENCORE
    return new PVMediaScanner();
#endif

    return NULL;
}

static void
android_media_MediaScanner_native_setup(JNIEnv *env, jobject thiz)
{
#ifndef NO_OPENCORE
    MediaScanner *mp = new PVMediaScanner();
#else
    MediaScanner *mp = new StagefrightMediaScanner();
#endif
    MediaScanner *mp = createMediaScanner();

    if (mp == NULL) {
        jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
+0 −5
Original line number Diff line number Diff line
@@ -26,11 +26,6 @@ LOCAL_SRC_FILES:= \
    MediaScannerClient.cpp \
    autodetect.cpp

ifneq ($(BUILD_WITHOUT_PV),true)
else
LOCAL_SRC_FILES += StagefrightMediaScanner.cpp
endif

LOCAL_SHARED_LIBRARIES := \
	libui libcutils libutils libbinder libsonivox libicuuc

+0 −1
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ LOCAL_SRC_FILES:= \
ifeq ($(BUILD_WITH_FULL_STAGEFRIGHT),true)

LOCAL_SRC_FILES +=                      \
    StagefrightMetadataRetriever.cpp    \
    StagefrightPlayer.cpp               \
    StagefrightRecorder.cpp

Loading