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

Commit 33bd60ba authored by Chong Zhang's avatar Chong Zhang
Browse files

Use NO_IMEMORY version of libstagefright_foundation for apex

Currently swcodec apex build uses vendor variant which no longer
depends on libbinder. However, in some builds VNDK is not used
and libbinder dependency still exists. Although the prebuilt
apex no longer contains libbinder, some build still fails when
libbinder is disallowed in apex.

Create a separate version of libstagefright_foundataion_no_imemory,
and use that only if there is no vendor build.

Also do not use __ANDROID_VNDK__ to disable the binder related
code in libstagefright_foundation, it's never defined if there is
no VNDK. Use NO_IMEMORY instead.

bug: 139201422
bug: 139016109

test: various builds in presubmit
Change-Id: I045836e10b93f71c7c31b30bb555eea8d6a2ef3a
parent f3f9288e
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -22,9 +22,20 @@ cc_library_shared {
        "libcutils", // for properties
        "liblog",    // for ALOG
        "libsfplugin_ccodec_utils", // for ImageCopy
        "libstagefright_foundation", // for Mutexed
        "libstagefright_foundation_without_imemory", // for Mutexed
    ],

    target: {
        vendor: {
            exclude_shared_libs: [
                "libstagefright_foundation_without_imemory",
            ],
            shared_libs: [
                "libstagefright_foundation",
            ],
        },
    },

    sanitize: {
        misc_undefined: [
            "unsigned-integer-overflow",
@@ -57,9 +68,20 @@ cc_defaults {
        "libcutils", // for properties
        "liblog", // for ALOG
        "libsfplugin_ccodec_utils", // for ImageCopy
        "libstagefright_foundation", // for ColorUtils and MIME
        "libstagefright_foundation_without_imemory", // for ColorUtils and MIME
    ],

    target: {
        vendor: {
            exclude_shared_libs: [
                "libstagefright_foundation_without_imemory",
            ],
            shared_libs: [
                "libstagefright_foundation",
            ],
        },
    },

    cflags: [
        "-Wall",
        "-Werror",
+12 −1
Original line number Diff line number Diff line
@@ -23,10 +23,21 @@ cc_library_shared {
        "libcodec2_vndk",
        "libcutils",
        "liblog",
        "libstagefright_foundation",
        "libstagefright_foundation_without_imemory",
        "libutils",
    ],

    target: {
        vendor: {
            exclude_shared_libs: [
                "libstagefright_foundation_without_imemory",
            ],
            shared_libs: [
                "libstagefright_foundation",
            ],
        },
    },

    static_libs: [
        "libyuv_static",
    ],
+12 −1
Original line number Diff line number Diff line
@@ -64,12 +64,23 @@ cc_library_shared {
        "libfmq",
        "liblog",
        "libnativewindow",
        "libstagefright_foundation",
        "libstagefright_foundation_without_imemory",
        "libstagefright_bufferpool@2.0.1",
        "libui",
        "libutils",
    ],

    target: {
        vendor: {
            exclude_shared_libs: [
                "libstagefright_foundation_without_imemory",
            ],
            shared_libs: [
                "libstagefright_foundation",
            ],
        },
    },

    cflags: [
        "-Werror",
        "-Wall",
+3 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ cc_defaults {
        "libhidlbase",
        "libhidlmemory",
        "liblog",
        "libstagefright_foundation",
        "libstagefright_foundation_without_imemory",
        "libui",
        "libutils",

@@ -35,7 +35,6 @@ cc_defaults {

    export_shared_lib_headers: [
        "libhidlmemory",
        "libstagefright_foundation",
        "android.hardware.graphics.bufferqueue@1.0",
        "android.hardware.graphics.bufferqueue@2.0",
    ],
@@ -68,11 +67,13 @@ cc_library_shared {
        vendor: {
            exclude_shared_libs: [
                "libgui",
                "libstagefright_foundation_without_imemory",
            ],
            static_libs: [
                "libgui_bufferqueue_static",
            ],
            shared_libs: [
                "libstagefright_foundation",
                "android.hidl.token@1.0-utils",
                "libEGL",
                "libnativewindow",
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@

#include <media/stagefright/foundation/hexdump.h>

#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
#include <binder/Parcel.h>
#endif

@@ -646,7 +646,7 @@ AString AMessage::debugString(int32_t indent) const {
    return s;
}

#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
// static
sp<AMessage> AMessage::FromParcel(const Parcel &parcel, size_t maxNestingLevel) {
    int32_t what = parcel.readInt32();
@@ -813,7 +813,7 @@ void AMessage::writeToParcel(Parcel *parcel) const {
        }
    }
}
#endif  // __ANDROID_VNDK__
#endif  // NO_IMEMORY

sp<AMessage> AMessage::changesFrom(const sp<const AMessage> &other, bool deep) const {
    if (other == NULL) {
Loading