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

Commit 795b9263 authored by Ethan Chen's avatar Ethan Chen Committed by Gerrit Code Review
Browse files

camera: allow proper preview window updates to be disabled

This causes issues with various video chat apps for devices such as
Sensation and possibly others using HTC MSM8660 camera HAL.

Change-Id: I9ea2d4c5d60c4f4771cac0f5fe992fb79ba0071d
parent 854718e0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -116,10 +116,12 @@ public:

        if (mDevice->ops->set_preview_window) {
#ifdef QCOM_HARDWARE
#ifndef NO_UPDATE_PREVIEW
            LOGV("%s buf %p mPreviewWindow %p", __FUNCTION__, buf.get(), mPreviewWindow.get());
            if (mPreviewWindow.get() && (buf.get() != mPreviewWindow.get())) {
                 mDevice->ops->set_preview_window(mDevice, 0);
            }
#endif
#endif

            mPreviewWindow = buf;
+4 −0
Original line number Diff line number Diff line
@@ -540,7 +540,9 @@ void CameraService::Client::disconnect() {
    // Release the held ANativeWindow resources.
    if (mPreviewWindow != 0) {
#ifdef QCOM_HARDWARE
#ifndef NO_UPDATE_PREVIEW
        mHardware->setPreviewWindow(0);
#endif
#endif
        disconnectWindow(mPreviewWindow);
        mPreviewWindow = 0;
@@ -584,8 +586,10 @@ status_t CameraService::Client::setPreviewWindow(const sp<IBinder>& binder,
            result = mHardware->setPreviewWindow(window);
        }
#ifdef QCOM_HARDWARE
#ifndef NO_UPDATE_PREVIEW
    } else {
        result = mHardware->setPreviewWindow(window);
#endif
#endif
    }