From acf1b4cdde4c8ac240ff08d2595d93eec63ba1df Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Sat, 3 Mar 2018 15:41:12 +0100 Subject: [PATCH] Removed VideoQuality. --- MIGRATION.md | 3 +- README.md | 22 +----- .../cameraview/CameraOptions1Test.java | 4 +- .../cameraview/CameraViewTest.java | 9 --- .../cameraview/IntegrationTest.java | 50 ------------- .../cameraview/MockCameraController.java | 5 -- .../com/otaliastudios/cameraview/Camera1.java | 33 --------- .../com/otaliastudios/cameraview/Camera2.java | 5 -- .../cameraview/CameraController.java | 51 +------------ .../cameraview/CameraOptions.java | 4 +- .../otaliastudios/cameraview/CameraView.java | 43 ++--------- .../cameraview/VideoQuality.java | 73 ------------------- .../otaliastudios/cameraview/CropHelper.java | 1 + .../cameraview/demo/Control.java | 5 -- 14 files changed, 19 insertions(+), 289 deletions(-) delete mode 100644 cameraview/src/main/options/com/otaliastudios/cameraview/VideoQuality.java diff --git a/MIGRATION.md b/MIGRATION.md index da0a4175..b721e534 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -21,4 +21,5 @@ setMode() and cameraMode. - CameraOptions.isVideoSnapshotSupported(): removed, this would be ambiguous now. While in video mode, you can only use takePictureSnapshot(), not takePicture(). -- takePicture(): will now throw an exception if called when Mode == Mode.VIDEO. You can only take snapshots. \ No newline at end of file +- takePicture(): will now throw an exception if called when Mode == Mode.VIDEO. You can only take snapshots. +- VideoQuality: this has been removed. \ No newline at end of file diff --git a/README.md b/README.md index d6cb665c..b06b2378 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ To capture an image just call `CameraView.takePicture()`. Make sure you setup a to handle the image callback. ```java +camera.setMode(Mode.PICTURE); camera.addCameraListener(new CameraListener() { @Override public void onPictureTaken(PictureResult result) { @@ -160,6 +161,7 @@ To capture video just call `CameraView.takeVideo(file)` to start, and the video callback. ```java +camera.setMode(Mode.VIDEO); camera.addCameraListener(new CameraListener() { @Override public void onVideoTaken(VideoResult result) { @@ -427,7 +429,6 @@ Most camera parameters can be controlled through XML attributes or linked method |[`cameraFacing`](#camerafacing)|`setFacing()`|`back` `front`|`back`| |[`cameraFlash`](#cameraflash)|`setFlash()`|`off` `on` `auto` `torch`|`off`| |[`cameraGrid`](#cameragrid)|`setGrid()`|`off` `draw3x3` `draw4x4` `drawPhi`|`off`| -|[`cameraVideoQuality`](#cameravideoquality)|`setVideoQuality()`|`lowest` `highest` `maxQvga` `max480p` `max720p` `max1080p` `max2160p`|`max480p`| |[`cameraVideoCodec`](#cameravideocodec)|`setVideoCodec()`|`deviceDefault` `h263` `h264`|`deviceDefault`| |[`cameraWhiteBalance`](#camerawhitebalance)|`setWhiteBalance()`|`auto` `incandescent` `fluorescent` `daylight` `cloudy`|`auto`| |[`cameraHdr`](#camerahdr)|`setHdr()`|`off` `on`|`off`| @@ -440,9 +441,8 @@ Most camera parameters can be controlled through XML attributes or linked method What to capture - either picture or video. This has a couple of consequences: -- Sizing: picture and preview size are chosen among the available picture or video sizes, - depending on the flag. The picture size is chosen according to the given [size selector](#picture-size). - When `video`, in addition, we try to match the `videoQuality` aspect ratio. +- Sizing: the capture size is chosen among the available picture or video sizes, + depending on the flag. The picture size is chosen according to the given [picture size selector](#picture-size). - Capturing: while in picture mode, `takeVideo` will throw an exception. - Capturing: while in video mode, `takePicture` will throw an exception, but picture snapshots are supported. - Permission behavior: when requesting a `video` session, the record audio permission will be requested. @@ -485,20 +485,6 @@ cameraView.setGrid(Grid.DRAW_4X4); cameraView.setGrid(Grid.DRAW_PHI); ``` -#### cameraVideoQuality - -Sets the desired video quality. - -```java -cameraView.setVideoQuality(VideoQuality.LOWEST); -cameraView.setVideoQuality(VideoQuality.HIGHEST); -cameraView.setVideoQuality(VideoQuality.MAX_QVGA); -cameraView.setVideoQuality(VideoQuality.MAX_480P); -cameraView.setVideoQuality(VideoQuality.MAX_720P); -cameraView.setVideoQuality(VideoQuality.MAX_1080P); -cameraView.setVideoQuality(VideoQuality.MAX_2160P); -``` - #### cameraVideoCodec Sets the encoder for video recordings. diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java index 6c7dc073..1d14d8bd 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java @@ -133,11 +133,11 @@ public class CameraOptions1Test extends BaseTest { CameraOptions o = new CameraOptions(params, false); Collection grids = o.getSupportedControls(Grid.class); - Collection video = o.getSupportedControls(VideoQuality.class); + Collection video = o.getSupportedControls(VideoCodec.class); Collection sessions = o.getSupportedControls(Mode.class); Collection