简体   繁体   English

播放mp4的android mediaplayer问题

[英]android mediaplayer issue playing mp4

I'm trying to play a mp4 video in an app I'm developing however whenever I run the app in the emulator and on certain devices I get this error: 我正在尝试在正在开发的应用程序中播放mp4视频,但是每当我在模拟器和某些设备上运行该应用程序时,都会出现此错误:

ERROR/MemoryHeapBase(34): error opening /dev/pmem_adsp: No such file or directory ERROR / MemoryHeapBase(34):打开/ dev / pmem_adsp时出错:没有这样的文件或目录

I have no idea what this means and when I googled it all these responses came up that had to do with custom building the OS and things like this that I am not trying to do, nor want to do at all. 我不知道这意味着什么,当我用谷歌搜索时,所有这些响应都与自定义构建操作系统以及类似的事情有关,这些我不是要做的,也不是要做的。 I just want to play an mp4 video in my app, any suggestions?? 我只想在我的应用中播放mp4视频,有什么建议吗? By the way it works fine on the Nexus one. 顺便说一句,它可以在Nexus 1上正常工作。

Here is the code: 这是代码:

try {
        AssetFileDescriptor fileDesc = getVideoFileDescriptor();
        if (fileDesc != null) {
            player.setDataSource(fileDesc.getFileDescriptor(), fileDesc.getStartOffset(), fileDesc.getLength());

            fileDesc.close();

            player.prepare();

            player.setDisplay( holder );
            player.setOnCompletionListener( this );
            player.start();
        }

    }
    catch (Exception e) {
        Log.e( Constants.TAG, "Unable to play intro movie", e );
    }

AFACT it's looking for a filesystem mapping for a driver to the device's physical memory (/dev/pmem_) which controls the advanced digital signal processor (adsp). 实际上,它正在寻找驱动程序到设备物理内存(/ dev / pmem_)的文件系统映射,该设备控制高级数字信号处理器(adsp)。 I would imagine that one of the codecs you've used is being passed to this hardware component for decoding, but it doesn't exist within the filesystem as the manufacturer didn't write a driver for it. 我可以想象,您曾经使用过的一种编解码器将传递给该硬件组件进行解码,但由于制造商未为其编写驱动程序,因此文件系统中不存在该编解码器。

My advice is to find the smallest possible MP4 file which reproduces this problem and report it on the AOSP bug tracker, along with the sample file make sure to name the devices which have this problem. 我的建议是找到能重现此问题的最小MP4文件,并在AOSP错误跟踪器中报告该问题,并与示例文件一起确保命名具有此问题的设备。 Also report it to the manufacturer. 并向制造商报告。

If there's some option to use a software decoder instead, then this will most likely provide a viable workaround. 如果可以选择使用软件解码器,则很可能会提供可行的解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM