当前位置: 首页 > news >正文

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) 


相关文章:

  • Nginx服务器防止负载过高模块sysguard
  • 矩阵的存储及快速转置
  • [HeadFrist-HTMLCSS学习笔记][第一章Web语言:开始了解HTML]
  • USB2.0学习笔记连载(九):USB设备驱动的安装
  • PHP语言 -- 面向对象
  • spring 中IOC和aop的理解
  • keepalived which time exec track script , notify script when vrrp transition
  • 代理模式
  • java aopalliance-1.0.jar这个包是做什么用的?
  • Android客户端采用Http 协议Post方式请求与服务端进行数据交互(转)
  • Distributed3:SQL Server 创建分布式数据库
  • C#-属性
  • 2的幂的合并运算实例
  • 【curl】cookie的分隔符
  • 从零开始学数据库(一)——安装、启动、进入、创建表、检查表结构、类型说明、更改表项名、插入值...
  • 《Java编程思想》读书笔记-对象导论
  • 【Under-the-hood-ReactJS-Part0】React源码解读
  • Angular js 常用指令ng-if、ng-class、ng-option、ng-value、ng-click是如何使用的?
  • Invalidate和postInvalidate的区别
  • Java 实战开发之spring、logback配置及chrome开发神器(六)
  • JavaScript学习总结——原型
  • macOS 中 shell 创建文件夹及文件并 VS Code 打开
  • MySQL的数据类型
  • php面试题 汇集2
  • Work@Alibaba 阿里巴巴的企业应用构建之路
  • 从零搭建Koa2 Server
  • 白色的风信子
  • 仓管云——企业云erp功能有哪些?
  • #WEB前端(HTML属性)
  • #我与Java虚拟机的故事#连载06:收获颇多的经典之作
  • (2021|NIPS,扩散,无条件分数估计,条件分数估计)无分类器引导扩散
  • (6)STL算法之转换
  • (C语言)共用体union的用法举例
  • (done) NLP “bag-of-words“ 方法 (带有二元分类和多元分类两个例子)词袋模型、BoW
  • (Python) SOAP Web Service (HTTP POST)
  • (Redis使用系列) SpirngBoot中关于Redis的值的各种方式的存储与取出 三
  • (附源码)springboot掌上博客系统 毕业设计063131
  • (十八)三元表达式和列表解析
  • (十一)图像的罗伯特梯度锐化
  • (实战篇)如何缓存数据
  • (原創) 如何讓IE7按第二次Ctrl + Tab時,回到原來的索引標籤? (Web) (IE) (OS) (Windows)...
  • .NET 8 编写 LiteDB vs SQLite 数据库 CRUD 接口性能测试(准备篇)
  • .NET(C#) Internals: as a developer, .net framework in my eyes
  • .net专家(张羿专栏)
  • @AliasFor注解
  • [ Algorithm ] N次方算法 N Square 动态规划解决
  • [2023-年度总结]凡是过往,皆为序章
  • [ajaxupload] - 上传文件同时附件参数值
  • [Android]使用Android打包Unity工程
  • [Bada开发]初步入口函数介绍
  • [C# 网络编程系列]专题六:UDP编程
  • [C++] 如何使用Visual Studio 2022 + QT6创建桌面应用
  • [ccc3.0][数字钥匙] UWB配置和使用(二)
  • [Docker]六.Docker自动部署nodejs以及golang项目
  • [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c