public class MediaController
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MediaController.VideoConvertRunnable |
| Modifier and Type | Field and Description |
|---|---|
static java.io.File |
cachedFile |
static java.lang.String |
MIME_TYPE |
java.lang.String |
path |
| Constructor and Description |
|---|
MediaController() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
convertVideo(java.lang.String sourcePath,
java.io.File destDir)
Perform the actual video compression.
|
boolean |
convertVideo(java.lang.String sourcePath,
java.io.File destDir,
int outWidth,
int outHeight,
int outBitrate)
Perform the actual video compression.
|
static int |
convertVideoFrame(java.nio.ByteBuffer src,
java.nio.ByteBuffer dest,
int destFormat,
int width,
int height,
int padding,
int swap) |
static void |
copyFile(java.io.File src,
java.io.File dst) |
static MediaController |
getInstance() |
void |
scheduleVideoConvert(java.lang.String path,
java.io.File dest)
Background conversion for queueing tasks
|
static android.media.MediaCodecInfo |
selectCodec(java.lang.String mimeType) |
static int |
selectColorFormat(android.media.MediaCodecInfo codecInfo,
java.lang.String mimeType) |
public static java.io.File cachedFile
public java.lang.String path
public static final java.lang.String MIME_TYPE
public static MediaController getInstance()
public static int selectColorFormat(android.media.MediaCodecInfo codecInfo,
java.lang.String mimeType)
public static int convertVideoFrame(java.nio.ByteBuffer src,
java.nio.ByteBuffer dest,
int destFormat,
int width,
int height,
int padding,
int swap)
public static android.media.MediaCodecInfo selectCodec(java.lang.String mimeType)
public void scheduleVideoConvert(java.lang.String path,
java.io.File dest)
path - source file to compressdest - destination directory to put resultpublic boolean convertVideo(java.lang.String sourcePath,
java.io.File destDir)
sourcePath - the source uri for the file as perdestDir - the destination directory where compressed video is eventually savedpublic boolean convertVideo(java.lang.String sourcePath,
java.io.File destDir,
int outWidth,
int outHeight,
int outBitrate)
sourcePath - the source uri for the file as perdestDir - the destination directory where compressed video is eventually savedoutWidth - the target width of the converted video, 0 is defaultoutHeight - the target height of the converted video, 0 is defaultoutBitrate - the target bitrate of the converted video, 0 is defaultpublic static void copyFile(java.io.File src,
java.io.File dst)
throws java.io.IOException
java.io.IOException