|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.GalleryItem
danger.app.VideoRecord
public class VideoRecord
VideoRecord are wrappers for videos that are stored in the Camera gallery.
Unlike PhotoRecords, VideoRecord objects do NOT get synced to the service; they are strictly filesystem-only.
VideoRecords should not be (and cannot be) constructed manually;
GalleryItem.createImportableGalleryItem(byte[], java.lang.String) will create objects for you, and
GalleryItemIPCPayload will return fully-formed objects.
| Field Summary |
|---|
| Fields inherited from class danger.app.GalleryItem |
|---|
ANY_HEIGHT, ANY_WIDTH, DESTINATION_DEVICE_GALLERY, DESTINATION_MEMORY_CARD_CUSTOM_PATH, DESTINATION_MEMORY_CARD_DCIM, IMPORT_RESULT_MEMORY_CARD, IMPORT_RESULT_PHOTOS, IMPORT_RESULT_PLURAL, IMPORT_RESULT_SUCCESS, IMPORT_RESULT_VIDEOS, TYPE_IMAGE, TYPE_VIDEO |
| Method Summary | |
|---|---|
void |
dumpRecord()
Debugging method used to dump the contents of this record. |
boolean |
equals(Object obj)
Compares two VideoRecords for equivalence based on whether or not their file pathnames match. |
Bitmap |
getBitmap(int width,
int height)
Returns a bitmap representing a thumbnail of this video. |
byte[] |
getData()
Returns the raw video data in the form of a byte array. |
int |
getDataSize()
Returns the size of the raw data contained in this VideoRecord. |
Date |
getDateCreated()
Returns a Date representing when this VideoRecord was created. |
Video |
getDecodedVideo()
Returns a loaded and initialized Video object for this record. |
int |
getEncodedType()
Returns the raw enumerated data type of the video file (3GP, MP4, etc.). |
File |
getFile()
Returns the file associated with this VideoRecord. |
String |
getFilesystemPath()
Returns the filesystem path of this VideoRecord. |
int |
getHeight()
Returns the height, in pixels, of the video. |
int |
getMediaType()
Returns the type of this VideoRecord object. |
String |
getMimeType()
Returns the MIME type of this GalleryItem object. |
String |
getName()
Returns the filename of the video. |
int |
getWidth()
Returns the width, in pixels, of the video. |
boolean |
hasFile()
Returns whether or not this VideoRecord points to a file. |
int |
hashCode()
Returns a hash code for this VideoRecord. |
boolean |
isImage()
Returns whether or not this GalleryItem is an image. |
boolean |
isValidVideo()
Returns whether or not the video is valid. |
boolean |
isVideo()
Returns whether or not this GalleryItem is a video. |
boolean |
play()
Convenience method for playing the current VideoRecord within a PreviewWindow. |
boolean |
rename(String name)
Sets the filename of the video. |
| Methods inherited from class danger.app.GalleryItem |
|---|
addObserver, createImportableGalleryItem, importGalleryItem, importGalleryItem, removeObserver |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public final int getMediaType()
getMediaType in class GalleryItemGalleryItem.TYPE_VIDEO.public boolean isVideo()
isVideo in class GalleryItemGalleryItempublic boolean isImage()
isImage in class GalleryItemGalleryItempublic boolean equals(Object obj)
If either VideoRecord is an internal device gallery object, this will instead perform a standard equals() based on object equivalence.
equals in class Objectobj - Object for equivalence test
public int hashCode()
hashCode in class ObjectObject.hashCode()public final Date getDateCreated()
Date representing when this VideoRecord was created. (Normally this would
represent when the video itself was captured)
getDateCreated in class GalleryItempublic final int getWidth()
getWidth in class GalleryItempublic final int getHeight()
getHeight in class GalleryItempublic final File getFile()
getFile in class GalleryItempublic final String getName()
getName in class GalleryItempublic final boolean rename(String name)
rename in class GalleryItemname - New name to assign to this video.
public final String getFilesystemPath()
getFilesystemPath in class GalleryItempublic boolean hasFile()
hasFile in class GalleryItempublic final int getEncodedType()
VideoManager.FileType.
getEncodedType in class GalleryItemVideoManager.FileTypepublic String getMimeType()
getMimeType in class GalleryItempublic final int getDataSize()
getDataSize in class GalleryItempublic final byte[] getData()
getData in class GalleryItem
public final Bitmap getBitmap(int width,
int height)
The returned bitmap will maximize itself within the requested space as much as possible while still maintaining the proper aspect ratio.
Passing in either GalleryItem.ANY_WIDTH or GalleryItem.ANY_HEIGHT (but not both) will return an
image that is scaled to fit one dimension; for example: getBitmap(ANY_WIDTH, 400) would
return a 400-pixel high bitmap with a width that preserves the aspect ratio.
Passing in both GalleryItem.ANY_WIDTH and GalleryItem.ANY_HEIGHT will return an unscaled bitmap at
the media's original width and height.
VideoRecords will remember the last requested width and height to prevent reloading the same bitmap more than once.
getBitmap in class GalleryItemwidth - Desired width of bitmap, or GalleryItem.ANY_WIDTH.height - Desired height of bitmap, or GalleryItem.ANY_HEIGHT.
public final Video getDecodedVideo()
public final boolean play()
public final boolean isValidVideo()
If the video is invalid, it cannot be played, nor can any thumbnail or video information be obtained from it.
Callers should call this function if getWidth() or
getHeight() return 0, if thumbnails refuse to load, or if videos refuse to
play to check if this was due to an invalid or corrupt video.
This flag is not set automatically; it will only be set upon unsuccessful attempts to get width, height, or thumbnail information.
public final void dumpRecord()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||