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

Commit d198b7b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents f03a3a6f 0808b174
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);