diff options
author | Paul Rohde <codelogic@google.com> | 2015-05-20 19:35:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-05-20 19:35:45 +0000 |
commit | 54b9677d12c2ebdea0380319bde1969e1c25dd26 (patch) | |
tree | 03ccd663a40deb1655ed6f71494ca8eef5224b03 /src/com/android/camera/session/CaptureSession.java | |
parent | 79b0ede0e6e54c7c6fc8113b71a1bc89f5bf8d11 (diff) | |
parent | a93b4225a5b965dbd00a85864a7b6ce345a1eefe (diff) | |
download | android_packages_apps_Camera2-54b9677d12c2ebdea0380319bde1969e1c25dd26.tar.gz android_packages_apps_Camera2-54b9677d12c2ebdea0380319bde1969e1c25dd26.tar.bz2 android_packages_apps_Camera2-54b9677d12c2ebdea0380319bde1969e1c25dd26.zip |
am a93b4225: am 76ab7148: Merge "Log capture started and bytes on disk" into ub-camera-haleakala
* commit 'a93b4225a5b965dbd00a85864a7b6ce345a1eefe':
Log capture started and bytes on disk
Diffstat (limited to 'src/com/android/camera/session/CaptureSession.java')
-rw-r--r-- | src/com/android/camera/session/CaptureSession.java | 61 |
1 files changed, 56 insertions, 5 deletions
diff --git a/src/com/android/camera/session/CaptureSession.java b/src/com/android/camera/session/CaptureSession.java index 7b2808904..0dff1a1b3 100644 --- a/src/com/android/camera/session/CaptureSession.java +++ b/src/com/android/camera/session/CaptureSession.java @@ -23,9 +23,13 @@ import android.net.Uri; import com.android.camera.exif.ExifInterface; import com.android.camera.stats.CaptureSessionStatsCollector; import com.android.camera.util.Size; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Optional; import com.google.common.util.concurrent.ListenableFuture; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + /** * A session is an item that is in progress of being created and saved, such as * a photo sphere or HDR+ photo. @@ -58,6 +62,45 @@ public interface CaptureSession { public void onStatusMessageChanged(int messageId); } + /** + * Classes implementing this interface can listen to progress updates of + * this session. + */ + public static interface ImageLifecycleListener { + /** + * Occurs when, for a particular image type, an image capture has + * started. This method is always executed, and will always be called + * first. + */ + public void onCaptureStarted(); + + /** + * Occurs when the tiny thumbnail bytes are received. + */ + public void onTinyThumb(); + + /** + * Occurs when the medium thumbnail bytes are received. + */ + public void onMediumThumb(); + + /** + * Occurs when rendering/processing/encoding starts for the full size image. + */ + public void onProcessingStarted(); + + /** + * Occurs when the rendering/processing/encoding for the full size image + * is completed. + */ + public void onProcessingComplete(); + + /** + * This occurs after all the bytes are physically on disk. + */ + public void onCapturePersisted(); + } + /** Returns the title/name of this session. */ public String getTitle(); @@ -109,42 +152,50 @@ public interface CaptureSession { /** * Starts an empty session with the given placeholder size. * - * @param mPictureSize the size, in pixels of the empty placeholder. + * @param listener receives events as the session progresses. + * @param pictureSize the size, in pixels of the empty placeholder. */ - public void startEmpty(Size mPictureSize); + public void startEmpty(@Nullable ImageLifecycleListener listener, @Nonnull Size pictureSize); /** * Starts the session by adding a placeholder to the filmstrip and adding * notifications. * + * @param listener receives events as the session progresses. * @param placeholder a valid encoded bitmap to be used as the placeholder. * @param progressMessageId the message to be used to the progress * notification initially. This can later be changed using * {@link #setProgressMessage(int)}. */ - public void startSession(byte[] placeholder, int progressMessageId); + public void startSession(@Nullable ImageLifecycleListener listener, @Nonnull byte[] placeholder, + int progressMessageId); /** * Starts the session by adding a placeholder to the filmstrip and adding * notifications. * + * @param listener receives events as the session progresses. * @param placeholder a valid bitmap to be used as the placeholder. * @param progressMessageId the message to be used to the progress * notification initially. This can later be changed using * {@link #setProgressMessage(int)}. */ - public void startSession(Bitmap placeholder, int progressMessageId); + @VisibleForTesting + public void startSession(@Nullable ImageLifecycleListener listener, @Nonnull Bitmap placeholder, + int progressMessageId); /** * Starts the session by marking the item as in-progress and adding * notifications. * + * @param listener receives events as the session progresses. * @param uri the URI of the item to be re-processed. * @param progressMessageId the message to be used to the progress * notification initially. This can later be changed using * {@link #setProgressMessage(int)}. */ - public void startSession(Uri uri, int progressMessageId); + public void startSession(@Nullable ImageLifecycleListener listener, @Nonnull Uri uri, + int progressMessageId); /** * Cancel the session without a final result. The session will be removed |