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

Commit 0808b174 authored by Chong Zhang's avatar Chong Zhang
Browse files

Fix cpu hint for sw codecs

Add cpu hint for c2 sw codecs as well as omx.

bug: 130669553
test: manually test that when playing YouTube 1080pHDR
content, adb logcat shows traces from SchedulingPolicyService:
SchedulingPolicyService: Moving xxxx to group 5

Change-Id: Ie7afeb207fc0a898669bc7b98b270982471e6b65
parent 019b2fc5
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);