android 视频的缩图制作

在Gallery 这支ap里我们可以看到有对视频video显示,其源代码如下:
public static Bitmap createVideoThumbnail(String filePath) {
        Bitmap bitmap = null;
        MediaMetadataRetriever retriever = new MediaMetadataRetriever();
        try {
            retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY);
            retriever.setDataSource(filePath);
            bitmap = retriever.captureFrame();
        } catch (IllegalArgumentException ex) {
            // Assume this is a corrupt video file
        } catch (RuntimeException ex) {
            // Assume this is a corrupt video file.
        } finally {
            try {
                retriever.release();
            } catch (RuntimeException ex) {
                // Ignore failures while cleaning up.
            }
        }
        return bitmap;
    }/code]


问题:
MediaMetadataRetriever如何才能被AP调用呢?它位于frameworks/base/media/java/android/media/MediaMetadataRetriever.java
。有人说他被@hide了?那如何操作重新编译Frameworks才能被AP使用呢?

你可能感兴趣的:(java,android,UP)