diff options
author | Gil Dobjanschi <virgild@google.com> | 2010-12-02 13:39:06 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-12-02 13:39:06 -0800 |
commit | cd023f98fab0f01603f006c3029a73cd820b4678 (patch) | |
tree | 1b06b3ea2f9e22595b967579f0fb095a5ae3354a /media/java | |
parent | e6744db78e1d742516143ca3973b18a93629dbe2 (diff) | |
parent | 786ecf849c57de5400a0d594d3b133758a17a1a0 (diff) | |
download | frameworks_base-cd023f98fab0f01603f006c3029a73cd820b4678.zip frameworks_base-cd023f98fab0f01603f006c3029a73cd820b4678.tar.gz frameworks_base-cd023f98fab0f01603f006c3029a73cd820b4678.tar.bz2 |
Merge "Added a callback interface to the generatePreview method."
Diffstat (limited to 'media/java')
3 files changed, 31 insertions, 3 deletions
diff --git a/media/java/android/media/videoeditor/VideoEditor.java b/media/java/android/media/videoeditor/VideoEditor.java index 64d3229..37bb661 100755 --- a/media/java/android/media/videoeditor/VideoEditor.java +++ b/media/java/android/media/videoeditor/VideoEditor.java @@ -98,6 +98,31 @@ public interface VideoEditor { }
/**
+ * This listener interface is used by the VideoEditor to emit export status
+ * notifications.
+ * {@link #generatePreview(MediaProcessingProgressListener listener)}
+ */
+ public interface MediaProcessingProgressListener {
+ // Values used for the action parameter
+ public static final int ACTION_ENCODE = 1;
+ public static final int ACTION_DECODE = 2;
+
+ /**
+ * This method notifies the listener of the progress status of
+ * processing a media object such as a Transition, AudioTrack or a
+ * media image item (when Ken Burns effect is applied).
+ * This method may be called maximum 100 times for one operation.
+ *
+ * @param object The object that is being processed such as a
+ * Transition or AudioTrack
+ * @param action The type of processing being performed
+ * @param progress The progress in %. At the beginning of the operation,
+ * this value is set to 0; at the end, the value is set to 100.
+ */
+ public void onProgress(Object item, int action, int progress);
+ }
+
+ /**
* @return The path where the VideoEditor stores all files related to the
* project
*/
@@ -496,8 +521,11 @@ public interface VideoEditor { * This method must be called after the aspect ratio of the project changes
* and before startPreview is called. Note that this method may block for
* an extensive period of time.
+ *
+ * @param listener The listener interface which will be used to notify
+ * the caller of the progress of each storyboard item being processed.
*/
- public void generatePreview();
+ public void generatePreview(MediaProcessingProgressListener listener);
/**
* Start the preview of all the storyboard items applied on all MediaItems
diff --git a/media/java/android/media/videoeditor/VideoEditorFactory.java b/media/java/android/media/videoeditor/VideoEditorFactory.java index 41eed16..5c243ed 100755 --- a/media/java/android/media/videoeditor/VideoEditorFactory.java +++ b/media/java/android/media/videoeditor/VideoEditorFactory.java @@ -115,7 +115,7 @@ public class VideoEditorFactory { final VideoEditor videoEditor = (VideoEditor)ct.newInstance(arglist); if (generatePreview) { - videoEditor.generatePreview(); + videoEditor.generatePreview(null); } return videoEditor; } diff --git a/media/java/android/media/videoeditor/VideoEditorTestImpl.java b/media/java/android/media/videoeditor/VideoEditorTestImpl.java index ca896c3..50e4aaf 100644 --- a/media/java/android/media/videoeditor/VideoEditorTestImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorTestImpl.java @@ -1055,7 +1055,7 @@ public class VideoEditorTestImpl implements VideoEditor { /* * {@inheritDoc} */ - public void generatePreview() { + public void generatePreview(MediaProcessingProgressListener listener) { // Generate all the needed transitions for (Transition transition : mTransitions) { if (!transition.isGenerated()) { |