public class MediaUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTENT_TYPE_AIFF |
static java.lang.String |
CONTENT_TYPE_FLV |
static java.lang.String |
CONTENT_TYPE_JFX |
static java.lang.String |
CONTENT_TYPE_M3U |
static java.lang.String |
CONTENT_TYPE_M3U8 |
static java.lang.String |
CONTENT_TYPE_M4A |
static java.lang.String |
CONTENT_TYPE_M4V |
static java.lang.String |
CONTENT_TYPE_MP3 |
static java.lang.String |
CONTENT_TYPE_MP4 |
static java.lang.String |
CONTENT_TYPE_MPA |
static java.lang.String |
CONTENT_TYPE_WAV |
private static java.lang.String |
FILE_TYPE_AIF |
private static java.lang.String |
FILE_TYPE_AIFF |
private static java.lang.String |
FILE_TYPE_FLV |
private static java.lang.String |
FILE_TYPE_FXM |
private static java.lang.String |
FILE_TYPE_M3U |
private static java.lang.String |
FILE_TYPE_M3U8 |
private static java.lang.String |
FILE_TYPE_M4A |
private static java.lang.String |
FILE_TYPE_M4V |
private static java.lang.String |
FILE_TYPE_MP4 |
private static java.lang.String |
FILE_TYPE_MPA |
private static java.lang.String |
FILE_TYPE_WAV |
static int |
MAX_FILE_SIGNATURE_LENGTH
Maximum number of bytes needed to scan the file signature.
|
(package private) static java.lang.String |
NATIVE_MEDIA_ERROR_FORMAT
Format of an error which occurred in the native porting layer.
|
(package private) static java.lang.String |
NATIVE_MEDIA_WARNING_FORMAT
Format of an error which occurred in the native porting layer.
|
Constructor and Description |
---|
MediaUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
error(java.lang.Object source,
int errCode,
java.lang.String message,
java.lang.Throwable cause)
Throw a
MediaException with the indicated message and cause. |
static java.lang.String |
filenameToContentType(java.lang.String filename)
Returns the content type given the file name.
|
static java.lang.String |
fileSignatureToContentType(byte[] buf,
int size)
Attempt to determine the content type from the file signature.
|
static void |
nativeError(java.lang.Object source,
MediaError error)
Throw a
MediaException with the indicated error code. |
static void |
nativeWarning(java.lang.Object source,
int warningCode,
java.lang.String warningMessage)
Send a message with the indicated native error code.
|
static void |
warning(java.lang.Object source,
java.lang.String message)
Forward warnings to the global listeners registered with the
NativeMediaManager . |
public static final int MAX_FILE_SIGNATURE_LENGTH
static final java.lang.String NATIVE_MEDIA_ERROR_FORMAT
static final java.lang.String NATIVE_MEDIA_WARNING_FORMAT
public static final java.lang.String CONTENT_TYPE_AIFF
public static final java.lang.String CONTENT_TYPE_MP3
public static final java.lang.String CONTENT_TYPE_MPA
public static final java.lang.String CONTENT_TYPE_WAV
public static final java.lang.String CONTENT_TYPE_JFX
public static final java.lang.String CONTENT_TYPE_FLV
public static final java.lang.String CONTENT_TYPE_MP4
public static final java.lang.String CONTENT_TYPE_M4A
public static final java.lang.String CONTENT_TYPE_M4V
public static final java.lang.String CONTENT_TYPE_M3U8
public static final java.lang.String CONTENT_TYPE_M3U
private static final java.lang.String FILE_TYPE_AIF
private static final java.lang.String FILE_TYPE_AIFF
private static final java.lang.String FILE_TYPE_FLV
private static final java.lang.String FILE_TYPE_FXM
private static final java.lang.String FILE_TYPE_MPA
private static final java.lang.String FILE_TYPE_WAV
private static final java.lang.String FILE_TYPE_MP4
private static final java.lang.String FILE_TYPE_M4A
private static final java.lang.String FILE_TYPE_M4V
private static final java.lang.String FILE_TYPE_M3U8
private static final java.lang.String FILE_TYPE_M3U
public static java.lang.String fileSignatureToContentType(byte[] buf, int size) throws MediaException
buf
- File signature of size MAX_FILE_SIGNATURE_LENGTH
Locator.DEFAULT_CONTENT_TYPE
if not
able to be determined or unsupported.MediaException
public static java.lang.String filenameToContentType(java.lang.String filename)
filename
- public static void warning(java.lang.Object source, java.lang.String message)
NativeMediaManager
. This method may be invoked from either the
Java or the native layer.source
- the source of the warning, likely the object calling this
method.message
- a String
containing the warning.public static void error(java.lang.Object source, int errCode, java.lang.String message, java.lang.Throwable cause)
MediaException
with the indicated message and cause.
This method should be invoked only from the Java layer. The is logged
before the exception is thrown.message
- The detail message.cause
- The cause.public static void nativeWarning(java.lang.Object source, int warningCode, java.lang.String warningMessage)
warningCode
- The native warning code.public static void nativeError(java.lang.Object source, MediaError error)
MediaException
with the indicated error code.
This method should be invoked only from the native layer.errorCode
- The native error code.