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

Commit 4ea8bc4f authored by Lajos Molnar's avatar Lajos Molnar Committed by Automerger Merge Worker
Browse files

Merge "media: trivial implementation of MediaCodec.detachOutputSurface" into main am: 86bf87a9

parents 14e27716 86bf87a9
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -2345,6 +2345,15 @@ final public class MediaCodec {
            throw new IllegalArgumentException("Can't use crypto and descrambler together!");
        }

        // at the moment no codecs support detachable surface
        if (android.media.codec.Flags.nullOutputSurface()) {
            // Detached surface flag is only meaningful if surface is null. Otherwise, it is
            // ignored.
            if (surface == null && (flags & CONFIGURE_FLAG_DETACHED_SURFACE) != 0) {
                throw new IllegalArgumentException("Codec does not support detached surface");
            }
        }

        String[] keys = null;
        Object[] values = null;

@@ -2419,7 +2428,8 @@ final public class MediaCodec {
     *  output.
     *
     *  @throws IllegalStateException if the codec was not
     *                                configured in surface mode.
     *            configured in surface mode or if the codec does not support
     *            detaching the output surface.
     *  @see CONFIGURE_FLAG_DETACHED_SURFACE
     */
    @FlaggedApi(FLAG_NULL_OUTPUT_SURFACE)
@@ -2429,6 +2439,7 @@ final public class MediaCodec {
        }
        // note: we still have a surface in detached mode, so keep mHasSurface
        // we also technically allow calling detachOutputSurface multiple times in a row
        throw new IllegalStateException("codec does not support detaching output surface");
        // native_detachSurface();
    }