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

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

Merge "media: Add hidden api to set video encoding profile and level." into nyc-mr1-dev

parents ad749416 f70ad43f
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -745,6 +745,27 @@ public class MediaRecorder
        setParameter("video-param-encoding-bitrate=" + bitRate);
    }

    /**
     * Sets the video encoding profile for recording. Call this method before prepare().
     * Prepare() may perform additional checks on the parameter to make sure whether the
     * specified profile and level are applicable, and sometimes the passed profile or
     * level will be discarded due to codec capablity or to ensure the video recording
     * can proceed smoothly based on the capabilities of the platform.
     * @hide
     * @param profile declared in {@link MediaCodecInfo.CodecProfileLevel}.
     * @param level declared in {@link MediaCodecInfo.CodecProfileLevel}.
     */
    public void setVideoEncodingProfileLevel(int profile, int level) {
        if (profile <= 0)  {
            throw new IllegalArgumentException("Video encoding profile is not positive");
        }
        if (level <= 0)  {
            throw new IllegalArgumentException("Video encoding level is not positive");
        }
        setParameter("video-param-encoder-profile=" + profile);
        setParameter("video-param-encoder-level=" + level);
    }

    /**
     * Currently not implemented. It does nothing.
     * @deprecated Time lapse mode video recording using camera still image capture