Jim Rhodes..
7
这是来自Android源中的MediaPlayer.h:
enum media_player_states {
MEDIA_PLAYER_STATE_ERROR = 0,
MEDIA_PLAYER_IDLE = 1 << 0,
MEDIA_PLAYER_INITIALIZED = 1 << 1,
MEDIA_PLAYER_PREPARING = 1 << 2,
MEDIA_PLAYER_PREPARED = 1 << 3,
MEDIA_PLAYER_DECODED = 1 << 4,
MEDIA_PLAYER_STARTED = 1 << 5,
MEDIA_PLAYER_PAUSED = 1 << 6,
MEDIA_PLAYER_STOPPED = 1 << 7,
MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 8
};
因此0将是MEDIA_PLAYER_STATE_ERROR,4将是MEDIA_PLAYER_PREPARING.你在调用start()之前调用了prepare()或prepareAsync()吗?
这些是MediaRecorder声明的:
enum media_recorder_states {
MEDIA_RECORDER_ERROR = 0,
MEDIA_RECORDER_IDLE = 1 << 0,
MEDIA_RECORDER_INITIALIZED = 1 << 1,
MEDIA_RECORDER_DATASOURCE_CONFIGURED = 1 << 2,
MEDIA_RECORDER_PREPARED = 1 << 3,
MEDIA_RECORDER_RECORDING = 1 << 4,
};
因此,对于录制,状态4是MEDIA_RECORDER_DATASOURCE_CONFIGURED.