Loading media/java/android/media/videoeditor/VideoEditorImpl.java +22 −23 Original line number Original line Diff line number Diff line Loading @@ -424,7 +424,7 @@ public class VideoEditorImpl implements VideoEditor { mMediaItems, mTransitions, mAudioTracks, mMediaItems, mTransitions, mAudioTracks, listener); listener); } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in export"); Log.e(TAG, "Sem acquire NOT successful in export"); } finally { } finally { mExportSemaphore.release(); mExportSemaphore.release(); } } Loading @@ -444,7 +444,7 @@ public class VideoEditorImpl implements VideoEditor { mAudioTracks, listener); mAudioTracks, listener); } } } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in previewStoryBoard"); Log.e(TAG, "Sem acquire NOT successful in previewStoryBoard"); } finally { } finally { if (semAcquireDone) { if (semAcquireDone) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Loading Loading @@ -891,7 +891,7 @@ public class VideoEditorImpl implements VideoEditor { } } } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in renderPreviewFrame"); Log.e(TAG, "Sem acquire NOT successful in renderPreviewFrame"); } } finally { finally { if (semAcquireDone) { if (semAcquireDone) { Loading Loading @@ -1567,16 +1567,14 @@ public class VideoEditorImpl implements VideoEditor { mPreviewSemaphore.acquire(); mPreviewSemaphore.acquire(); semAcquireDone = true; semAcquireDone = true; } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in startPreview"); Log.e(TAG, "Sem acquire NOT successful in startPreview"); } } if (semAcquireDone) { if (semAcquireDone) { Surface mSurface = surfaceHolder.getSurface(); Surface mSurface = surfaceHolder.getSurface(); if (mSurface == null) { if (mSurface == null) { Log.e("VideoEditoeImpl", throw new RuntimeException("Surface could not be retrieved from surface holder"); "Surface could not be retrieved from surface holder"); throw new RuntimeException(); } } if (mMediaItems.size() > 0) { if (mMediaItems.size() > 0) { Loading @@ -1588,15 +1586,15 @@ public class VideoEditorImpl implements VideoEditor { mPreviewInProgress = true; mPreviewInProgress = true; } catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Log.e("VideoEditorImpl", "Illegal Argument exception in do preview"); Log.e(TAG, "Illegal Argument exception in do preview"); throw ex; throw ex; } catch (IllegalStateException ex) { } catch (IllegalStateException ex) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Log.e("VideoEditorImpl", "Illegal State exception in do preview"); Log.e(TAG, "Illegal State exception in do preview"); throw ex; throw ex; } catch (RuntimeException ex) { } catch (RuntimeException ex) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Log.e("VideoEditorImpl", "Runtime exception in do preview"); Log.e(TAG, "Runtime exception in do preview"); throw ex; throw ex; } } } } Loading Loading @@ -1732,7 +1730,7 @@ public class VideoEditorImpl implements VideoEditor { if (mMediaItems.size() > 0) { if (mMediaItems.size() > 0) { MediaItem mI = mMediaItems.get(0); MediaItem mI = mMediaItems.get(0); /* /* * Lets initialise the width for default aspect ratio i.e 16:9 * Lets initialiZe the width for default aspect ratio i.e 16:9 */ */ int height = 480; int height = 480; int width = 854; int width = 854; Loading Loading @@ -1784,18 +1782,19 @@ public class VideoEditorImpl implements VideoEditor { * and needs to be cleared. * and needs to be cleared. */ */ public void clearSurface(SurfaceHolder surfaceHolder) { public void clearSurface(SurfaceHolder surfaceHolder) { if (surfaceHolder == null) { if (surfaceHolder == null) { throw new IllegalArgumentException(); throw new IllegalArgumentException("Invalid surface holder"); } } Surface surface = surfaceHolder.getSurface(); final Surface surface = surfaceHolder.getSurface(); if (surface == null) { if (surface == null) { Log.e("VideoEditorImpl", throw new RuntimeException("Surface could not be retrieved from surface holder"); "Surface could not be retrieved from surface holder"); throw new RuntimeException(); } } if (mMANativeHelper != null) { mMANativeHelper.clearPreviewSurface(surface); mMANativeHelper.clearPreviewSurface(surface); } else { Log.w(TAG, "Native helper was not ready!"); } } } } } Loading
media/java/android/media/videoeditor/VideoEditorImpl.java +22 −23 Original line number Original line Diff line number Diff line Loading @@ -424,7 +424,7 @@ public class VideoEditorImpl implements VideoEditor { mMediaItems, mTransitions, mAudioTracks, mMediaItems, mTransitions, mAudioTracks, listener); listener); } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in export"); Log.e(TAG, "Sem acquire NOT successful in export"); } finally { } finally { mExportSemaphore.release(); mExportSemaphore.release(); } } Loading @@ -444,7 +444,7 @@ public class VideoEditorImpl implements VideoEditor { mAudioTracks, listener); mAudioTracks, listener); } } } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in previewStoryBoard"); Log.e(TAG, "Sem acquire NOT successful in previewStoryBoard"); } finally { } finally { if (semAcquireDone) { if (semAcquireDone) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Loading Loading @@ -891,7 +891,7 @@ public class VideoEditorImpl implements VideoEditor { } } } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in renderPreviewFrame"); Log.e(TAG, "Sem acquire NOT successful in renderPreviewFrame"); } } finally { finally { if (semAcquireDone) { if (semAcquireDone) { Loading Loading @@ -1567,16 +1567,14 @@ public class VideoEditorImpl implements VideoEditor { mPreviewSemaphore.acquire(); mPreviewSemaphore.acquire(); semAcquireDone = true; semAcquireDone = true; } catch (InterruptedException ex) { } catch (InterruptedException ex) { Log.e("VideoEditorImpl", "Sem acquire NOT successful in startPreview"); Log.e(TAG, "Sem acquire NOT successful in startPreview"); } } if (semAcquireDone) { if (semAcquireDone) { Surface mSurface = surfaceHolder.getSurface(); Surface mSurface = surfaceHolder.getSurface(); if (mSurface == null) { if (mSurface == null) { Log.e("VideoEditoeImpl", throw new RuntimeException("Surface could not be retrieved from surface holder"); "Surface could not be retrieved from surface holder"); throw new RuntimeException(); } } if (mMediaItems.size() > 0) { if (mMediaItems.size() > 0) { Loading @@ -1588,15 +1586,15 @@ public class VideoEditorImpl implements VideoEditor { mPreviewInProgress = true; mPreviewInProgress = true; } catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Log.e("VideoEditorImpl", "Illegal Argument exception in do preview"); Log.e(TAG, "Illegal Argument exception in do preview"); throw ex; throw ex; } catch (IllegalStateException ex) { } catch (IllegalStateException ex) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Log.e("VideoEditorImpl", "Illegal State exception in do preview"); Log.e(TAG, "Illegal State exception in do preview"); throw ex; throw ex; } catch (RuntimeException ex) { } catch (RuntimeException ex) { mPreviewSemaphore.release(); mPreviewSemaphore.release(); Log.e("VideoEditorImpl", "Runtime exception in do preview"); Log.e(TAG, "Runtime exception in do preview"); throw ex; throw ex; } } } } Loading Loading @@ -1732,7 +1730,7 @@ public class VideoEditorImpl implements VideoEditor { if (mMediaItems.size() > 0) { if (mMediaItems.size() > 0) { MediaItem mI = mMediaItems.get(0); MediaItem mI = mMediaItems.get(0); /* /* * Lets initialise the width for default aspect ratio i.e 16:9 * Lets initialiZe the width for default aspect ratio i.e 16:9 */ */ int height = 480; int height = 480; int width = 854; int width = 854; Loading Loading @@ -1784,18 +1782,19 @@ public class VideoEditorImpl implements VideoEditor { * and needs to be cleared. * and needs to be cleared. */ */ public void clearSurface(SurfaceHolder surfaceHolder) { public void clearSurface(SurfaceHolder surfaceHolder) { if (surfaceHolder == null) { if (surfaceHolder == null) { throw new IllegalArgumentException(); throw new IllegalArgumentException("Invalid surface holder"); } } Surface surface = surfaceHolder.getSurface(); final Surface surface = surfaceHolder.getSurface(); if (surface == null) { if (surface == null) { Log.e("VideoEditorImpl", throw new RuntimeException("Surface could not be retrieved from surface holder"); "Surface could not be retrieved from surface holder"); throw new RuntimeException(); } } if (mMANativeHelper != null) { mMANativeHelper.clearPreviewSurface(surface); mMANativeHelper.clearPreviewSurface(surface); } else { Log.w(TAG, "Native helper was not ready!"); } } } } }