Android MediaPlayer 播放 mp4 时出现问题

发布于 2024-09-30 21:40:21 字数 818 浏览 0 评论 0原文

我正在尝试在我正在开发的应用程序中播放 mp4 视频,但是每当我在模拟器和某些设备上运行该应用程序时,我都会收到此错误:

ERROR/MemoryHeapBase(34): error opening /dev/pmem_adsp: No such文件或目录

我不知道这意味着什么,当我用谷歌搜索时,出现的所有这些响应都与自定义构建操作系统以及类似的事情有关,我不想做,也不想做。我只想在我的应用程序中播放 mp4 视频,有什么建议吗?顺便说一句,它在 Nexus 上运行得很好。

这是代码:

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 );
    }

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:

ERROR/MemoryHeapBase(34): error opening /dev/pmem_adsp: No such file or directory

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?? By the way it works fine on the Nexus one.

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 );
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只有影子陪我不离不弃 2024-10-07 21:40:21

AFACT 它正在寻找驱动程序到设备物理内存 (/dev/pmem_) 的文件系统映射,该物理内存控制高级数字信号处理器 (adsp)。我想您使用的编解码器之一正在传递给该硬件组件进行解码,但它不存在于文件系统中,因为制造商没有为其编写驱动程序。

我的建议是找到尽可能小的 MP4 文件来重现此问题,并将其报告到 AOSP 错误跟踪器上,同时使用示例文件确保命名有此问题的设备。同时向制造商报告。

如果可以选择使用软件解码器,那么这很可能会提供一个可行的解决方法。

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). 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. 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文