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

Commit 1cde32aa authored by Dhiraj Nadgouda's avatar Dhiraj Nadgouda Committed by Steve Kondik
Browse files

GB:enabling hw media recorder

- enabling hw media recorder.
- bug 786503

Change-Id: I6f67e7e46ff41f17dc0296bd0938b52c522d6958

Ignore transient errors from hw mediarecorder

Change-Id: I1f2c61f0ce156fd925d6a573345f6662f01ce88e

camera_client: Add older connect() symbol

LG's binary hwmediarecorder uses the old (pre multi-cam) version
without the cameraId argument, so wrap the new version to make
the symbol available

Change-Id: Ic7362e3f0fc66954dfb6e3545c8c2d63ea939fcd
parent 5487b37a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,10 @@ sp<Camera> Camera::connect(int cameraId)
    return c;
}

extern "C" sp<Camera> _ZN7android6Camera7connectEv () {
    return Camera::connect(0);
}

void Camera::disconnect()
{
    LOGV("disconnect");
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@ LOCAL_LDLIBS := -lpthread

LOCAL_MODULE:= libmedia_jni

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

include $(BUILD_SHARED_LIBRARY)

# build libsoundpool.so
+2 −0
Original line number Diff line number Diff line
@@ -119,9 +119,11 @@ static bool process_media_recorder_call(JNIEnv *env, status_t opStatus, const ch
    if (opStatus == (status_t)INVALID_OPERATION) {
        jniThrowException(env, "java/lang/IllegalStateException", NULL);
        return true;
#ifndef USE_BOARD_MEDIARECORDER
    } else if (opStatus != (status_t)OK) {
        jniThrowException(env, exception, message);
        return true;
#endif
    }
    return false;
}
+6 −0
Original line number Diff line number Diff line
@@ -61,6 +61,12 @@ 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

LOCAL_MODULE:= libmediaplayerservice

include $(BUILD_SHARED_LIBRARY)
+9 −3
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@
#include "MediaPlayerService.h"

#include "StagefrightRecorder.h"

#ifdef  USE_BOARD_MEDIARECORDER
#include <hardware_legacy/MediaRecorderHardwareInterface.h>
#endif
namespace android {

const char* cameraPermission = "android.permission.CAMERA";
@@ -303,7 +305,11 @@ MediaRecorderClient::MediaRecorderClient(const sp<MediaPlayerService>& service,
{
    LOGV("Client constructor");
    mPid = pid;

#ifdef USE_BOARD_MEDIARECORDER
    {
        mRecorder = createMediaRecorderHardware();
    }
#else
    char value[PROPERTY_VALUE_MAX];
    if (!property_get("media.stagefright.enable-record", value, NULL)
        || !strcmp(value, "1") || !strcasecmp(value, "true")) {
@@ -318,7 +324,7 @@ MediaRecorderClient::MediaRecorderClient(const sp<MediaPlayerService>& service,
        mRecorder = NULL;
    }
#endif

#endif
    mMediaPlayerService = service;
}