summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
authorGil Dobjanschi <virgild@google.com>2010-10-06 09:54:34 -0700
committerGil Dobjanschi <virgild@google.com>2010-10-06 09:54:34 -0700
commit53f89e12306cec109022477fc699bc6323ab5087 (patch)
tree87ef874c01b57ea31bd5cb70d49ccfe0c294cfda /media/java
parent572eab6f17a78a9483bbf4b3646aa5a6038ea210 (diff)
downloadframeworks_base-53f89e12306cec109022477fc699bc6323ab5087.zip
frameworks_base-53f89e12306cec109022477fc699bc6323ab5087.tar.gz
frameworks_base-53f89e12306cec109022477fc699bc6323ab5087.tar.bz2
Added the video editor to the media items and audio track constructors.
Change-Id: I5db229d28c28e17b487257a9c4ed8c5fb7570a8d
Diffstat (limited to 'media/java')
-rwxr-xr-xmedia/java/android/media/videoeditor/AudioTrack.java7
-rwxr-xr-xmedia/java/android/media/videoeditor/MediaImageItem.java8
-rwxr-xr-xmedia/java/android/media/videoeditor/MediaItem.java4
-rwxr-xr-xmedia/java/android/media/videoeditor/MediaVideoItem.java13
-rw-r--r--media/java/android/media/videoeditor/VideoEditorTestImpl.java4
5 files changed, 23 insertions, 13 deletions
diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java
index 8da7eaa..6007d75 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;
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..b188d41 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);