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

Commit ddbccba6 authored by Songyue Han's avatar Songyue Han
Browse files

CodecCapabilities NDK: Fix implementation issues.

Add nullptr check for getSupportedMediaTypes. Fix isVendor.

Bug: 389120542
Test: manual
Change-Id: I5376b574dfb3aa61ca7d99360060c47bc52a04bf
parent ce02dc61
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ int32_t AMediaCodecInfo_isVendor(const AMediaCodecInfo *info) {
    }

    int32_t attributes = info->mInfo->getAttributes();
    return (attributes & android::MediaCodecInfo::kFlagIsVendor);
    return (attributes & android::MediaCodecInfo::kFlagIsVendor) ? 1 : 0;
}

EXPORT
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ extern "C" {
EXPORT
media_status_t AMediaCodecStore_getSupportedMediaTypes(
        const AMediaCodecSupportedMediaType **outMediaTypes, size_t *outCount) {
    if (outMediaTypes == nullptr) {
    if (outMediaTypes == nullptr || outCount == nullptr) {
        return AMEDIA_ERROR_INVALID_PARAMETER;
    }