pull/545/head
Mattia Iavarone 6 years ago
parent 2c343290f8
commit 7fd45fbbc0
  1. 6
      cameraview/src/main/java/com/otaliastudios/cameraview/filter/BaseFilter.java
  2. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/filter/Filter.java
  3. 8
      cameraview/src/main/java/com/otaliastudios/cameraview/video/SnapshotVideoRecorder.java

@ -19,7 +19,7 @@ import java.nio.FloatBuffer;
* to be changed. Most effects can be rendered by simply changing the fragment shader, thus
* by overriding {@link #getFragmentShader()}.
*
* All {@link BaseFilter}s should have a no-op public constructor.
* All {@link BaseFilter}s should have a no-arguments public constructor.
* This class will try to automatically implement {@link #copy()} thanks to this.
* If your filter implements public parameters, please implement {@link OneParameterFilter}
* and {@link TwoParameterFilter} to handle them and have them passed automatically to copies.
@ -226,9 +226,9 @@ public abstract class BaseFilter implements Filter {
try {
return getClass().newInstance();
} catch (IllegalAccessException e) {
throw new RuntimeException("Filters should have a public no-op constructor.", e);
throw new RuntimeException("Filters should have a public no-arguments constructor.", e);
} catch (InstantiationException e) {
throw new RuntimeException("Filters should have a public no-op constructor.", e);
throw new RuntimeException("Filters should have a public no-arguments constructor.", e);
}
}
}

@ -19,7 +19,7 @@ import java.io.File;
* Advanced users can create custom filters using GLES.
* It is recommended to extend {@link BaseFilter} instead of this class.
*
* All {@link Filter}s should have a no-op public constructor.
* All {@link Filter}s should have a no-arguments public constructor.
* This ensures that you can pass the filter class to XML attribute {@code app:cameraFilter},
* and also helps {@link BaseFilter} automatically make a copy of the filter.
*

@ -173,8 +173,12 @@ public class SnapshotVideoRecorder extends VideoRecorder implements RendererFram
}
// Engine
mEncoderEngine = new MediaEncoderEngine(mResult.file, videoEncoder, audioEncoder,
mResult.maxDuration, mResult.maxSize, SnapshotVideoRecorder.this);
mEncoderEngine = new MediaEncoderEngine(mResult.file,
videoEncoder,
audioEncoder,
mResult.maxDuration,
mResult.maxSize,
SnapshotVideoRecorder.this);
mEncoderEngine.notify(TextureMediaEncoder.FILTER_EVENT, mCurrentFilter);
mEncoderEngine.start();
mResult.rotation = 0; // We will rotate the result instead.

Loading…
Cancel
Save