diff options
Diffstat (limited to 'media/java')
5 files changed, 28 insertions, 16 deletions
diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java index 8da7eaa..3ebad00 100755 --- a/media/java/android/media/videoeditor/AudioTrack.java +++ b/media/java/android/media/videoeditor/AudioTrack.java @@ -183,11 +183,13 @@ public class AudioTrack { */
@SuppressWarnings("unused")
private AudioTrack() throws IOException {
- this(null, null);
+ this(null, null, null);
}
/**
* Constructor
+ *
+ * @param editor The video editor reference
* @param audioTrackId The audio track id
* @param filename The absolute file name
*
@@ -195,7 +197,8 @@ public class AudioTrack { * @throws IllegalArgumentException if file format is not supported or if
* the codec is not supported
*/
- public AudioTrack(String audioTrackId, String filename) throws IOException {
+ public AudioTrack(VideoEditor editor, String audioTrackId, String filename)
+ throws IOException {
mUniqueId = audioTrackId;
mFilename = filename;
mStartTimeMs = 0;
@@ -233,6 +236,7 @@ public class AudioTrack { /**
* Constructor
*
+ * @param editor The video editor reference
* @param audioTrackId The audio track id
* @param filename The audio filename
* @param startTimeMs the start time in milliseconds (relative to the
@@ -248,8 +252,9 @@ public class AudioTrack { *
* @throws IOException if file is not found
*/
- AudioTrack(String audioTrackId, String filename, long startTimeMs, long beginMs, long endMs,
- boolean loop, int volume, boolean muted, String audioWaveformFilename) throws IOException {
+ AudioTrack(VideoEditor editor, String audioTrackId, String filename, long startTimeMs,
+ long beginMs, long endMs, boolean loop, int volume, boolean muted,
+ String audioWaveformFilename) throws IOException {
mUniqueId = audioTrackId;
mFilename = filename;
mStartTimeMs = startTimeMs;
diff --git a/media/java/android/media/videoeditor/MediaImageItem.java b/media/java/android/media/videoeditor/MediaImageItem.java index ae4d359..df3c5fb 100755 --- a/media/java/android/media/videoeditor/MediaImageItem.java +++ b/media/java/android/media/videoeditor/MediaImageItem.java @@ -53,12 +53,13 @@ public class MediaImageItem extends MediaItem { */
@SuppressWarnings("unused")
private MediaImageItem() throws IOException {
- this(null, null, 0, RENDERING_MODE_BLACK_BORDER);
+ this(null, null, null, 0, RENDERING_MODE_BLACK_BORDER);
}
/**
* Constructor
*
+ * @param editor The video editor reference
* @param mediaItemId The media item id
* @param filename The image file name
* @param durationMs The duration of the image on the storyboard
@@ -66,9 +67,10 @@ public class MediaImageItem extends MediaItem { *
* @throws IOException
*/
- public MediaImageItem(String mediaItemId, String filename, long durationMs, int renderingMode)
+ public MediaImageItem(VideoEditor editor, String mediaItemId, String filename, long durationMs,
+ int renderingMode)
throws IOException {
- super(mediaItemId, filename, renderingMode);
+ super(editor, mediaItemId, filename, renderingMode);
// Determine the dimensions of the image
final BitmapFactory.Options dbo = new BitmapFactory.Options();
diff --git a/media/java/android/media/videoeditor/MediaItem.java b/media/java/android/media/videoeditor/MediaItem.java index b5561e9..d9c38af 100755 --- a/media/java/android/media/videoeditor/MediaItem.java +++ b/media/java/android/media/videoeditor/MediaItem.java @@ -70,6 +70,7 @@ public abstract class MediaItem { /**
* Constructor
*
+ * @param editor The video editor reference
* @param mediaItemId The MediaItem id
* @param filename name of the media file.
* @param renderingMode The rendering mode
@@ -79,7 +80,8 @@ public abstract class MediaItem { * supported the exception object contains the unsupported
* capability
*/
- protected MediaItem(String mediaItemId, String filename, int renderingMode) throws IOException {
+ protected MediaItem(VideoEditor editor, String mediaItemId, String filename,
+ int renderingMode) throws IOException {
mUniqueId = mediaItemId;
mFilename = filename;
mRenderingMode = renderingMode;
diff --git a/media/java/android/media/videoeditor/MediaVideoItem.java b/media/java/android/media/videoeditor/MediaVideoItem.java index 8ac5bdd..dd12336 100755 --- a/media/java/android/media/videoeditor/MediaVideoItem.java +++ b/media/java/android/media/videoeditor/MediaVideoItem.java @@ -192,26 +192,29 @@ public class MediaVideoItem extends MediaItem { */
@SuppressWarnings("unused")
private MediaVideoItem() throws IOException {
- this(null, null, RENDERING_MODE_BLACK_BORDER);
+ this(null, null, null, RENDERING_MODE_BLACK_BORDER);
}
/**
* Constructor
*
+ * @param editor The video editor reference
* @param mediaItemId The MediaItem id
* @param filename The image file name
* @param renderingMode The rendering mode
*
* @throws IOException if the file cannot be opened for reading
*/
- public MediaVideoItem(String mediaItemId, String filename, int renderingMode)
+ public MediaVideoItem(VideoEditor editor, String mediaItemId, String filename,
+ int renderingMode)
throws IOException {
- this(mediaItemId, filename, renderingMode, 0, END_OF_FILE, 100, false, null);
+ this(editor, mediaItemId, filename, renderingMode, 0, END_OF_FILE, 100, false, null);
}
/**
* Constructor
*
+ * @param editor The video editor reference
* @param mediaItemId The MediaItem id
* @param filename The image file name
* @param renderingMode The rendering mode
@@ -226,10 +229,10 @@ public class MediaVideoItem extends MediaItem { *
* @throws IOException if the file cannot be opened for reading
*/
- MediaVideoItem(String mediaItemId, String filename, int renderingMode,
+ MediaVideoItem(VideoEditor editor, String mediaItemId, String filename, int renderingMode,
long beginMs, long endMs, int volumePercent, boolean muted,
String audioWaveformFilename) throws IOException {
- super(mediaItemId, filename, renderingMode);
+ super(editor, mediaItemId, filename, renderingMode);
// TODO: Set these variables correctly
mWidth = 1080;
mHeight = 720;
diff --git a/media/java/android/media/videoeditor/VideoEditorTestImpl.java b/media/java/android/media/videoeditor/VideoEditorTestImpl.java index b39d9d8..c3cb82a 100644 --- a/media/java/android/media/videoeditor/VideoEditorTestImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorTestImpl.java @@ -765,7 +765,7 @@ public class VideoEditorTestImpl implements VideoEditor { if (MediaImageItem.class.getSimpleName().equals(type)) { final long durationMs = Long.parseLong(parser.getAttributeValue("", ATTR_DURATION)); - currentMediaItem = new MediaImageItem(mediaItemId, filename, + currentMediaItem = new MediaImageItem(this, mediaItemId, filename, durationMs, renderingMode); } else if (MediaVideoItem.class.getSimpleName().equals(type)) { final long beginMs = Long.parseLong(parser.getAttributeValue("", @@ -778,7 +778,7 @@ public class VideoEditorTestImpl implements VideoEditor { ATTR_MUTED)); final String audioWaveformFilename = parser.getAttributeValue("", ATTR_AUDIO_WAVEFORM_FILENAME); - currentMediaItem = new MediaVideoItem(mediaItemId, filename, + currentMediaItem = new MediaVideoItem(this, mediaItemId, filename, renderingMode, beginMs, endMs, volume, muted, audioWaveformFilename); @@ -1017,7 +1017,7 @@ public class VideoEditorTestImpl implements VideoEditor { final boolean loop = Boolean.parseBoolean(parser.getAttributeValue("", ATTR_LOOP)); final String waveformFilename = parser.getAttributeValue("", ATTR_AUDIO_WAVEFORM_FILENAME); try { - final AudioTrack audioTrack = new AudioTrack(audioTrackId, filename, startTimeMs, + final AudioTrack audioTrack = new AudioTrack(this, audioTrackId, filename, startTimeMs, beginMs, endMs, loop, volume, muted, waveformFilename); return audioTrack; |