09-22 14:53:47.473 897 943 E AndroidRuntime: java.lang.IllegalArgumentException: not a PersistentSurface 09-22 14:53:47.473 897 943 E AndroidRuntime: at android.media.MediaRecorder.setInputSurface(MediaRecorder.java:165)
/** * Configures the recorder to use a persistent surface when using SURFACE video source. * <p> May only be called before {@link #prepare}. If called, {@link #getSurface} should * not be used and will throw IllegalStateException. Frames rendered to the Surface * before {@link #start} will be discarded.</p>
* @param surface a persistent input surface created by * {@link MediaCodec#createPersistentInputSurface} * @throws IllegalStateException if it is called after {@link #prepare} and before * {@link #stop}. * @throws IllegalArgumentException if the surface was not created by * {@link MediaCodec#createPersistentInputSurface}. * @see MediaCodec#createPersistentInputSurface * @see MediaRecorder.VideoSource */ public void setInputSurface(@NonNull Surface surface) { if (!(surface instanceof MediaCodec.PersistentSurface)) { throw new IllegalArgumentException("not a PersistentSurface"); } native_setInputSurface(surface); }