summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmedia/java/android/media/videoeditor/VideoEditor.java30
-rwxr-xr-xmedia/java/android/media/videoeditor/VideoEditorFactory.java2
-rw-r--r--media/java/android/media/videoeditor/VideoEditorTestImpl.java2
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 64d32298000f..37bb661216b3 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 41eed164df36..5c243edf0121 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 ca896c336182..50e4aaf89613 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()) {