diff --git a/media/java/android/media/videoeditor/VideoEditor.java b/media/java/android/media/videoeditor/VideoEditor.java index 00143ad572dec..64d32298000f4 100755 --- a/media/java/android/media/videoeditor/VideoEditor.java +++ b/media/java/android/media/videoeditor/VideoEditor.java @@ -125,6 +125,43 @@ public interface VideoEditor { */ public void save() throws IOException; + /** + * Create the output movie based on all media items added and the applied + * storyboard items. This method can take a long time to execute and is + * blocking. The application will receive progress notifications via the + * ExportProgressListener. Specific implementations may not support multiple + * simultaneous export operations. Note that invoking methods which would + * change the contents of the output movie throw an IllegalStateException + * while an export operation is pending. + * + * The audio and video codecs are automatically selected by the underlying + * implementation. + * + * @param filename The output file name (including the full path) + * @param height The height of the output video file. The supported values + * for height are described in the MediaProperties class, for + * example: HEIGHT_480. The width will be automatically computed + * according to the aspect ratio provided by + * {@link #setAspectRatio(int)} + * @param bitrate The bitrate of the output video file. This is approximate + * value for the output movie. Supported bitrate values are + * described in the MediaProperties class for example: + * BITRATE_384K + * @param listener The listener for progress notifications. Use null if + * export progress notifications are not needed. + * @throws IllegalArgumentException if height or bitrate are not supported + * or if the audio or video codecs are not supported + * @throws IOException if output file cannot be created + * @throws IllegalStateException if a preview or an export is in progress or + * if no MediaItem has been added + * @throws CancellationException if export is canceled by calling + * {@link #cancelExport()} + * @throws UnsupportOperationException if multiple simultaneous export() are + * not allowed + */ + public void export(String filename, int height, int bitrate, ExportProgressListener listener) + throws IOException; + /** * Create the output movie based on all media items added and the applied * storyboard items. This method can take a long time to execute and is diff --git a/media/java/android/media/videoeditor/VideoEditorTestImpl.java b/media/java/android/media/videoeditor/VideoEditorTestImpl.java index 60d3f23c9e75a..b12a4e93ec10b 100644 --- a/media/java/android/media/videoeditor/VideoEditorTestImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorTestImpl.java @@ -1031,6 +1031,13 @@ public class VideoEditorTestImpl implements VideoEditor { public void cancelExport(String filename) { } + /* + * {@inheritDoc} + */ + public void export(String filename, int height, int bitrate, ExportProgressListener listener) + throws IOException { + } + /* * {@inheritDoc} */