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

Commit f8b5fe2e authored by Colin Cross's avatar Colin Cross
Browse files

Support building libstagefright against musl

Support building libstagefright against musl by only including
the binder Parcel code when compiling for the device.

Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: I8e128579998b24bea6a6beed43308458d8b1f2a8
parent 14f14f07
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@

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

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#include <binder/Parcel.h>
#endif

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

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
// static
sp<AMessage> AMessage::FromParcel(const Parcel &parcel, size_t maxNestingLevel) {
    int32_t what = parcel.readInt32();
@@ -825,7 +825,7 @@ void AMessage::writeToParcel(Parcel *parcel) const {
        }
    }
}
#endif  // !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#endif  // defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)

sp<AMessage> AMessage::changesFrom(const sp<const AMessage> &other, bool deep) const {
    if (other == NULL) {
+3 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#include "ADebug.h"
#include "AString.h"

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#include <binder/Parcel.h>
#endif

@@ -365,7 +365,7 @@ bool AString::endsWithIgnoreCase(const char *suffix) const {
    return !strcasecmp(mData + mSize - suffixLen, suffix);
}

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
// static
AString AString::FromParcel(const Parcel &parcel) {
    size_t size = static_cast<size_t>(parcel.readInt32());
@@ -380,7 +380,7 @@ status_t AString::writeToParcel(Parcel *parcel) const {
    }
    return err;
}
#endif // !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#endif // defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)

AString AStringPrintf(const char *format, ...) {
    va_list ap;
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
#include <media/stagefright/foundation/hexdump.h>
#include <media/stagefright/MetaData.h>

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#include <binder/Parcel.h>
#endif

@@ -48,7 +48,7 @@ MetaData::MetaData(const MetaDataBase &from)
MetaData::~MetaData() {
}

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
/* static */
sp<MetaData> MetaData::createFromParcel(const Parcel &parcel) {

+3 −3
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
#include <media/stagefright/foundation/hexdump.h>
#include <media/stagefright/MetaDataBase.h>

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#include <binder/Parcel.h>
#endif

@@ -452,7 +452,7 @@ void MetaDataBase::dumpToLog() const {
    }
}

#if !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#if defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
status_t MetaDataBase::writeToParcel(Parcel &parcel) {
    status_t ret;
    size_t numItems = mInternalData->mItems.size();
@@ -532,7 +532,7 @@ status_t MetaDataBase::updateFromParcel(const Parcel &parcel) {
    ALOGW("no metadata in parcel");
    return UNKNOWN_ERROR;
}
#endif // !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)
#endif // defined(__ANDROID__) && !defined(__ANDROID_VNDK__) && !defined(__ANDROID_APEX__)

}  // namespace android