Merge "Added IOException to WaveformData constructor"
This commit is contained in:
committed by
Android (Google) Code Review
commit
23c430ca75
@@ -450,7 +450,7 @@ public class AudioTrack {
|
||||
/**
|
||||
* @return The waveform data
|
||||
*/
|
||||
public WaveformData getWaveformData() {
|
||||
public WaveformData getWaveformData() throws IOException {
|
||||
if (mWaveformData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ public class MediaVideoItem extends MediaItem {
|
||||
/**
|
||||
* @return The waveform data
|
||||
*/
|
||||
public WaveformData getWaveformData() {
|
||||
public WaveformData getWaveformData() throws IOException {
|
||||
if (mWaveformData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
package android.media.videoeditor;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This class allows to render an "alpha blending" transition according to a
|
||||
@@ -71,6 +74,7 @@ public class TransitionAlpha extends Transition {
|
||||
* projects folder (the parent folder for all projects).
|
||||
* @param blendingPercent The blending percent applied
|
||||
* @param invert true to invert the direction of the alpha blending
|
||||
*
|
||||
* @throws IllegalArgumentException if behavior is not supported, or if
|
||||
* direction are not supported.
|
||||
*/
|
||||
@@ -79,6 +83,10 @@ public class TransitionAlpha extends Transition {
|
||||
int blendingPercent, boolean invert) {
|
||||
super(transitionId, afterMediaItem, beforeMediaItem, durationMs, behavior);
|
||||
|
||||
if (!new File(maskFilename).exists()) {
|
||||
throw new IllegalArgumentException("Invalid mask file name: " + maskFilename);
|
||||
}
|
||||
|
||||
mMaskFilename = maskFilename;
|
||||
mBlendingPercent = blendingPercent;
|
||||
mIsInvert = invert;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WaveformData {
|
||||
*
|
||||
* @param audioWaveformFilename The name of the audio waveform file
|
||||
*/
|
||||
WaveformData(String audioWaveformFilename) {
|
||||
WaveformData(String audioWaveformFilename) throws IOException {
|
||||
// TODO: Read these values from the file
|
||||
mFrameDurationMs = 20;
|
||||
mFramesCount = 300000 / mFrameDurationMs;
|
||||
|
||||
Reference in New Issue
Block a user