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

Commit b50a8033 authored by James Dong's avatar James Dong
Browse files

Add color format query support to QueryCodecs()

Change-Id: Ic8589649cd09392a1b969a30082b4c9c4e6cc6a7
parent be0646b4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -307,6 +307,7 @@ struct CodecProfileLevel {
struct CodecCapabilities {
    String8 mComponentName;
    Vector<CodecProfileLevel> mProfileLevels;
    Vector<OMX_U32> mColorFormats;
};

// Return a vector of componentNames with supported profile/level pairs
+14 −0
Original line number Diff line number Diff line
@@ -4006,6 +4006,20 @@ status_t QueryCodecs(
            caps->mProfileLevels.push(profileLevel);
        }

        // Color format query
        OMX_VIDEO_PARAM_PORTFORMATTYPE portFormat;
        InitOMXParams(&portFormat);
        portFormat.nPortIndex = queryDecoders ? 1 : 0;
        for (portFormat.nIndex = 0;; ++portFormat.nIndex)  {
            err = omx->getParameter(
                    node, OMX_IndexParamVideoPortFormat,
                    &portFormat, sizeof(portFormat));
            if (err != OK) {
                break;
            }
            caps->mColorFormats.push(portFormat.eColorFormat);
        }

        CHECK_EQ(omx->freeNode(node), OK);
    }
}