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

Commit 7bb35102 authored by Steve Kondik's avatar Steve Kondik
Browse files

camera: Allow any target to use message management

 * Previously this was set for QCOM only, but it has
   value for other cameras who have janky drivers.

Change-Id: I233bbd544388a7f019db48034c21d4406f9e33b4
parent 9b187caa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -70,6 +70,14 @@ ifeq ($(BOARD_HTC_3D_SUPPORT),true)
    LOCAL_CFLAGS += -DHTC_3D_SUPPORT
endif

ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
    LOCAL_CFLAGS += -DCAMERA_MSG_MGMT
endif

ifeq ($(BOARD_CAMERA_MSG_MGMT),true)
    LOCAL_CFLAGS += -DCAMERA_MSG_MGMT
endif

LOCAL_MODULE:= libcameraservice

include $(BUILD_SHARED_LIBRARY)
+7 −7
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ status_t CameraClient::initialize(camera_module_t *module) {

    // Enable zoom, error, focus, and metadata messages by default
    enableMsgType(CAMERA_MSG_ERROR | CAMERA_MSG_ZOOM | CAMERA_MSG_FOCUS
#ifndef QCOM_HARDWARE
#ifndef CAMERA_MSG_MGMT
                  | CAMERA_MSG_PREVIEW_METADATA 
#endif
#ifndef OMAP_ICS_CAMERA
@@ -358,7 +358,7 @@ status_t CameraClient::setPreviewCallbackTarget(

// start preview mode
status_t CameraClient::startPreview() {
#ifdef QCOM_HARDWARE
#ifdef CAMERA_MSG_MGMT
    enableMsgType(CAMERA_MSG_PREVIEW_METADATA);
#endif
    LOG1("startPreview (pid %d)", getCallingPid());
@@ -452,7 +452,7 @@ status_t CameraClient::startRecordingMode() {
// stop preview mode
void CameraClient::stopPreview() {
    LOG1("stopPreview (pid %d)", getCallingPid());
#ifdef QCOM_HARDWARE
#ifdef CAMERA_MSG_MGMT
    disableMsgType(CAMERA_MSG_PREVIEW_METADATA);
#endif
    Mutex::Autolock lock(mLock);
@@ -470,7 +470,7 @@ void CameraClient::stopPreview() {
#endif

    disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
#ifdef QCOM_HARDWARE
#ifdef CAMERA_MSG_MGMT
    //Disable picture related message types
    ALOGI("stopPreview: Disable picture related messages");
    int picMsgType = 0;
@@ -493,7 +493,7 @@ void CameraClient::stopRecording() {
    if (checkPidAndHardware() != NO_ERROR) return;

    disableMsgType(CAMERA_MSG_VIDEO_FRAME);
#ifdef QCOM_HARDWARE
#ifdef CAMERA_MSG_MGMT
    //Disable picture related message types
    ALOGI("stopRecording: Disable picture related messages");
    int picMsgType = 0;
@@ -593,7 +593,7 @@ status_t CameraClient::takePicture(int msgType) {
#if defined(OMAP_ICS_CAMERA) || defined(OMAP_ENHANCEMENT_BURST_CAPTURE)
    picMsgType |= CAMERA_MSG_COMPRESSED_BURST_IMAGE;
#endif
#ifdef QCOM_HARDWARE
#ifdef CAMERA_MSG_MGMT
    disableMsgType(CAMERA_MSG_PREVIEW_METADATA);
#endif
    enableMsgType(picMsgType);
@@ -743,7 +743,7 @@ void CameraClient::disableMsgType(int32_t msgType) {
bool CameraClient::lockIfMessageWanted(int32_t msgType) {
    int sleepCount = 0;
    while (mMsgEnabled & msgType) {
#ifdef QCOM_HARDWARE
#ifdef CAMERA_MSG_MGMT
        if ((msgType == CAMERA_MSG_PREVIEW_FRAME) &&
              (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE)) {
           LOG1("lockIfMessageWanted(%d): Don't try to acquire mlock if "