MediaErrors.h定义了多媒体格式的错误码,如常见的-1007错误

MediaErrors.h定义了多媒体格式的错误码,如常见的-1007错误为ERROR_MALFORMED,表示文件格式错误。

例如log输出:

E/MediaPlayer( 649): error (1, -1007)

其中-1007即是ERROR_MALFORMED。

错误码的定义位于:frameworks/base/include/media/stagefright/MediaErrors.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,

    //Custom Error for corrupt NAL
    ERROR_CORRUPT_NAL      = MEDIA_ERROR_BASE - 99,
};

你可能感兴趣的:(IO,Stream,buffer)