pull/535/head
Mattia Iavarone 6 years ago
parent dabbbed699
commit bd767bda8c
  1. 10
      cameraview/src/androidTest/java/com/otaliastudios/cameraview/engine/CameraIntegrationTest.java
  2. 3
      cameraview/src/main/java/com/otaliastudios/cameraview/filter/FilterParser.java

@ -189,8 +189,14 @@ public abstract class CameraIntegrationTest extends BaseTest {
// with video snapshots where we do lots of processing. The videoEnd callback can return // with video snapshots where we do lots of processing. The videoEnd callback can return
// long after the actual stop() call, so if we're still processing, let's wait more. // long after the actual stop() call, so if we're still processing, let's wait more.
if (expectSuccess && camera.isTakingVideo()) { if (expectSuccess && camera.isTakingVideo()) {
return waitForVideoResult(true); while (camera.isTakingVideo()) {
} else if (expectSuccess) { video.listen();
result = video.await(DELAY);
}
}
// Now we should be OK.
if (expectSuccess) {
assertEquals("Should call onVideoRecordingEnd", 0, onVideoRecordingEnd.getCount()); assertEquals("Should call onVideoRecordingEnd", 0, onVideoRecordingEnd.getCount());
assertNotNull("Should end video", result); assertNotNull("Should end video", result);
} else { } else {

@ -16,15 +16,14 @@ public class FilterParser {
public FilterParser(@NonNull TypedArray array) { public FilterParser(@NonNull TypedArray array) {
String filterName = array.getString(R.styleable.CameraView_cameraFilter); String filterName = array.getString(R.styleable.CameraView_cameraFilter);
if (filterName != null) {
try { try {
//noinspection ConstantConditions
Class<?> filterClass = Class.forName(filterName); Class<?> filterClass = Class.forName(filterName);
filter = (Filter) filterClass.newInstance(); filter = (Filter) filterClass.newInstance();
} catch (Exception ignore) { } catch (Exception ignore) {
filter = new NoFilter(); filter = new NoFilter();
} }
} }
}
@NonNull @NonNull
public Filter getFilter() { public Filter getFilter() {

Loading…
Cancel
Save