Loading media/java/android/media/videoeditor/AudioTrack.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,6 @@ public class AudioTrack { private final int mAudioType; private final int mAudioType; private final int mAudioBitrate; private final int mAudioBitrate; private final int mAudioSamplingFrequency; private final int mAudioSamplingFrequency; /** /** * Ducking variables * Ducking variables */ */ Loading Loading @@ -127,11 +126,17 @@ public class AudioTrack { int duckThreshold, int duckedTrackVolume, int duckThreshold, int duckedTrackVolume, String audioWaveformFilename) throws IOException { String audioWaveformFilename) throws IOException { Properties properties = null; Properties properties = null; File file = new File(filename); File file = new File(filename); if (!file.exists()) { if (!file.exists()) { throw new IOException(filename + " not found ! "); throw new IOException(filename + " not found ! "); } } /*Compare file_size with 2GB*/ if (VideoEditor.MAX_SUPPORTED_FILE_SIZE <= file.length()) { throw new IllegalArgumentException("File size is more than 2GB"); } if (editor instanceof VideoEditorImpl) { if (editor instanceof VideoEditorImpl) { mMANativeHelper = ((VideoEditorImpl)editor).getNativeContext(); mMANativeHelper = ((VideoEditorImpl)editor).getNativeContext(); } else { } else { Loading media/java/android/media/videoeditor/MediaItem.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -131,6 +131,15 @@ public abstract class MediaItem { if (filename == null) { if (filename == null) { throw new IllegalArgumentException("MediaItem : filename is null"); throw new IllegalArgumentException("MediaItem : filename is null"); } } File file = new File(filename); if (!file.exists()) { throw new IOException(filename + " not found ! "); } /*Compare file_size with 2GB*/ if (VideoEditor.MAX_SUPPORTED_FILE_SIZE <= file.length()) { throw new IllegalArgumentException("File size is more than 2GB"); } mUniqueId = mediaItemId; mUniqueId = mediaItemId; mFilename = filename; mFilename = filename; mRenderingMode = renderingMode; mRenderingMode = renderingMode; Loading media/java/android/media/videoeditor/VideoEditor.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -67,6 +67,11 @@ public interface VideoEditor { */ */ public final static int DURATION_OF_STORYBOARD = -1; public final static int DURATION_OF_STORYBOARD = -1; /** * Maximum supported file size */ public static final long MAX_SUPPORTED_FILE_SIZE = 2147483648L; /** /** * This listener interface is used by the VideoEditor to emit preview * This listener interface is used by the VideoEditor to emit preview * progress notifications. This callback should be invoked after the number * progress notifications. This callback should be invoked after the number Loading media/java/android/media/videoeditor/VideoEditorImpl.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,6 @@ public class VideoEditorImpl implements VideoEditor { private static final String ATTR_OVERLAY_FRAME_HEIGHT = "overlay_frame_height"; private static final String ATTR_OVERLAY_FRAME_HEIGHT = "overlay_frame_height"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_WIDTH = "resized_RGBframe_width"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_WIDTH = "resized_RGBframe_width"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_HEIGHT = "resized_RGBframe_height"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_HEIGHT = "resized_RGBframe_height"; private static final int ENGINE_ACCESS_MAX_TIMEOUT_MS = 500; private static final int ENGINE_ACCESS_MAX_TIMEOUT_MS = 500; /* /* * Instance variables * Instance variables Loading Loading @@ -437,6 +436,12 @@ public class VideoEditorImpl implements VideoEditor { throw new IllegalArgumentException(message); throw new IllegalArgumentException(message); } } } } computeTimelineDuration(); final long audioBitrate = MediaArtistNativeHelper.Bitrate.BR_96_KBPS; final long fileSize = (mDurationMs * (bitrate + audioBitrate)) / 8000; if (MAX_SUPPORTED_FILE_SIZE <= fileSize) { throw new IllegalStateException("Export Size is more than 2GB"); } boolean semAcquireDone = false; boolean semAcquireDone = false; try { try { Loading Loading
media/java/android/media/videoeditor/AudioTrack.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,6 @@ public class AudioTrack { private final int mAudioType; private final int mAudioType; private final int mAudioBitrate; private final int mAudioBitrate; private final int mAudioSamplingFrequency; private final int mAudioSamplingFrequency; /** /** * Ducking variables * Ducking variables */ */ Loading Loading @@ -127,11 +126,17 @@ public class AudioTrack { int duckThreshold, int duckedTrackVolume, int duckThreshold, int duckedTrackVolume, String audioWaveformFilename) throws IOException { String audioWaveformFilename) throws IOException { Properties properties = null; Properties properties = null; File file = new File(filename); File file = new File(filename); if (!file.exists()) { if (!file.exists()) { throw new IOException(filename + " not found ! "); throw new IOException(filename + " not found ! "); } } /*Compare file_size with 2GB*/ if (VideoEditor.MAX_SUPPORTED_FILE_SIZE <= file.length()) { throw new IllegalArgumentException("File size is more than 2GB"); } if (editor instanceof VideoEditorImpl) { if (editor instanceof VideoEditorImpl) { mMANativeHelper = ((VideoEditorImpl)editor).getNativeContext(); mMANativeHelper = ((VideoEditorImpl)editor).getNativeContext(); } else { } else { Loading
media/java/android/media/videoeditor/MediaItem.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -131,6 +131,15 @@ public abstract class MediaItem { if (filename == null) { if (filename == null) { throw new IllegalArgumentException("MediaItem : filename is null"); throw new IllegalArgumentException("MediaItem : filename is null"); } } File file = new File(filename); if (!file.exists()) { throw new IOException(filename + " not found ! "); } /*Compare file_size with 2GB*/ if (VideoEditor.MAX_SUPPORTED_FILE_SIZE <= file.length()) { throw new IllegalArgumentException("File size is more than 2GB"); } mUniqueId = mediaItemId; mUniqueId = mediaItemId; mFilename = filename; mFilename = filename; mRenderingMode = renderingMode; mRenderingMode = renderingMode; Loading
media/java/android/media/videoeditor/VideoEditor.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -67,6 +67,11 @@ public interface VideoEditor { */ */ public final static int DURATION_OF_STORYBOARD = -1; public final static int DURATION_OF_STORYBOARD = -1; /** * Maximum supported file size */ public static final long MAX_SUPPORTED_FILE_SIZE = 2147483648L; /** /** * This listener interface is used by the VideoEditor to emit preview * This listener interface is used by the VideoEditor to emit preview * progress notifications. This callback should be invoked after the number * progress notifications. This callback should be invoked after the number Loading
media/java/android/media/videoeditor/VideoEditorImpl.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,6 @@ public class VideoEditorImpl implements VideoEditor { private static final String ATTR_OVERLAY_FRAME_HEIGHT = "overlay_frame_height"; private static final String ATTR_OVERLAY_FRAME_HEIGHT = "overlay_frame_height"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_WIDTH = "resized_RGBframe_width"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_WIDTH = "resized_RGBframe_width"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_HEIGHT = "resized_RGBframe_height"; private static final String ATTR_OVERLAY_RESIZED_RGB_FRAME_HEIGHT = "resized_RGBframe_height"; private static final int ENGINE_ACCESS_MAX_TIMEOUT_MS = 500; private static final int ENGINE_ACCESS_MAX_TIMEOUT_MS = 500; /* /* * Instance variables * Instance variables Loading Loading @@ -437,6 +436,12 @@ public class VideoEditorImpl implements VideoEditor { throw new IllegalArgumentException(message); throw new IllegalArgumentException(message); } } } } computeTimelineDuration(); final long audioBitrate = MediaArtistNativeHelper.Bitrate.BR_96_KBPS; final long fileSize = (mDurationMs * (bitrate + audioBitrate)) / 8000; if (MAX_SUPPORTED_FILE_SIZE <= fileSize) { throw new IllegalStateException("Export Size is more than 2GB"); } boolean semAcquireDone = false; boolean semAcquireDone = false; try { try { Loading