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) 

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(1)


相关推荐

  • nginx反向代理配置域名映射

    nginx反向代理配置域名映射nginx反向代理配置域名映射

  • 什么是前端框架与后端框架

    什么是前端框架与后端框架什么是框架框架(Framework)是整个或部分系统的可重用设计,表现为一组抽象构件及构件实例间交互的方法;另一种定义认为,框架是可被应用开发者定制的应用骨架。

  • SOAP协议规范

    SOAP协议规范SOAP协议规范SOAP协议规范1.简介SOAP以XML形式提供了一个简单、轻量的用于在分散或分布环境中交换结构化和类型信息的机制。SOAP本身并没有定义任何应用程序语义,如编程模型或特定语义的实现;实际上它通过提供一个有标准组件的包模型和在模块中编码数据的机制,定义了一个简单的表示应用程序语义的机制。这使SOAP能够被用于从消息传递到RPC的各种系统。SOAP包括三个部

  • Spring cloud和Dubbo区别

    Spring cloud和Dubbo区别Springboot是创建产品级的Spring应用和服务,简化了配置文件,使用嵌入式web服务器,有很多开箱即用微服务功能,可以和springcloud联合部署。springcloud是微服务工具包,为开发者提供了在分布式系统的配置管理、服务发现、断路器、智能路由、微代理、控制总线等开发工具包。zookeeperDubbo默认不支持rest因此基于它扩展出了自己的DubboX(当当扩展)…

  • mpu9150(driverack pa简明教程)

    简述MotionDriver是Invensense的针对其Motion传感器的软件包,即Motion传感器的驱动,目前已支持MPU6050/MPU6500/MPU9150/MPU9250这些传感器。MotionDriver并非全部开源,核心的算法部分是针对ARM处理器和MSP430处理器编译成了静态链接库提供的。MotionDriver文件结构arm\STM32F4_MD6do

  • mysql中phpmyadmin安装教程_安装phpMyAdmin图文教程

    mysql中phpmyadmin安装教程_安装phpMyAdmin图文教程phpmyadmin的安装配置已经是老生常谈的话题了,网络上到处都可以找到相关的配置教程。但是,那些大多都是手动配置的,稍不留神,容易出错。因此站长今天在这里介绍的是,被很多phpmyadmin用户所忽略的phpmyadmin自带的安装程序,下面我们就开始一步一步来安装phpmyadmin。1、首先下载phpmyadmin3.4.11,这是目前最稳定无bug的版本,点击下载2、在你的web根目录新…

发表回复

您的电子邮箱地址不会被公开。

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