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:
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user