Android MediaPlayer Error/Info Code

Android MediaPlayer Error/Info Code

大家好,又见面了,我是全栈君。

1. 常见错误

error(-38, 0)

我觉得-38表示在当前的MediaPlayer状态下,不能运行你的操作。

详细怎样做请參考:Android MediaPlayer

另外我在其它资料中。发现有人觉得-38定义在:pvmf_return_codes.h文件里:

-38: DRM clock is not available or cannot be read

0: Return code for pending completion

  /*
   * DRM clock is not available or cannot be read
   */
   const PVMFStatus PVMFErrDrmClockError = (-38);
  /*
   * Return code for pending completion
   */
   const PVMFStatus PVMFPending = 0;

error (1, -2147483648)

1: 事实上代表MEDIA_ERROR_UNKNOWN
-2147483648: (0x80000000)没有做什么说明,实际上它也是代表unknown error

这中错误大多是在播放MP4的时候出现,主要原因是由于当前的机器不支持这样的视频编码(H263。H264,MPEG-3等,不是视频容器格式)

2. MediaError.h

enum {
    MEDIA_ERROR_BASE        = -1000,

    ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE,
    ERROR_NOT_CONNECTED     = MEDIA_ERROR_BASE - 1,
    ERROR_UNKNOWN_HOST      = MEDIA_ERROR_BASE - 2,
    ERROR_CANNOT_CONNECT    = MEDIA_ERROR_BASE - 3,
    ERROR_IO                = MEDIA_ERROR_BASE - 4,
    ERROR_CONNECTION_LOST   = MEDIA_ERROR_BASE - 5,
    ERROR_MALFORMED         = MEDIA_ERROR_BASE - 7,
    ERROR_OUT_OF_RANGE      = MEDIA_ERROR_BASE - 8,
    ERROR_BUFFER_TOO_SMALL  = MEDIA_ERROR_BASE - 9,
    ERROR_UNSUPPORTED       = MEDIA_ERROR_BASE - 10,
    ERROR_END_OF_STREAM     = MEDIA_ERROR_BASE - 11,

    // Not technically an error.
    INFO_FORMAT_CHANGED    = MEDIA_ERROR_BASE - 12,
    INFO_DISCONTINUITY     = MEDIA_ERROR_BASE - 13,
    INFO_OUTPUT_BUFFERS_CHANGED = MEDIA_ERROR_BASE - 14,

    // The following constant values should be in sync with
    // drm/drm_framework_common.h
    DRM_ERROR_BASE = -2000,

    ERROR_DRM_UNKNOWN                       = DRM_ERROR_BASE,
    ERROR_DRM_NO_LICENSE                    = DRM_ERROR_BASE - 1,
    ERROR_DRM_LICENSE_EXPIRED               = DRM_ERROR_BASE - 2,
    ERROR_DRM_SESSION_NOT_OPENED            = DRM_ERROR_BASE - 3,
    ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED  = DRM_ERROR_BASE - 4,
    ERROR_DRM_DECRYPT                       = DRM_ERROR_BASE - 5,
    ERROR_DRM_CANNOT_HANDLE                 = DRM_ERROR_BASE - 6,
    ERROR_DRM_TAMPER_DETECTED               = DRM_ERROR_BASE - 7,
    ERROR_DRM_NOT_PROVISIONED               = DRM_ERROR_BASE - 8,
    ERROR_DRM_DEVICE_REVOKED                = DRM_ERROR_BASE - 9,
    ERROR_DRM_RESOURCE_BUSY                 = DRM_ERROR_BASE - 10,

    ERROR_DRM_VENDOR_MAX                    = DRM_ERROR_BASE - 500,
    ERROR_DRM_VENDOR_MIN                    = DRM_ERROR_BASE - 999,

    // Heartbeat Error Codes
    HEARTBEAT_ERROR_BASE = -3000,
    ERROR_HEARTBEAT_TERMINATE_REQUESTED                     = HEARTBEAT_ERROR_BASE,
};

3. MediaPlayer

public static final int MEDIA_ERROR_IO 
Added in API level 17 File or network related operation errors. 

Constant Value: -1004 (0xfffffc14) 
public static final int MEDIA_ERROR_MALFORMED 
Added in API level 17 Bitstream is not conforming to the related coding standard or file spec. 

Constant Value: -1007 (0xfffffc11) 
public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK 
Added in API level 3 The video is streamed and its container is not valid for progressive playback i.e the video's index (e.g moov atom) is not at the start of the file.

See Also
MediaPlayer.OnErrorListener 
Constant Value: 200 (0x000000c8) 
public static final int MEDIA_ERROR_SERVER_DIED 
Added in API level 1 Media server died. In this case, the application must release the MediaPlayer object and instantiate a new one.

See Also
MediaPlayer.OnErrorListener 
Constant Value: 100 (0x00000064) 
public static final int MEDIA_ERROR_TIMED_OUT 
Added in API level 17 Some operation takes too long to complete, usually more than 3-5 seconds. 

Constant Value: -110 (0xffffff92) 
public static final int MEDIA_ERROR_UNKNOWN 
Added in API level 1 Unspecified media player error.

See Also
MediaPlayer.OnErrorListener 
Constant Value: 1 (0x00000001) 
public static final int MEDIA_ERROR_UNSUPPORTED 
Added in API level 17 Bitstream is conforming to the related coding standard or file spec, but the media framework does not support the feature. 

Constant Value: -1010 (0xfffffc0e) 
public static final int MEDIA_INFO_BAD_INTERLEAVING 
Added in API level 3 Bad interleaving means that a media has been improperly interleaved or not interleaved at all, e.g has all the video samples first then all the audio ones. Video is playing but a lot of disk seeks may be happening.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 800 (0x00000320) 
public static final int MEDIA_INFO_BUFFERING_END 
Added in API level 9 MediaPlayer is resuming playback after filling buffers.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 702 (0x000002be) 
public static final int MEDIA_INFO_BUFFERING_START 
Added in API level 9 MediaPlayer is temporarily pausing playback internally in order to buffer more data.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 701 (0x000002bd) 
public static final int MEDIA_INFO_METADATA_UPDATE 
Added in API level 5 A new set of metadata is available.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 802 (0x00000322) 
public static final int MEDIA_INFO_NOT_SEEKABLE 
Added in API level 3 The media cannot be seeked (e.g live stream)

See Also
MediaPlayer.OnInfoListener 
Constant Value: 801 (0x00000321) 
public static final int MEDIA_INFO_UNKNOWN 
Added in API level 3 Unspecified media player info.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 1 (0x00000001) 
public static final int MEDIA_INFO_VIDEO_RENDERING_START 
Added in API level 17 The player just pushed the very first video frame for rendering.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 3 (0x00000003) 
public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING 
Added in API level 3 The video is too complex for the decoder: it can't decode frames fast enough. Possibly only the audio plays fine at this stage.

See Also
MediaPlayer.OnInfoListener 
Constant Value: 700 (0x000002bc) 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/115531.html原文链接:https://javaforall.net

(0)
上一篇 2022年2月3日 上午7:00
下一篇 2022年2月3日 上午8:00


相关推荐

  • java集合系列——List集合总结(六)

    List继承了Collection,是有序的列表。实现类有ArrayList、LinkedList、Vector、Stack等 ArrayList是基于数组实现的,是一个数组队列。可以动态的增加容量!LinkedList是基于链表实现的,是一个双向循环列表。可以被当做堆栈使用!Vector是基于数组实现的,是一个矢量队列,是线程安全的!Stack是基于数组实现的,是栈

    2022年2月26日
    59
  • windows搭建svn_pokemmo中文语言包

    windows搭建svn_pokemmo中文语言包上一篇文章讲了如何下载安装SVN,装的原生的SVN,并没有进行相应的配置,这里进行配置SVN官方语言包还没有安装的移步安装教程——>Windows搭建SVN实现访问远程SVN库首先我们打开svn下载界面(点击可进入)往下翻即可看到语言包,这是各个国家不同的语言包,我使用的是中文的语言包,选择中文简体(第一个)下载完成,点击开始安装吧妥妥的下一步啊喏,直接安装完成,勾选下面,配置svn使用此语言包【注意,勾选,勾选,勾选】(没有勾选?成吧,继续往下…

    2025年8月28日
    6
  • pycharm安装失败_河南新增本土确诊0例无症状

    pycharm安装失败_河南新增本土确诊0例无症状使用Pycharm安装numpy时出现错误,导致安装不上刚刚安装好的pycharm,配置一下插件时总会有一些问题。使用pycharm安装numpy包时,出现pip版本问题,导致无法安装numpy包。简单说,无法安装numpy与pip的版本有关系,需要升级pip的版本。先将pip的版本升级20.0.2,之后再安装numpy包。下面在找到numpy包进行安装,即可使用numpy包中的数组函…

    2025年6月3日
    5
  • python语言中的多行注释符是_Pyhton 单行、多行注释符号使用方法及规范「建议收藏」

    python语言中的多行注释符是_Pyhton 单行、多行注释符号使用方法及规范「建议收藏」python中的注释有多种,有单行注释,多行注释,批量注释,中文注释也是常用的。python注释也有自己的规范,在文章中会介绍到。注释可以起到一个备注的作用,团队合作的时候,个人编写的代码经常会被多人调用,为了让别人能更容易理解代码的通途,使用注释是非常有效的。# 在学习python的朋友们,强烈推荐加入PythonQQ群。一、python单行注释符号(#)井号(#)常被用作单行注释符号,在代码…

    2025年5月24日
    2
  • 正规矩阵(酉矩阵)[通俗易懂]

    正规矩阵(酉矩阵)[通俗易懂]英文名:Unitarymatrix

    2025年5月28日
    6
  • .sql文件导入错误「建议收藏」

    .sql文件导入错误「建议收藏」如果是使用Navicat导入的话,有一种情况是此sql文件是导出的.sql文件这样只导了数据sql,没有结构sql因为数据库中不存在该表,所以会报错这种情况.sql文件需要右击表,点击转储为SQL,选择数据和结构,再导入就好了!……

    2022年10月2日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号