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

Commit c391e67d authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

libstagefright: Unbreak live effects

Change I1e31f2db521834a068e11d48e88547044b0c906f broke live effects
for (probably all) non-Samsung msm8660 devices. Use platform-based
logic to choose the correct memory pool (SMI for 8660 and MM for
everyone else), and add a build-time switch for devices that always
want MM regardless of platform (BOARD_CAMERA_USE_MM_HEAP)

Change-Id: I103946c40548f319bb1446f75a6a539aa3eb51b8
parent 5e228486
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ endif
ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
    LOCAL_CFLAGS += -DTARGET8x60
endif
ifeq ($(BOARD_CAMERA_USE_MM_HEAP),true)
    LOCAL_CFLAGS += -DCAMERA_MM_HEAP
endif
endif
include frameworks/base/media/libstagefright/codecs/common/Config.mk

+15 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <utils/String8.h>

#ifdef QCOM_HARDWARE
#include <cutils/properties.h>
#include <gralloc_priv.h>
#endif

@@ -344,7 +345,20 @@ status_t SurfaceMediaSource::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
            // issues with that flag get fixed.
            usage |= GraphicBuffer::USAGE_HW_TEXTURE;
#ifdef QCOM_HARDWARE
            usage |= GRALLOC_USAGE_PRIVATE_MM_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED;
            char value[PROPERTY_VALUE_MAX] = {0};
            if (property_get("ro.board.platform", value, "0")) {
#ifndef CAMERA_MM_HEAP
                if (!strncmp(value, "msm8660", sizeof("msm8660") - 1)) {
                    usage |= (GRALLOC_USAGE_PRIVATE_SMI_HEAP |
                            GRALLOC_USAGE_PRIVATE_UNCACHED);
                }
                else
#endif
                {
                    usage |= (GRALLOC_USAGE_PRIVATE_MM_HEAP |
                            GRALLOC_USAGE_PRIVATE_UNCACHED);
                }
            }
#endif
            status_t error;
            sp<GraphicBuffer> graphicBuffer(