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

This commit is contained in:
Hong Teng
2011-12-02 09:32:02 -08:00
committed by Android (Google) Code Review
4 changed files with 51 additions and 6 deletions

View File

@ -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);
}

View File

@ -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);
}
/**