MediaPlayer常見錯誤碼

來源:互聯網
上載者:User

先看下mediaplayer.h對error類型的定義:

// Generic error codes for the media player framework.  Errors are fatal, the// playback must abort.//// Errors are communicated back to the client using the// MediaPlayerListener::notify method defined below.// In this situation, 'notify' is invoked with the following://   'msg' is set to MEDIA_ERROR.//   'ext1' should be a value from the enum media_error_type.//   'ext2' contains an implementation dependant error code to provide//          more details. Should default to 0 when not used.//// The codes are distributed as follow://   0xx: Reserved//   1xx: Android Player errors. Something went wrong inside the MediaPlayer.//   2xx: Media errors (e.g Codec not supported). There is a problem with the//        media itself.//   3xx: Runtime errors. Some extraordinary condition arose making the playback//        impossible.//enum media_error_type {    // 0xx    MEDIA_ERROR_UNKNOWN = 1,    // 1xx    MEDIA_ERROR_SERVER_DIED = 100,    // 2xx    MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200,    // 3xx};

常見錯誤類型

1. -2147483648 未知錯誤

例如log輸出:

MediaPlayer: error (1, -2147483648)

error的第一個參數1表示未知錯誤。

錯誤碼-2147483648是十進位表示的,對應16進位的0x80000000。

它定義在檔案:/frameworks/native/include/utils/Errors.h

UNKNOWN_ERROR       = 0x80000000,

此錯誤一般是在framework的libmediaplayerservice,libstagefright目錄中拋出的。

在執行某個動作時被取消或者中斷,就會拋出此錯誤。

也是一個通用錯誤,在不知道錯誤原因時,也可以拋出此錯誤。

2. -107 網路連結錯誤

例如log輸出:

MediaPlayer: error (1, -107)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.