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

Commit 72d7e523 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11078623 from 9556e9aa to 24Q1-release

Change-Id: Ib6f753ad76615cae21fe2dfca8d14a3c34322865
parents f9ed0738 9556e9aa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -21,14 +21,16 @@ cc_aconfig_library {
    name: "com.android.media.audioserver-aconfig-cc",
    aconfig_declarations: "com.android.media.audioserver-aconfig",
    defaults: ["audio-aconfig-cc-defaults"],

    // TODO(b/308061678) remove vndk dependency
    double_loadable: true,
    host_supported: true,
    product_available: true,
    vendor_available: true,
    apex_available: [
        "//apex_available:platform",
        "com.android.media",
        "com.android.media.swcodec",
    ],
    min_sdk_version: "29",
}

cc_aconfig_library {
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ status_t AidlConversionSpatializer::setParameter(EffectParamReader& param) {
status_t AidlConversionSpatializer::getParameter(EffectParamWriter& param) {
    DefaultExtension defaultExt;
    // read parameters into DefaultExtension vector<uint8_t>
    defaultExt.bytes.resize(param.getParameterSize());
    if (OK != param.readFromParameter(defaultExt.bytes.data(), param.getParameterSize())) {
        ALOGE("%s invalid param %s", __func__, param.toString().c_str());
        param.setStatus(BAD_VALUE);
+16 −6
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <cmath>
#include <stdio.h>
#include <sys/time.h>
#include <sys/wait.h>

#include <android-base/macros.h>
#include <android-base/parsebool.h>
@@ -801,19 +802,28 @@ void VideoRenderQualityTracker::triggerTraceWithThrottle(const TraceTriggerFn tr
void VideoRenderQualityTracker::triggerTrace() {
    // Trigger perfetto to stop always-on-tracing (AOT) to collect trace into a file for video
    // freeze event, the collected trace categories are configured by AOT.
    const char* args[] = {"/system/bin/trigger_perfetto", "com.android.codec-video-freeze", NULL};
    static const char* args[] = {"/system/bin/trigger_perfetto",
                                 "com.android.codec-video-freeze", NULL};

    pid_t pid = fork();
    if (pid < 0) {
        ALOGI("Failed to fork for triggering trace");
        return;
    }
    if (pid == 0) {
        // child process.
    } else if (pid == 0) {
        // Child process.
        ALOGI("Trigger trace %s", args[1]);
        execvp(args[0], const_cast<char**>(args));
        ALOGW("Failed to trigger trace %s", args[1]);
        _exit(1);
    } else {
        // Parent process.
        int status;
        // Wait for the child process (pid) gets terminated, and allow the system to release
        // the resource associated with the child. Or the child process will remain in a
        // zombie state and get killed by llkd to cause foreground app crash.
        if (waitpid(pid, &status, 0) < 0) {
            ALOGW("Failed to waitpid for triggering trace");
        }
    }
    ALOGI("Triggered trace %s", args[1]);
}

} // namespace android
+38 −1
Original line number Diff line number Diff line
@@ -102,6 +102,21 @@ static const OMX_U32 kPortIndexOutput = 1;

namespace android {

static bool isValidOmxParamSize(const void *params, OMX_U32 size) {
    // expect the vector to contain at least the size and version, two OMX_U32 entries.
    if (size < 2 * sizeof(OMX_U32)) {
        return false;
    }

    // expect the vector to be as large as the declared size
    OMX_U32 *buf = (OMX_U32 *)params;
    OMX_U32 declaredSize = *(OMX_U32*)buf;
    if (declaredSize > size) {
        return false;
    }
    return true;
}

struct BufferMeta {
    explicit BufferMeta(
            const sp<IMemory> &mem, const sp<IHidlMemory> &hidlMemory,
@@ -688,6 +703,18 @@ bool OMXNodeInstance::isProhibitedIndex_l(OMX_INDEXTYPE index) {

status_t OMXNodeInstance::getParameter(
        OMX_INDEXTYPE index, void *params, size_t size) {
    OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index;
    if (extIndex == OMX_IndexParamConsumerUsageBits) {
        // expect the size to be 4 bytes for OMX_IndexParamConsumerUsageBits
        if (size != sizeof(OMX_U32)) {
            return BAD_VALUE;
        }
    } else {
        if (!isValidOmxParamSize(params, size)) {
            return BAD_VALUE;
        }
    }

    Mutex::Autolock autoLock(mLock);
    if (mHandle == NULL) {
        return DEAD_OBJECT;
@@ -699,7 +726,6 @@ status_t OMXNodeInstance::getParameter(
    }

    OMX_ERRORTYPE err = OMX_GetParameter(mHandle, index, params);
    OMX_INDEXEXTTYPE extIndex = (OMX_INDEXEXTTYPE)index;
    // some errors are expected for getParameter
    if (err != OMX_ErrorNoMore) {
        CLOG_IF_ERROR(getParameter, err, "%s(%#x)", asString(extIndex), index);
@@ -710,6 +736,10 @@ status_t OMXNodeInstance::getParameter(

status_t OMXNodeInstance::setParameter(
        OMX_INDEXTYPE index, const void *params, size_t size) {
    if (!isValidOmxParamSize(params, size)) {
        return BAD_VALUE;
    }

    Mutex::Autolock autoLock(mLock);
    if (mHandle == NULL) {
        return DEAD_OBJECT;
@@ -736,6 +766,9 @@ status_t OMXNodeInstance::setParameter(

status_t OMXNodeInstance::getConfig(
        OMX_INDEXTYPE index, void *params, size_t size) {
    if (!isValidOmxParamSize(params, size)) {
        return BAD_VALUE;
    }
    Mutex::Autolock autoLock(mLock);
    if (mHandle == NULL) {
        return DEAD_OBJECT;
@@ -759,6 +792,10 @@ status_t OMXNodeInstance::getConfig(

status_t OMXNodeInstance::setConfig(
        OMX_INDEXTYPE index, const void *params, size_t size) {
    if (!isValidOmxParamSize(params, size)) {
        return BAD_VALUE;
    }

    Mutex::Autolock autoLock(mLock);
    if (mHandle == NULL) {
        return DEAD_OBJECT;
+8 −0
Original line number Diff line number Diff line
@@ -616,6 +616,10 @@ OMX_ERRORTYPE SoftVideoDecoderOMXComponent::getConfig(
                DescribeHDR10PlusInfoParams* outParams =
                        (DescribeHDR10PlusInfoParams *)params;

                if (!isValidOMXParam(outParams)) {
                    return OMX_ErrorBadParameter;
                }

                outParams->nParamSizeUsed = info->size();

                // If the buffer provided by the client does not have enough
@@ -694,6 +698,10 @@ OMX_ERRORTYPE SoftVideoDecoderOMXComponent::internalSetConfig(
            const DescribeHDR10PlusInfoParams* inParams =
                    (DescribeHDR10PlusInfoParams *)params;

            if (!isValidOMXParam(inParams)) {
                return OMX_ErrorBadParameter;
            }

            if (*frameConfig) {
                // This is a request to append to the current frame config set.
                // For now, we only support kDescribeHdr10PlusInfoIndex, which
Loading