public class MediaImageItem extends MediaItem
getScaledWidth()
and getScaledHeight()
respectively.
MediaItem.GetThumbnailListCallback
END_OF_FILE, mBeginTransition, mEndTransition, mFilename, mGeneratedImageClip, mRegenerateClip, RENDERING_MODE_BLACK_BORDER, RENDERING_MODE_CROPPING, RENDERING_MODE_STRETCH
Constructor and Description |
---|
MediaImageItem(VideoEditor editor,
String mediaItemId,
String filename,
long durationMs,
int renderingMode)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getAspectRatio()
Get aspect ratio of the source media item.
|
long |
getDuration() |
int |
getFileType() |
int |
getHeight() |
int |
getScaledHeight() |
int |
getScaledWidth() |
Bitmap |
getThumbnail(int width,
int height,
long timeMs)
Create a thumbnail at specified time in a video stream in Bitmap format
|
void |
getThumbnailList(int width,
int height,
long startMs,
long endMs,
int thumbnailCount,
int[] indices,
MediaItem.GetThumbnailListCallback callback)
Get the array of Bitmap thumbnails between start and end.
|
long |
getTimelineDuration() |
int |
getWidth() |
static int |
nextPowerOf2(int n) |
void |
setDuration(long durationMs)
This method will adjust the duration of bounding transitions, effects
and overlays if the current duration of the transactions become greater
than the maximum allowable duration.
|
addEffect, addOverlay, adjustTransitions, equals, getAllEffects, getAllOverlays, getBeginTransition, getEffect, getEndTransition, getFilename, getId, getOverlay, getRenderingMode, getThumbnailList, hashCode, isOverlapping, removeEffect, removeOverlay, setRenderingMode
public MediaImageItem(VideoEditor editor, String mediaItemId, String filename, long durationMs, int renderingMode) throws IOException
editor
- The video editor referencemediaItemId
- The media item idfilename
- The image file namedurationMs
- The duration of the image on the storyboardrenderingMode
- The rendering modeIOException
public int getFileType()
getFileType
in class MediaItem
public int getWidth()
public int getHeight()
public int getScaledWidth()
public int getScaledHeight()
public int getAspectRatio()
MediaItem
getAspectRatio
in class MediaItem
public void setDuration(long durationMs)
durationMs
- The duration of the image in the storyboard timelinepublic long getDuration()
getDuration
in class MediaItem
public long getTimelineDuration()
getTimelineDuration
in class MediaItem
public Bitmap getThumbnail(int width, int height, long timeMs) throws IOException
MediaItem
getThumbnail
in class MediaItem
width
- width of the thumbnail in pixelsheight
- height of the thumbnail in pixelstimeMs
- The time in the source video file at which the thumbnail is
requested (even if trimmed).IOException
- if a file error occurspublic void getThumbnailList(int width, int height, long startMs, long endMs, int thumbnailCount, int[] indices, MediaItem.GetThumbnailListCallback callback) throws IOException
MediaItem
getThumbnailList
in class MediaItem
width
- width of the thumbnail in pixelsheight
- height of the thumbnail in pixelsstartMs
- The start of time range in millisecondsendMs
- The end of the time range in millisecondsthumbnailCount
- The thumbnail countindices
- The indices of the thumbnails wantedcallback
- The callback used to pass back the bitmapsIOException
- if a file error occurspublic static int nextPowerOf2(int n)