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

Commit 5dd7c8a7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13158768 from ab06c186 to 25Q2-release

Change-Id: I34023373f2abcf08549c78e17e14c4b88627d692
parents 1bf4219c ab06c186
Loading
Loading
Loading
Loading
+36 −3
Original line number Diff line number Diff line
@@ -959,6 +959,7 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work,
            return;
        }

        bool reportResolutionChange = false;
        for (int i = 0; i < mOutFrames.num_frms; i++) {
            oapv_frm_info_t* finfo = &aui.frm_info[i];
            oapv_frm_t* frm = &mOutFrames.frm[i];
@@ -966,6 +967,7 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work,
            if (mWidth != finfo->w || mHeight != finfo->h) {
                mWidth = finfo->w;
                mHeight = finfo->h;
                reportResolutionChange = true;
            }

            if (mWidth > MAX_SUPPORTED_WIDTH || mHeight > MAX_SUPPORTED_HEIGHT) {
@@ -994,6 +996,22 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work,
            }
        }

        if (reportResolutionChange) {
            C2StreamPictureSizeInfo::output size(0u, mWidth, mHeight);
            std::vector<std::unique_ptr<C2SettingResult>> failures;
            c2_status_t err = mIntf->config({&size}, C2_MAY_BLOCK, &failures);
            if (err == C2_OK) {
                work->worklets.front()->output.configUpdate.push_back(
                    C2Param::Copy(size));
            } else {
                ALOGE("Config update size failed");
                mSignalledError = true;
                work->workletsProcessed = 1u;
                work->result = C2_CORRUPTED;
                return;
            }
        }

        oapvd_stat_t stat;
        ret = oapvd_decode(mDecHandle, &bitb, &mOutFrames, mMetadataHandle, &stat);
        if (bitb.ssize != stat.read) {
@@ -1041,7 +1059,7 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work,
    }
}

void C2SoftApvDec::getVuiParams() {
void C2SoftApvDec::getVuiParams(const std::unique_ptr<C2Work> &work) {
    // convert vui aspects to C2 values if changed
    if (!(vuiColorAspects == mBitstreamColorAspects)) {
        mBitstreamColorAspects = vuiColorAspects;
@@ -1066,7 +1084,17 @@ void C2SoftApvDec::getVuiParams() {
                codedAspects.primaries, codedAspects.transfer, codedAspects.matrix,
                codedAspects.range);
        std::vector<std::unique_ptr<C2SettingResult>> failures;
        mIntf->config({&codedAspects}, C2_MAY_BLOCK, &failures);
        c2_status_t err = mIntf->config({&codedAspects}, C2_MAY_BLOCK, &failures);
        if (err == C2_OK) {
            work->worklets.front()->output.configUpdate.push_back(
              C2Param::Copy(codedAspects));
        } else {
            ALOGE("Config update colorAspect failed");
            mSignalledError = true;
            work->workletsProcessed = 1u;
            work->result = C2_CORRUPTED;
            return;
        }
    }
}

@@ -1245,12 +1273,17 @@ status_t C2SoftApvDec::outputBuffer(const std::shared_ptr<C2BlockPool>& pool,
    }
    bool isMonochrome = OAPV_CS_GET_FORMAT(imgbOutput->cs) == OAPV_CS_YCBCR400;

    getVuiParams();
    getVuiParams(work);
    struct ApvHdrInfo hdrInfo = {};
    getHdrInfo(&hdrInfo, groupId);
    getHDRStaticParams(&hdrInfo, work);
    getHDR10PlusInfoData(&hdrInfo, work);

    if (mSignalledError) {
        // 'work' should already have signalled error at this point
        return C2_CORRUPTED;
    }

    uint32_t format = HAL_PIXEL_FORMAT_YV12;
    if (mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) {
        if (isHalPixelFormatSupported((AHardwareBuffer_Format)AHARDWAREBUFFER_FORMAT_YCbCr_P210)) {
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ struct C2SoftApvDec final : public SimpleC2Component {

    int mOutCsp;

    void getVuiParams();
    void getVuiParams(const std::unique_ptr<C2Work> &work);
    void getHdrInfo(struct ApvHdrInfo *buffer, int id);
    void getHDRStaticParams(const struct ApvHdrInfo *buffer, const std::unique_ptr<C2Work>& work);
    void getHDR10PlusInfoData(const struct ApvHdrInfo *buffer, const std::unique_ptr<C2Work>& work);
−83.5 KiB (2.09 MiB)

File changed.

No diff preview for this file type.

+21 −20
Original line number Diff line number Diff line
105883 1 0
106868 1 33333
108561 1 66666
109209 1 100000
109803 1 133333
111207 1 166666
111676 1 200000
112209 1 233333
113304 1 266666
113929 1 300000
114434 1 333333
114920 1 366666
116330 1 400000
116701 1 433333
117124 1 466666
117100 1 500000
117695 1 533333
118606 1 566655
119090 1 599988
119561 1 633322
18 32 0
106144 1 0
107776 1 33333
109226 1 66666
110007 1 100000
111730 1 133333
112139 1 166666
113389 1 200000
114151 1 233333
114711 1 266666
116138 1 300000
117122 1 333333
117220 1 366666
117809 1 400000
119036 1 433333
120015 1 466666
119981 1 500000
120214 1 533333
120440 1 566655
121398 1 599988
−61.3 KiB (1.06 MiB)

File changed.

No diff preview for this file type.

Loading