From 299fd76472a620de63406e6b91b23cc63fc64f64 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Wed, 10 Jul 2019 21:49:21 -0300 Subject: [PATCH] Release version 2.0.0-beta06 (#495) * Bump version * Fix javadocs --- README.md | 2 +- cameraview/build.gradle | 4 ++-- .../otaliastudios/cameraview/engine/CameraEngine.java | 5 +++++ .../com/otaliastudios/cameraview/frame/FrameManager.java | 5 +++++ .../cameraview/picture/PictureRecorder.java | 3 ++- .../otaliastudios/cameraview/preview/CameraPreview.java | 4 +++- .../cameraview/preview/GlCameraPreview.java | 2 +- .../cameraview/video/Full2VideoRecorder.java | 2 ++ .../otaliastudios/cameraview/video/VideoRecorder.java | 2 ++ .../cameraview/video/encoding/MediaEncoder.java | 9 +++++++++ docs/_posts/2018-12-20-changelog.md | 3 ++- docs/_posts/2018-12-20-install.md | 2 +- 12 files changed, 35 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2947bcff..78f591cd 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ CameraView is a well documented, high-level library that makes capturing picture addressing most of the common issues and needs, and still leaving you with flexibility where needed. ```groovy -compile 'com.otaliastudios:cameraview:2.0.0-beta05' +compile 'com.otaliastudios:cameraview:2.0.0-beta06' ``` - Fast & reliable diff --git a/cameraview/build.gradle b/cameraview/build.gradle index 7e806451..3272c5db 100644 --- a/cameraview/build.gradle +++ b/cameraview/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' // Required by bintray -version = '2.0.0-beta05' +version = '2.0.0-beta06' group = 'com.otaliastudios' //region android dependencies @@ -145,7 +145,7 @@ task javadoc(type: Javadoc) { } exclude '**/BuildConfig.java' exclude '**/R.java' - exclude '**/internal/**' + exclude '**/internal/**' // This excludes our internal folder! } task javadocJar(type: Jar, dependsOn: javadoc) { diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraEngine.java b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraEngine.java index 17bbf096..f07e1048 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraEngine.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraEngine.java @@ -1270,6 +1270,9 @@ public abstract class CameraEngine implements * * I could not find the same evidence for videos, but I would say that the same things should * apply, despite the capturing mechanism being different. + * + * @param reference the reference system + * @return the uncropped snapshot size */ @Nullable public final Size getUncroppedSnapshotSize(@NonNull Reference reference) { @@ -1299,6 +1302,8 @@ public abstract class CameraEngine implements * dimensions. * But when it does, the {@link CameraPreview.SurfaceCallback} should be called, * and this should be refreshed. + * + * @return the capture size */ @NonNull @SuppressWarnings("WeakerAccess") diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/frame/FrameManager.java b/cameraview/src/main/java/com/otaliastudios/cameraview/frame/FrameManager.java index d3f1bcc8..de1b8dd9 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/frame/FrameManager.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/frame/FrameManager.java @@ -155,6 +155,11 @@ public class FrameManager { * * In Camera1, this is always respected thanks to its internals. * + * @param data data + * @param time timestamp + * @param rotation rotation + * @param previewSize preview size + * @param previewFormat format * @return a new frame */ @NonNull diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/picture/PictureRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/picture/PictureRecorder.java index 96fb4882..b296777a 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/picture/PictureRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/picture/PictureRecorder.java @@ -27,7 +27,8 @@ public abstract class PictureRecorder { /** * Picture was taken or there was some error, if * the result is null. - * @param result the result or null if there was some error. + * @param result the result or null if there was some error + * @param error the error or null if there wasn't any */ void onPictureResult(@Nullable PictureResult.Stub result, @Nullable Exception error); } diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/preview/CameraPreview.java b/cameraview/src/main/java/com/otaliastudios/cameraview/preview/CameraPreview.java index 1f09c94c..fab49ca5 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/preview/CameraPreview.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/preview/CameraPreview.java @@ -236,12 +236,14 @@ public abstract class CameraPreview { public void onDestroy() {} /** - * Here we must crop the visible part by applying a > 1 scale to one of our + * Here we must crop the visible part by applying a scale greater than 1 to one of our * dimensions. This way our internal aspect ratio (mOutputSurfaceWidth / mOutputSurfaceHeight) * will match the preview size aspect ratio (mInputStreamWidth / mInputStreamHeight). * * There might still be some absolute difference (e.g. same ratio but bigger / smaller). * However that should be already managed by the framework. + * + * @param op the op */ protected void crop(@NonNull Op op) { // The base implementation does not support cropping. diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/preview/GlCameraPreview.java b/cameraview/src/main/java/com/otaliastudios/cameraview/preview/GlCameraPreview.java index 5cad6af9..947114e0 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/preview/GlCameraPreview.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/preview/GlCameraPreview.java @@ -51,7 +51,7 @@ import javax.microedition.khronos.opengles.GL10; * - The SurfaceTexture has buffers of data of mInputStreamSize * - The SurfaceView hosts a view (and a surface) of size mOutputSurfaceSize. * These are determined by the CameraView.onMeasure method. - * - We have a GL rich texture to be drawn (in the given method & thread). + * - We have a GL rich texture to be drawn (in the given method and thread). * * This class will provide rendering callbacks to anyone who registers a {@link RendererFrameCallback}. * Callbacks are guaranteed to be called on the renderer thread, which means that we can fetch diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/video/Full2VideoRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/video/Full2VideoRecorder.java index 7369a96e..060c56b0 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/video/Full2VideoRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/video/Full2VideoRecorder.java @@ -65,6 +65,8 @@ public class Full2VideoRecorder extends FullVideoRecorder { /** * This method should be called just once. + * + * @param stub the video stub * @return a surface * @throws PrepareException if prepare went wrong */ diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/video/VideoRecorder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/video/VideoRecorder.java index 43919e60..08f8870d 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/video/VideoRecorder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/video/VideoRecorder.java @@ -42,6 +42,8 @@ public abstract class VideoRecorder { /** * Starts recording a video. + * + * @param stub the video stub */ public final void start(@NonNull VideoResult.Stub stub) { mResult = stub; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoder.java b/cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoder.java index 71176f3d..2fa7b0f0 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoder.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoder.java @@ -196,6 +196,9 @@ abstract class MediaEncoder { /** * Returns a new input buffer and index, waiting at most {@link #INPUT_TIMEOUT_US} if none is available. * Callers should check the boolean result - true if the buffer was filled. + * + * @param holder the input buffer holder + * @return true if acquired */ @SuppressWarnings("WeakerAccess") protected boolean tryAcquireInputBuffer(@NonNull InputBuffer holder) { @@ -215,6 +218,8 @@ abstract class MediaEncoder { /** * Returns a new input buffer and index, waiting indefinitely if none is available. * The buffer should be written into, then the index should be passed to {@link #encodeInputBuffer(InputBuffer)}. + * + * @param holder the input buffer holder */ @SuppressWarnings({"StatementWithEmptyBody", "WeakerAccess"}) protected void acquireInputBuffer(@NonNull InputBuffer holder) { @@ -223,6 +228,8 @@ abstract class MediaEncoder { /** * Encode data into the {@link #mMediaCodec}. + * + * @param buffer the input buffer */ @SuppressWarnings("WeakerAccess") protected void encodeInputBuffer(InputBuffer buffer) { @@ -253,6 +260,8 @@ abstract class MediaEncoder { * If drainAll is not set, this returns after TIMEOUT_USEC if there is no more data to drain. * If drainAll is set, we wait until we see EOS on the output. * Calling this with drainAll set should be done once, right before stopping the muxer. + * + * @param drainAll whether to drain all */ @SuppressLint("LogNotTimber") @SuppressWarnings("WeakerAccess") diff --git a/docs/_posts/2018-12-20-changelog.md b/docs/_posts/2018-12-20-changelog.md index 1f8c0aed..80b42004 100644 --- a/docs/_posts/2018-12-20-changelog.md +++ b/docs/_posts/2018-12-20-changelog.md @@ -8,10 +8,11 @@ order: 3 New versions are released through GitHub, so the reference page is the [GitHub Releases](https://github.com/natario1/CameraView/releases) page. -### v2.0.0-beta06 (to be released) +### v2.0.0-beta06 - New: Full featured Camera2 integration! Use `cameraExperimental="true"` and `cameraEngine="camera2"` to test this out. ([#490][490]) - Improvement: we now choose a video recording profile that is compatible with the chosen size. Should fix some video recording issues. ([#477][477]) +- Improvement: most internals are now open to be accessed by subclassing. Feel free to open PRs with more protected methods to be overriden. ([#494][494]) - **Breaking change**: some public classes have been moved to different packages. See [table here](../extra/v1-migration-guide.html#repackaging). ([#482][482]) - **Breaking change**: the listener methods `onFocusStart` and `onFocusEnd` are now called `onAutoFocusStart` and `onAutoFocusEnd`. ([#484][484]) - **Breaking change**: the gesture actions `focus` and `focusWithMarker` have been removed and replaced by `autoFocus`, which shows no marker. ([#484][484]) diff --git a/docs/_posts/2018-12-20-install.md b/docs/_posts/2018-12-20-install.md index ab84bb9a..534e7850 100644 --- a/docs/_posts/2018-12-20-install.md +++ b/docs/_posts/2018-12-20-install.md @@ -24,7 +24,7 @@ allprojects { Then simply download the latest version: ```groovy -api 'com.otaliastudios:cameraview:2.0.0-beta05' +api 'com.otaliastudios:cameraview:2.0.0-beta06' ``` No other configuration steps are needed. \ No newline at end of file