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
gugelfrei
Chong Zhang 4 years ago
parent f3f9288eae
commit 33bd60bab9

@ -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",

@ -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",
],

@ -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",

@ -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",

@ -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) {

@ -27,7 +27,7 @@
#include "ADebug.h"
#include "AString.h"
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
#include <binder/Parcel.h>
#endif
@ -365,7 +365,7 @@ bool AString::endsWithIgnoreCase(const char *suffix) const {
return !strcasecmp(mData + mSize - suffixLen, suffix);
}
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
// static
AString AString::FromParcel(const Parcel &parcel) {
size_t size = static_cast<size_t>(parcel.readInt32());

@ -8,9 +8,6 @@ cc_library_headers {
cc_defaults {
name: "libstagefright_foundation_defaults",
vendor_available: true,
vndk: {
enabled: true,
},
double_loadable: true,
include_dirs: [
"frameworks/av/include",
@ -42,7 +39,6 @@ cc_defaults {
],
shared_libs: [
"libbinder",
"libutils",
"libcutils",
"liblog",
@ -101,12 +97,21 @@ cc_defaults {
cc_library {
name: "libstagefright_foundation",
defaults: ["libstagefright_foundation_defaults"],
vndk: {
enabled: true,
},
shared_libs: [ "libbinder" ]
}
cc_library_static {
cc_library {
name: "libstagefright_foundation_without_imemory",
defaults: ["libstagefright_foundation_defaults"],
apex_available: [
"//apex_available:platform",
"com.android.media.swcodec",
"test_com.android.media.swcodec",
],
vendor_available: false,
cflags: [
"-Wno-multichar",
"-Werror",

@ -28,7 +28,7 @@
#include <media/stagefright/foundation/hexdump.h>
#include <media/stagefright/MetaData.h>
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
#include <binder/Parcel.h>
#endif
@ -48,7 +48,7 @@ MetaData::MetaData(const MetaDataBase &from)
MetaData::~MetaData() {
}
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
/* static */
sp<MetaData> MetaData::createFromParcel(const Parcel &parcel) {

@ -28,7 +28,7 @@
#include <media/stagefright/foundation/hexdump.h>
#include <media/stagefright/MetaDataBase.h>
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
#include <binder/Parcel.h>
#endif
@ -452,7 +452,7 @@ void MetaDataBase::dumpToLog() const {
}
}
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
status_t MetaDataBase::writeToParcel(Parcel &parcel) {
status_t ret;
size_t numItems = mInternalData->mItems.size();

@ -63,7 +63,7 @@ struct AMessage : public RefBase {
AMessage();
AMessage(uint32_t what, const sp<const AHandler> &handler);
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
// Construct an AMessage from a parcel.
// nestingAllowed determines how many levels AMessage can be nested inside
// AMessage. The default value here is arbitrarily set to 255.

@ -89,7 +89,7 @@ struct AString {
void tolower();
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
static AString FromParcel(const Parcel &parcel);
status_t writeToParcel(Parcel *parcel) const;
#endif

@ -41,7 +41,7 @@ private:
friend class BnMediaSource;
friend class BpMediaSource;
friend class BpMediaExtractor;
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
static sp<MetaData> createFromParcel(const Parcel &parcel);
#endif
};

@ -323,7 +323,7 @@ private:
struct Rect;
struct MetaDataInternal;
MetaDataInternal *mInternalData;
#ifndef __ANDROID_VNDK__
#ifndef NO_IMEMORY
status_t writeToParcel(Parcel &parcel);
status_t updateFromParcel(const Parcel &parcel);
#endif

Loading…
Cancel
Save