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 * to be changed. Most effects can be rendered by simply changing the fragment shader, thus
* by overriding {@link #getFragmentShader()}. * 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. * This class will try to automatically implement {@link #copy()} thanks to this.
* If your filter implements public parameters, please implement {@link OneParameterFilter} * If your filter implements public parameters, please implement {@link OneParameterFilter}
* and {@link TwoParameterFilter} to handle them and have them passed automatically to copies. * and {@link TwoParameterFilter} to handle them and have them passed automatically to copies.
@ -226,9 +226,9 @@ public abstract class BaseFilter implements Filter {
try { try {
return getClass().newInstance(); return getClass().newInstance();
} catch (IllegalAccessException e) { } 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) { } 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. * Advanced users can create custom filters using GLES.
* It is recommended to extend {@link BaseFilter} instead of this class. * 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}, * 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. * and also helps {@link BaseFilter} automatically make a copy of the filter.
* *

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

Loading…
Cancel
Save