/**@class android.media.MediaMetadataRetriever implements java.lang.AutoCloseable @extends java.lang.Object MediaMetadataRetriever class provides a unified interface for retrieving frame and meta data from an input media file. */ var MediaMetadataRetriever = { /** This option is used with {@link #getFrameAtTime(long, int)} to retrieve a sync (or key) frame associated with a data source that is located right before or at the given time. @see #getFrameAtTime(long, int) */ OPTION_PREVIOUS_SYNC : "0", /** This option is used with {@link #getFrameAtTime(long, int)} to retrieve a sync (or key) frame associated with a data source that is located right after or at the given time. @see #getFrameAtTime(long, int) */ OPTION_NEXT_SYNC : "1", /** This option is used with {@link #getFrameAtTime(long, int)} to retrieve a sync (or key) frame associated with a data source that is located closest to (in time) or at the given time. @see #getFrameAtTime(long, int) */ OPTION_CLOSEST_SYNC : "2", /** This option is used with {@link #getFrameAtTime(long, int)} to retrieve a frame (not necessarily a key frame) associated with a data source that is located closest to or at the given time. @see #getFrameAtTime(long, int) */ OPTION_CLOSEST : "3", /** The metadata key to retrieve the numeric string describing the order of the audio data source on its original recording. */ METADATA_KEY_CD_TRACK_NUMBER : "0", /** The metadata key to retrieve the information about the album title of the data source. */ METADATA_KEY_ALBUM : "1", /** The metadata key to retrieve the information about the artist of the data source. */ METADATA_KEY_ARTIST : "2", /** The metadata key to retrieve the information about the author of the data source. */ METADATA_KEY_AUTHOR : "3", /** The metadata key to retrieve the information about the composer of the data source. */ METADATA_KEY_COMPOSER : "4", /** The metadata key to retrieve the date when the data source was created or modified. */ METADATA_KEY_DATE : "5", /** The metadata key to retrieve the content type or genre of the data source. */ METADATA_KEY_GENRE : "6", /** The metadata key to retrieve the data source title. */ METADATA_KEY_TITLE : "7", /** The metadata key to retrieve the year when the data source was created or modified. */ METADATA_KEY_YEAR : "8", /** The metadata key to retrieve the playback duration of the data source. */ METADATA_KEY_DURATION : "9", /** The metadata key to retrieve the number of tracks, such as audio, video, text, in the data source, such as a mp4 or 3gpp file. */ METADATA_KEY_NUM_TRACKS : "10", /** The metadata key to retrieve the information of the writer (such as lyricist) of the data source. */ METADATA_KEY_WRITER : "11", /** The metadata key to retrieve the mime type of the data source. Some example mime types include: "video/mp4", "audio/mp4", "audio/amr-wb", etc. */ METADATA_KEY_MIMETYPE : "12", /** The metadata key to retrieve the information about the performers or artist associated with the data source. */ METADATA_KEY_ALBUMARTIST : "13", /** The metadata key to retrieve the numberic string that describes which part of a set the audio data source comes from. */ METADATA_KEY_DISC_NUMBER : "14", /** The metadata key to retrieve the music album compilation status. */ METADATA_KEY_COMPILATION : "15", /** If this key exists the media contains audio content. */ METADATA_KEY_HAS_AUDIO : "16", /** If this key exists the media contains video content. */ METADATA_KEY_HAS_VIDEO : "17", /** If the media contains video, this key retrieves its width. */ METADATA_KEY_VIDEO_WIDTH : "18", /** If the media contains video, this key retrieves its height. */ METADATA_KEY_VIDEO_HEIGHT : "19", /** This key retrieves the average bitrate (in bits/sec), if available. */ METADATA_KEY_BITRATE : "20", /** This key retrieves the language code of text tracks, if available. If multiple text tracks present, the return value will look like: "eng:chi" @hide */ METADATA_KEY_TIMED_TEXT_LANGUAGES : "21", /** If this key exists the media is drm-protected. @hide */ METADATA_KEY_IS_DRM : "22", /** This key retrieves the location information, if available. The location should be specified according to ISO-6709 standard, under a mp4/3gp box "@xyz". Location with longitude of -90 degrees and latitude of 180 degrees will be retrieved as "+180.0000-90.0000/", for instance. */ METADATA_KEY_LOCATION : "23", /** This key retrieves the video rotation angle in degrees, if available. The video rotation angle may be 0, 90, 180, or 270 degrees. */ METADATA_KEY_VIDEO_ROTATION : "24", /** This key retrieves the original capture framerate, if it's available. The capture framerate will be a floating point number. */ METADATA_KEY_CAPTURE_FRAMERATE : "25", /** If this key exists the media contains still image content. */ METADATA_KEY_HAS_IMAGE : "26", /** If the media contains still images, this key retrieves the number of still images. */ METADATA_KEY_IMAGE_COUNT : "27", /** If the media contains still images, this key retrieves the image index of the primary image. */ METADATA_KEY_IMAGE_PRIMARY : "28", /** If the media contains still images, this key retrieves the width of the primary image. */ METADATA_KEY_IMAGE_WIDTH : "29", /** If the media contains still images, this key retrieves the height of the primary image. */ METADATA_KEY_IMAGE_HEIGHT : "30", /** If the media contains still images, this key retrieves the rotation angle (in degrees clockwise) of the primary image. The image rotation angle must be one of 0, 90, 180, or 270 degrees. */ METADATA_KEY_IMAGE_ROTATION : "31", /** If the media contains video and this key exists, it retrieves the total number of frames in the video sequence. */ METADATA_KEY_VIDEO_FRAME_COUNT : "32", /** If the media contains EXIF data, this key retrieves the offset value of the data. */ METADATA_KEY_EXIF_OFFSET : "33", /** If the media contains EXIF data, this key retrieves the length of the data. */ METADATA_KEY_EXIF_LENGTH : "34", /** This key retrieves the color standard, if available. @see MediaFormat#COLOR_STANDARD_BT709 @see MediaFormat#COLOR_STANDARD_BT601_PAL @see MediaFormat#COLOR_STANDARD_BT601_NTSC @see MediaFormat#COLOR_STANDARD_BT2020 @hide */ METADATA_KEY_COLOR_STANDARD : "35", /** This key retrieves the color transfer, if available. @see MediaFormat#COLOR_TRANSFER_LINEAR @see MediaFormat#COLOR_TRANSFER_SDR_VIDEO @see MediaFormat#COLOR_TRANSFER_ST2084 @see MediaFormat#COLOR_TRANSFER_HLG @hide */ METADATA_KEY_COLOR_TRANSFER : "36", /** This key retrieves the color range, if available. @see MediaFormat#COLOR_RANGE_LIMITED @see MediaFormat#COLOR_RANGE_FULL @hide */ METADATA_KEY_COLOR_RANGE : "37", /** This key retrieves the sample rate, if available. @hide */ METADATA_KEY_SAMPLERATE : "38", /** This key retrieves the bits per sample, if available. @hide */ METADATA_KEY_BITS_PER_SAMPLE : "39", /**Sets the data source (file pathname) to use. Call this method before the rest of the methods in this class. This method may be time-consuming. @param {String} path The path of the input media file. @throws IllegalArgumentException If the path is invalid. */ setDataSource : function( ) {}, /**Sets the data source (URI) to use. Call this method before the rest of the methods in this class. This method may be time-consuming. @param {String} uri The URI of the input media. @param {Object {java.util.Map}} headers the headers to be sent together with the request for the data @throws IllegalArgumentException If the URI is invalid. */ setDataSource : function( ) {}, /**Sets the data source (FileDescriptor) to use. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns. Call this method before the rest of the methods in this class. This method may be time-consuming. @param {Object {FileDescriptor}} fd the FileDescriptor for the file you want to play @param {Number} offset the offset into the file where the data to be played starts, in bytes. It must be non-negative @param {Number} length the length in bytes of the data to be played. It must be non-negative. @throws IllegalArgumentException if the arguments are invalid */ setDataSource : function( ) {}, /**Sets the data source (FileDescriptor) to use. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns. Call this method before the rest of the methods in this class. This method may be time-consuming. @param {Object {FileDescriptor}} fd the FileDescriptor for the file you want to play @throws IllegalArgumentException if the FileDescriptor is invalid */ setDataSource : function( ) {}, /**Sets the data source as a content Uri. Call this method before the rest of the methods in this class. This method may be time-consuming. @param {Object {Context}} context the Context to use when resolving the Uri @param {Object {Uri}} uri the Content URI of the data you want to play @throws IllegalArgumentException if the Uri is invalid @throws SecurityException if the Uri cannot be used due to lack of permission. */ setDataSource : function( ) {}, /**Sets the data source (MediaDataSource) to use. @param {Object {MediaDataSource}} dataSource the MediaDataSource for the media you want to play */ setDataSource : function( ) {}, /**Call this method after setDataSource(). This method retrieves the meta data value associated with the keyCode. The keyCode currently supported is listed below as METADATA_XXX constants. With any other value, it returns a null pointer. @param {Number} keyCode One of the constants listed below at the end of the class. @return {String} The meta data value associate with the given keyCode on success; null on failure. */ extractMetadata : function( ) {}, /**Call this method after setDataSource(). This method finds a representative frame close to the given time position by considering the given option if possible, and returns it as a bitmap. <p>If you don't need a full-resolution frame (for example, because you need a thumbnail image), use {@link #getScaledFrameAtTime getScaledFrameAtTime()} instead of this method.</p> @param {Number} timeUs The time position where the frame will be retrieved. When retrieving the frame at the given time position, there is no guarantee that the data source has a frame located at the position. When this happens, a frame nearby will be returned. If timeUs is negative, time position and option will ignored, and any frame that the implementation considers as representative may be returned. @param {Number} option a hint on how the frame is found. Use {@link #OPTION_PREVIOUS_SYNC} if one wants to retrieve a sync frame that has a timestamp earlier than or the same as timeUs. Use {@link #OPTION_NEXT_SYNC} if one wants to retrieve a sync frame that has a timestamp later than or the same as timeUs. Use {@link #OPTION_CLOSEST_SYNC} if one wants to retrieve a sync frame that has a timestamp closest to or the same as timeUs. Use {@link #OPTION_CLOSEST} if one wants to retrieve a frame that may or may not be a sync frame but is closest to or the same as timeUs. {@link #OPTION_CLOSEST} often has larger performance overhead compared to the other options if there is no sync frame located at timeUs. @return {Object {android.graphics.Bitmap}} A Bitmap containing a representative video frame, which can be null, if such a frame cannot be retrieved. */ getFrameAtTime : function( ) {}, /**Retrieve a video frame near a given timestamp scaled to a desired size. Call this method after setDataSource(). This method finds a representative frame close to the given time position by considering the given option if possible, and returns it as a bitmap with same aspect ratio as the source while scaling it so that it fits into the desired size of dst_width by dst_height. This is useful for generating a thumbnail for an input data source or just to obtain a scaled frame at the given time position. @param {Number} timeUs The time position in microseconds where the frame will be retrieved. When retrieving the frame at the given time position, there is no guarantee that the data source has a frame located at the position. When this happens, a frame nearby will be returned. If timeUs is negative, time position and option will ignored, and any frame that the implementation considers as representative may be returned. @param {Number} option a hint on how the frame is found. Use {@link #OPTION_PREVIOUS_SYNC} if one wants to retrieve a sync frame that has a timestamp earlier than or the same as timeUs. Use {@link #OPTION_NEXT_SYNC} if one wants to retrieve a sync frame that has a timestamp later than or the same as timeUs. Use {@link #OPTION_CLOSEST_SYNC} if one wants to retrieve a sync frame that has a timestamp closest to or the same as timeUs. Use {@link #OPTION_CLOSEST} if one wants to retrieve a frame that may or may not be a sync frame but is closest to or the same as timeUs. {@link #OPTION_CLOSEST} often has larger performance overhead compared to the other options if there is no sync frame located at timeUs. @param {Number} dstWidth expected output bitmap width @param {Number} dstHeight expected output bitmap height @return {Object {android.graphics.Bitmap}} A Bitmap of size not larger than dstWidth by dstHeight containing a scaled video frame, which can be null, if such a frame cannot be retrieved. @throws IllegalArgumentException if passed in invalid option or width by height is less than or equal to 0. */ getScaledFrameAtTime : function( ) {}, /**Call this method after setDataSource(). This method finds a representative frame close to the given time position if possible, and returns it as a bitmap. Call this method if one does not care how the frame is found as long as it is close to the given time; otherwise, please call {@link #getFrameAtTime(long, int)}. <p>If you don't need a full-resolution frame (for example, because you need a thumbnail image), use {@link #getScaledFrameAtTime getScaledFrameAtTime()} instead of this method.</p> @param {Number} timeUs The time position where the frame will be retrieved. When retrieving the frame at the given time position, there is no guarentee that the data source has a frame located at the position. When this happens, a frame nearby will be returned. If timeUs is negative, time position and option will ignored, and any frame that the implementation considers as representative may be returned. @return {Object {android.graphics.Bitmap}} A Bitmap of size dst_widthxdst_height containing a representative video frame, which can be null, if such a frame cannot be retrieved. @see #getFrameAtTime(long, int) */ getFrameAtTime : function( ) {}, /**Call this method after setDataSource(). This method finds a representative frame at any time position if possible, and returns it as a bitmap. Call this method if one does not care about where the frame is located; otherwise, please call {@link #getFrameAtTime}(long) or {@link #getFrameAtTime(long, int)} <p>If you don't need a full-resolution frame (for example, because you need a thumbnail image), use {@link #getScaledFrameAtTime getScaledFrameAtTime()} instead of this method.</p> @return {Object {android.graphics.Bitmap}} A Bitmap containing a representative video frame, which can be null, if such a frame cannot be retrieved. @see #getFrameAtTime(long) @see #getFrameAtTime(long, int) */ getFrameAtTime : function( ) {}, /**This method retrieves a video frame by its index. It should only be called after {@link #setDataSource}. After the bitmap is returned, you can query the actual parameters that were used to create the bitmap from the {@code BitmapParams} argument, for instance to query the bitmap config used for the bitmap with {@link android.media.MediaMetadataRetriever.BitmapParams#getActualConfig}. @param {Number} frameIndex 0-based index of the video frame. The frame index must be that of a valid frame. The total number of frames available for retrieval can be queried via the {@link #METADATA_KEY_VIDEO_FRAME_COUNT} key. @param {Object {MediaMetadataRetriever.BitmapParams}} params BitmapParams that controls the returned bitmap config (such as pixel formats). @throws IllegalStateException if the container doesn't contain video or image sequences. @throws IllegalArgumentException if the requested frame index does not exist. @return {Object {android.graphics.Bitmap}} A Bitmap containing the requested video frame, or null if the retrieval fails. @see #getFrameAtIndex(int) @see #getFramesAtIndex(int, int, BitmapParams) @see #getFramesAtIndex(int, int) */ getFrameAtIndex : function( ) {}, /**This method is similar to {@link #getFrameAtIndex(int, android.media.MediaMetadataRetriever.BitmapParams)} except that the default for {@link android.media.MediaMetadataRetriever.BitmapParams} will be used. @param {Number} frameIndex 0-based index of the video frame. The frame index must be that of a valid frame. The total number of frames available for retrieval can be queried via the {@link #METADATA_KEY_VIDEO_FRAME_COUNT} key. @throws IllegalStateException if the container doesn't contain video or image sequences. @throws IllegalArgumentException if the requested frame index does not exist. @return {Object {android.graphics.Bitmap}} A Bitmap containing the requested video frame, or null if the retrieval fails. @see #getFrameAtIndex(int, BitmapParams) @see #getFramesAtIndex(int, int, BitmapParams) @see #getFramesAtIndex(int, int) */ getFrameAtIndex : function( ) {}, /**This method retrieves a consecutive set of video frames starting at the specified index. It should only be called after {@link #setDataSource}. If the caller intends to retrieve more than one consecutive video frames, this method is preferred over {@link #getFrameAtIndex(int, android.media.MediaMetadataRetriever.BitmapParams)} for efficiency. After the bitmaps are returned, you can query the actual parameters that were used to create the bitmaps from the {@code BitmapParams} argument, for instance to query the bitmap config used for the bitmaps with {@link android.media.MediaMetadataRetriever.BitmapParams#getActualConfig}. @param {Number} frameIndex 0-based index of the first video frame to retrieve. The frame index must be that of a valid frame. The total number of frames available for retrieval can be queried via the {@link #METADATA_KEY_VIDEO_FRAME_COUNT} key. @param {Number} numFrames number of consecutive video frames to retrieve. Must be a positive value. The stream must contain at least numFrames frames starting at frameIndex. @param {Object {MediaMetadataRetriever.BitmapParams}} params BitmapParams that controls the returned bitmap config (such as pixel formats). @throws IllegalStateException if the container doesn't contain video or image sequences. @throws IllegalArgumentException if the frameIndex or numFrames is invalid, or the stream doesn't contain at least numFrames starting at frameIndex. @return {Object {java.util.List}} An list of Bitmaps containing the requested video frames. The returned array could contain less frames than requested if the retrieval fails. @see #getFrameAtIndex(int, BitmapParams) @see #getFrameAtIndex(int) @see #getFramesAtIndex(int, int) */ getFramesAtIndex : function( ) {}, /**This method is similar to {@link #getFramesAtIndex(int, int, android.media.MediaMetadataRetriever.BitmapParams)} except that the default for {@link android.media.MediaMetadataRetriever.BitmapParams} will be used. @param {Number} frameIndex 0-based index of the first video frame to retrieve. The frame index must be that of a valid frame. The total number of frames available for retrieval can be queried via the {@link #METADATA_KEY_VIDEO_FRAME_COUNT} key. @param {Number} numFrames number of consecutive video frames to retrieve. Must be a positive value. The stream must contain at least numFrames frames starting at frameIndex. @throws IllegalStateException if the container doesn't contain video or image sequences. @throws IllegalArgumentException if the frameIndex or numFrames is invalid, or the stream doesn't contain at least numFrames starting at frameIndex. @return {Object {java.util.List}} An list of Bitmaps containing the requested video frames. The returned array could contain less frames than requested if the retrieval fails. @see #getFrameAtIndex(int, BitmapParams) @see #getFrameAtIndex(int) @see #getFramesAtIndex(int, int, BitmapParams) */ getFramesAtIndex : function( ) {}, /**This method retrieves a still image by its index. It should only be called after {@link #setDataSource}. After the bitmap is returned, you can query the actual parameters that were used to create the bitmap from the {@code BitmapParams} argument, for instance to query the bitmap config used for the bitmap with {@link android.media.MediaMetadataRetriever.BitmapParams#getActualConfig}. @param {Number} imageIndex 0-based index of the image. @param {Object {MediaMetadataRetriever.BitmapParams}} params BitmapParams that controls the returned bitmap config (such as pixel formats). @throws IllegalStateException if the container doesn't contain still images. @throws IllegalArgumentException if the requested image does not exist. @return {Object {android.graphics.Bitmap}} the requested still image, or null if the image cannot be retrieved. @see #getImageAtIndex(int) @see #getPrimaryImage(BitmapParams) @see #getPrimaryImage() */ getImageAtIndex : function( ) {}, /** @param {Number} imageIndex 0-based index of the image, negative value indicates primary image. @param {Object {MediaMetadataRetriever.BitmapParams}} params BitmapParams that controls the returned bitmap config (such as pixel formats). @param {Number} targetSize intended size of one edge (wdith or height) of the thumbnail, this is a heuristic for the framework to decide whether the embedded thumbnail should be used. @param {Number} maxPixels maximum pixels of thumbnail, this is a heuristic for the frameowrk to decide whehther the embedded thumnbail (or a downscaled version of it) should be used. @param maxPixels maximum pixels of thumbnail, this is a heuristic for the frameowrk to decide whehther the embedded thumnbail (or a downscaled version of it) should be used. @return {Object {android.graphics.Bitmap}} the retrieved thumbnail, or null if no suitable thumbnail is available. */ getThumbnailImageAtIndex : function( ) {}, /**This method is similar to {@link #getImageAtIndex(int, android.media.MediaMetadataRetriever.BitmapParams)} except that the default for {@link android.media.MediaMetadataRetriever.BitmapParams} will be used. @param {Number} imageIndex 0-based index of the image. @throws IllegalStateException if the container doesn't contain still images. @throws IllegalArgumentException if the requested image does not exist. @return {Object {android.graphics.Bitmap}} the requested still image, or null if the image cannot be retrieved. @see #getImageAtIndex(int, BitmapParams) @see #getPrimaryImage(BitmapParams) @see #getPrimaryImage() */ getImageAtIndex : function( ) {}, /**This method retrieves the primary image of the media content. It should only be called after {@link #setDataSource}. After the bitmap is returned, you can query the actual parameters that were used to create the bitmap from the {@code BitmapParams} argument, for instance to query the bitmap config used for the bitmap with {@link android.media.MediaMetadataRetriever.BitmapParams#getActualConfig}. @param {Object {MediaMetadataRetriever.BitmapParams}} params BitmapParams that controls the returned bitmap config (such as pixel formats). @return {Object {android.graphics.Bitmap}} the primary image, or null if it cannot be retrieved. @throws IllegalStateException if the container doesn't contain still images. @see #getImageAtIndex(int, BitmapParams) @see #getImageAtIndex(int) @see #getPrimaryImage() */ getPrimaryImage : function( ) {}, /**This method is similar to {@link #getPrimaryImage}(BitmapParams) except that the default for {@link android.media.MediaMetadataRetriever.BitmapParams} will be used. @return {Object {android.graphics.Bitmap}} the primary image, or null if it cannot be retrieved. @throws IllegalStateException if the container doesn't contain still images. @see #getImageAtIndex(int, BitmapParams) @see #getImageAtIndex(int) @see #getPrimaryImage(BitmapParams) */ getPrimaryImage : function( ) {}, /**Call this method after setDataSource(). This method finds the optional graphic or album/cover art associated associated with the data source. If there are more than one pictures, (any) one of them is returned. @return {Number} null if no such graphic is found. */ getEmbeddedPicture : function( ) {}, /** */ close : function( ) {}, /**Call it when one is done with the object. This method releases the memory allocated internally. */ release : function( ) {}, };