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

Commit 9b61a748 authored by Dhiraj Nadgouda's avatar Dhiraj Nadgouda Committed by Ricardo Cerqueira
Browse files

frameworks : Enabling board hw Player and scanner

- Enabling OMX Scanner and OMX Player (Board HW Scanner and
Board HW Player) on GB with Kernel 32.

(cherry picked from commit 90dd05af48a40bfba015b739a9b97873e3263ba8)

Change-Id: I09f1d5bfebb4af484c0da833a8ca86f2ec4d6e7f
parent 472a4946
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ enum player_type {
    // argument to the 'test:' url in the setDataSource call.
    TEST_PLAYER = 5,
    FLAC_PLAYER = 6,
    BOARD_HW_PLAYER = 7,
};


+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,11 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_STATIC_LIBRARIES :=

ifeq ($(strip $(BOARD_USES_HW_MEDIASCANNER)),true)
  LOCAL_SHARED_LIBRARIES += libhwmediaplugin
  LOCAL_CFLAGS += -DUSE_BOARD_MEDIASCANNER
endif

LOCAL_C_INCLUDES += \
    external/tremor/Tremor \
    frameworks/base/core/jni \
+16 −2
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@
** See the License for the specific language governing permissions and
** limitations under the License.
*/

#define LOG_TAG "MediaScanner"
#include "utils/Log.h"

@@ -32,6 +31,11 @@
#include "android_runtime/AndroidRuntime.h"

#include <media/stagefright/StagefrightMediaScanner.h>
#ifdef USE_BOARD_MEDIASCANNER
#include <media/stagefright/StagefrightMediaScanner.h>
#include <hardware_legacy/MediaPlayerHardwareInterface.h>
#endif


// ----------------------------------------------------------------------------

@@ -280,10 +284,20 @@ android_media_MediaScanner_native_init(JNIEnv *env)
    }
}

static MediaScanner *createMediaScanner() {
LOGV("MediaScanner *createMediaScanner\n");
#ifdef USE_BOARD_MEDIASCANNER
LOGV("MediaScanner *createMediaScannerHardware\n");
        return createMediaScannerHardware();
#endif
        return new StagefrightMediaScanner;
}


static void
android_media_MediaScanner_native_setup(JNIEnv *env, jobject thiz)
{
    MediaScanner *mp = new StagefrightMediaScanner;
    MediaScanner *mp = createMediaScanner();

    if (mp == NULL) {
        jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
+5 −1
Original line number Diff line number Diff line
@@ -61,12 +61,16 @@ LOCAL_C_INCLUDES := \
        $(TOP)/external/flac/include                                    \
        $(TOP)/external/tremolo/Tremolo


ifeq ($(strip $(BOARD_USES_HW_MEDIARECORDER)),true)
    LOCAL_SHARED_LIBRARIES += libhwmediarecorder
    LOCAL_CFLAGS += -DUSE_BOARD_MEDIARECORDER
endif

ifeq ($(strip $(BOARD_USES_HW_MEDIAPLUGINS)),true)
    LOCAL_SHARED_LIBRARIES += libhwmediaplugin
    LOCAL_CFLAGS += -DUSE_BOARD_MEDIAPLUGIN
endif

LOCAL_MODULE:= libmediaplayerservice

include $(BUILD_SHARED_LIBRARY)
+15 −0
Original line number Diff line number Diff line
@@ -63,6 +63,12 @@

#include <OMX.h>

#ifdef USE_BOARD_MEDIAPLUGIN
#define NO_OPENCORE 1
#include <hardware_legacy/MediaPlayerHardwareInterface.h>
#endif


/* desktop Linux needs a little help with gettid() */
#if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS)
#define __KERNEL__
@@ -677,6 +683,9 @@ void MediaPlayerService::Client::disconnect()
}

static player_type getDefaultPlayerType() {
#ifdef USE_BOARD_MEDIAPLUGIN
    return BOARD_HW_PLAYER;
#endif
    return STAGEFRIGHT_PLAYER;
}

@@ -782,6 +791,12 @@ static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
            LOGV(" create FLACPlayer");
            p = new FLACPlayer();
            break;
#ifdef USE_BOARD_MEDIAPLUGIN
        case BOARD_HW_PLAYER:
            LOGE(" create BoardHWPlayer");
            p = createMediaPlayerHardware();
            break;
#endif
    }
    if (p != NULL) {
        if (p->initCheck() == NO_ERROR) {
Loading