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

Commit f69ef326 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "Fix cpu hint for sw codecs" into qt-dev

am: d198b7b7

Change-Id: Ie62b2c3b10a6c3e0a358817a64fa30f0bb7a8a96
parents 0f5c5db1 d198b7b7
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1659,10 +1659,12 @@ void MediaCodec::requestCpuBoostIfNeeded() {
        return;
    }
    int32_t colorFormat;
    if (mSoftRenderer != NULL
            && mOutputFormat->contains("hdr-static-info")
    if (mOutputFormat->contains("hdr-static-info")
            && mOutputFormat->findInt32("color-format", &colorFormat)
            && (colorFormat == OMX_COLOR_FormatYUV420Planar16)) {
            // check format for OMX only, for C2 the format is always opaque since the
            // software rendering doesn't go through client
            && ((mSoftRenderer != NULL && colorFormat == OMX_COLOR_FormatYUV420Planar16)
                    || mOwnerName.equalsIgnoreCase("codec2::software"))) {
        int32_t left, top, right, bottom, width, height;
        int64_t totalPixel = 0;
        if (mOutputFormat->findRect("crop", &left, &top, &right, &bottom)) {
@@ -1958,6 +1960,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
                    } else {
                        mFlags &= ~kFlagUsesSoftwareRenderer;
                    }
                    mOwnerName = owner;

                    MediaResource::Type resourceType;
                    if (mComponentName.endsWith(".secure")) {
+1 −0
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@ private:
    sp<ALooper> mCodecLooper;
    sp<CodecBase> mCodec;
    AString mComponentName;
    AString mOwnerName;
    sp<MediaCodecInfo> mCodecInfo;
    sp<AReplyToken> mReplyID;
    uint32_t mFlags;
+2 −1
Original line number Diff line number Diff line
@@ -33,11 +33,12 @@ static const char kVendorSeccompPolicyPath[] =

extern "C" void RegisterCodecServices();

int main(int argc __unused, char** /*argv*/)
int main(int argc __unused, char** argv)
{
    LOG(INFO) << "media swcodec service starting";
    signal(SIGPIPE, SIG_IGN);
    SetUpMinijail(kSystemSeccompPolicyPath, kVendorSeccompPolicyPath);
    strcpy(argv[0], "media.swcodec");

    ::android::hardware::configureRpcThreadpool(64, false);