diff options
author | Hong Teng <hongteng@google.com> | 2011-12-02 09:32:02 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-12-02 09:32:02 -0800 |
commit | 613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0 (patch) | |
tree | a81e8f435c3db8d7b1f4705f7c7154c333d681fb /media/java | |
parent | e21dabf654e3d90e50e95174d5e9670bc930c194 (diff) | |
parent | 63149c81adf79f43c6508647614247277f8052e2 (diff) | |
download | frameworks_base-613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0.zip frameworks_base-613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0.tar.gz frameworks_base-613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0.tar.bz2 |
Merge "Fixd for 5490443 Native crash while exporting a video - Add new onError callback to PreviewProgressListener, which is used to indicate video editor application for the error that has occurred during priviewing. With this modification, the application must implement the onError method, and then VideoEditorPreviewTest.java is changed accordingly." into ics-mr1
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/videoeditor/MediaArtistNativeHelper.java | 4 | ||||
-rwxr-xr-x | media/java/android/media/videoeditor/VideoEditor.java | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java index 03ae62a..4756078 100644 --- a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java +++ b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java @@ -1845,7 +1845,7 @@ class MediaArtistNativeHelper { @SuppressWarnings("unused") private void onPreviewProgressUpdate(int progress, boolean isFinished, - boolean updateOverlay, String filename, int renderingMode) { + boolean updateOverlay, String filename, int renderingMode, int error) { if (mPreviewProgressListener != null) { if (mIsFirstProgress) { mPreviewProgressListener.onStart(mVideoEditor); @@ -1870,6 +1870,8 @@ class MediaArtistNativeHelper { if (isFinished) { mPreviewProgressListener.onStop(mVideoEditor); + } else if (error != 0) { + mPreviewProgressListener.onError(mVideoEditor, error); } else { mPreviewProgressListener.onProgress(mVideoEditor, progress, overlayData); } diff --git a/media/java/android/media/videoeditor/VideoEditor.java b/media/java/android/media/videoeditor/VideoEditor.java index 424e436..08d27d4 100755 --- a/media/java/android/media/videoeditor/VideoEditor.java +++ b/media/java/android/media/videoeditor/VideoEditor.java @@ -107,6 +107,17 @@ public interface VideoEditor { * @param videoEditor The VideoEditor instance */ public void onStop(VideoEditor videoEditor); + + /** + * This method notifies the listener when error has occurred during + * previewing a project. + * + * @param videoEditor The VideoEditor instance + * @param error The error that has occurred + * FIXME: We should pass well-defined error code to the application; + * but for now, we just pass whatever error code reported by the native layer. + */ + public void onError(VideoEditor videoEditor, int error); } /** |