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

Commit cfc10268 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android (Google) Code Review
Browse files

Merge "MediaCodecInfo: allow getting info for secure codec" into lmp-dev

parents b860155d dbf1552d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1622,8 +1622,7 @@ final public class MediaCodec {
     * @throws IllegalStateException if in the Uninitialized state.
     */
    public MediaCodecInfo getCodecInfo() {
        return MediaCodecList.getCodecInfoAt(
                   MediaCodecList.findCodecByName(getName()));
        return MediaCodecList.getInfoFor(getName());
    }

    private native final ByteBuffer[] getBuffers(boolean input);
+7 −5
Original line number Diff line number Diff line
@@ -321,6 +321,9 @@ public final class MediaCodecInfo {
            // check feature support
            for (Feature feat: getValidFeatures()) {
                Integer yesNo = (Integer)map.get(MediaFormat.KEY_FEATURE_ + feat.mName);
                if (yesNo == null) {
                    continue;
                }
                if ((yesNo == 1 && !isFeatureSupported(feat.mName)) ||
                        (yesNo == 0 && isFeatureRequired(feat.mName))) {
                    return false;
@@ -470,13 +473,12 @@ public final class MediaCodecInfo {
                Integer yesNo = (Integer)map.get(key);
                if (yesNo == null) {
                    continue;
                } else if (yesNo > 0) {
                }
                if (yesNo > 0) {
                    mFlagsRequired |= feat.mValue;
                    mDefaultFormat.setInteger(key, 1);
                } else {
                }
                mFlagsSupported |= feat.mValue;
                mDefaultFormat.setInteger(key, 1);
                }
                // TODO restrict features by mFlagsVerified once all codecs reliably verify them
            }
        }
+5 −0
Original line number Diff line number Diff line
@@ -116,6 +116,11 @@ final public class MediaCodecList {

    /* package private */ static native final int findCodecByName(String codec);

    /** @hide */
    public static MediaCodecInfo getInfoFor(String codec) {
        return sAllCodecInfos[findCodecByName(codec)];
    }

    private static native final void native_init();

    /**