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 android.content.Context |
mContext |
static java.lang.String |
MIME_TYPE |
java.lang.String |
path |
| Constructor and Description |
|---|
MediaController() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
convertVideo(android.content.Context context,
android.net.Uri videoContentUri,
java.io.File destDir)
Perform the actual video compression.
|
boolean |
convertVideo(android.content.Context context,
android.net.Uri videoContentUri,
java.io.File destDir,
int outWidth,
int outHeight,
int outBitrate)
This is just a wrapper to call the private method convertVideo with the RIGHT arguments
Perform the actual video compression.
|
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)
This is just a wrapper to call the private method convertVideo with the RIGHT arguments
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) |
java.lang.String |
getCompressedVideoPath(java.io.File destDirectory) |
static MediaController |
getInstance(android.content.Context context) |
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 android.content.Context mContext
public static final java.lang.String MIME_TYPE
public static MediaController getInstance(android.content.Context context)
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 void copyFile(java.io.File src,
java.io.File dst)
throws java.io.IOException
java.io.IOExceptionpublic 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(android.content.Context context,
android.net.Uri videoContentUri,
java.io.File destDir)
context - Context will be used in some method calls as argumentvideoContentUri - Uri will be used in some method calls as argumentdestDir - 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 savedpublic boolean convertVideo(android.content.Context context,
android.net.Uri videoContentUri,
java.io.File destDir,
int outWidth,
int outHeight,
int outBitrate)
context - Context will be used in some method calls as argumentvideoContentUri - Uri will be used in some method calls as argumentdestDir - the destination directory where compressed video is eventually savedpublic java.lang.String getCompressedVideoPath(java.io.File destDirectory)
throws java.io.FileNotFoundException
java.io.FileNotFoundException