相关疑难解决方法(0)

如何访问MediaMetadataRetriever.setDataSource(...)状态代码?

我收到以下错误java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA,我想知道这个状态是什么.我正在使用该功能MediaMetaDataRetriever.setDataSource(String filePath)

android android-music-player android-mediaplayer

13
推荐指数
3
解决办法
6753
查看次数

MediaMetadataRetriever.setDataSource(Native Method) 导致 RuntimeException: status = 0x80000000

我尝试使用 android.media.MediaMetadataRetriever 从我的 android 应用程序中的 jpg 文件中获取一些元数据信息。这是我的代码:

public long getDuration(String videoFilePath, Context context) {
    File file = loadVideoFile(videoFilePath);
    if (file == null) {
        return -1;
    }

    MediaMetadataRetriever retriever = new MediaMetadataRetriever();
    file.setReadable(true, false);
    retriever.setDataSource(file.getAbsolutePath());
    return getDurationProperty(retriever);
}
Run Code Online (Sandbox Code Playgroud)

当我调用 setDataSource 方法时,它会抛出 RuntimeException:

09-10 15:22:25.576: D/PowerManagerService(486): releaseWakeLock(419aa2a0): CPU_MIN_NUM , tag=AbsListViewScroll_5.0, flags=0x400
09-10 15:22:26.481: I/HtcModeClient(12704): handler message = 4011
09-10 15:22:26.481: E/HtcModeClient(12704): Check connection and retry 9 times.
09-10 15:22:27.681: W/dalvikvm(13569): threadid=1: thread exiting with uncaught exception (group=0x40bc92d0)
09-10 15:22:27.696: E/AndroidRuntime(13569): FATAL EXCEPTION: …
Run Code Online (Sandbox Code Playgroud)

android

5
推荐指数
1
解决办法
9316
查看次数

设置数据源运行时异常 0xFFFFFFEA

//inputStream is a MP4 file in scard.
// new FileInputStream(file.getAbsolutePath());
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
FileDescriptor fileDescriptor = inputStream.getFD();// value 61
retriever.setDataSource(fileDescriptor);
Run Code Online (Sandbox Code Playgroud)

结果:

java.lang.RuntimeException: setDataSource 失败: status = 0xFFFFFFEA

media android

5
推荐指数
0
解决办法
3962
查看次数