Monday, July 25, 2011

MediaPlayer errors

I have been struggling to find the meaning of those strange MediaPlayer errors recently, so I'll share a bit here. This is for devices running 2.2 and higher (devices that ships Stagefright media framework).

If you get something similar to error (1, -1004) this is probably the place to find its meaning: sorry I don't know all solutions.


    MEDIA_ERROR_BASE        = -1000,

    ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE,      // -1000
    ERROR_NOT_CONNECTED     = MEDIA_ERROR_BASE - 1,  // -1001
    ERROR_UNKNOWN_HOST      = MEDIA_ERROR_BASE - 2,  // -1002
    ERROR_CANNOT_CONNECT    = MEDIA_ERROR_BASE - 3,  // -1003
    ERROR_IO                = MEDIA_ERROR_BASE - 4,  // -1004
    ERROR_CONNECTION_LOST   = MEDIA_ERROR_BASE - 5,  // -1005
    ERROR_MALFORMED         = MEDIA_ERROR_BASE - 7,  // -1007
    ERROR_OUT_OF_RANGE      = MEDIA_ERROR_BASE - 8,  // -1008
    ERROR_BUFFER_TOO_SMALL  = MEDIA_ERROR_BASE - 9,  // -1009
    ERROR_UNSUPPORTED       = MEDIA_ERROR_BASE - 10, // -1010
    ERROR_END_OF_STREAM     = MEDIA_ERROR_BASE - 11, // -1011

    // Not technically an error.
    INFO_FORMAT_CHANGED    = MEDIA_ERROR_BASE - 12,  // -1012
    INFO_DISCONTINUITY     = MEDIA_ERROR_BASE - 13,  // -1013

    ERROR_NO_LICENSE       = MEDIA_ERROR_BASE - 14,  // -1014

Declarations found at: /frameworks/base/include/media/stagefright/MediaErrors.h