From 65e731f393f704eedab6fbe0af7f8a580c8d4617 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Wed, 11 Mar 2009 12:11:56 -0700 Subject: auto import from //branches/cupcake/...@137873 --- media/libmedia/mediaplayer.cpp | 13 ++++++++++++- media/libmedia/mediarecorder.cpp | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'media') diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index bd8579c..6b40412 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -215,6 +215,10 @@ status_t MediaPlayer::prepareAsync_l() return INVALID_OPERATION; } +// TODO: In case of error, prepareAsync provides the caller with 2 error codes, +// one defined in the Android framework and one provided by the implementation +// that generated the error. The sync version of prepare returns only 1 error +// code. status_t MediaPlayer::prepare() { LOGV("prepare"); @@ -512,7 +516,9 @@ void MediaPlayer::notify(int msg, int ext1, int ext2) } break; case MEDIA_ERROR: - // Always log errors + // Always log errors. + // ext1: Media framework error code. + // ext2: Implementation dependant error code. LOGE("error (%d, %d)", ext1, ext2); mCurrentState = MEDIA_PLAYER_STATE_ERROR; if (mPrepareSync) @@ -524,6 +530,11 @@ void MediaPlayer::notify(int msg, int ext1, int ext2) send = false; } break; + case MEDIA_INFO: + // ext1: Media framework error code. + // ext2: Implementation dependant error code. + LOGW("info/warning (%d, %d)", ext1, ext2); + break; case MEDIA_SEEK_COMPLETE: LOGV("Received seek complete"); if (mSeekPosition != mCurrentPosition) { diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp index 5eba0ef..572b1e7 100644 --- a/media/libmedia/mediarecorder.cpp +++ b/media/libmedia/mediarecorder.cpp @@ -456,6 +456,11 @@ status_t MediaRecorder::stop() mCurrentState = MEDIA_RECORDER_ERROR; return ret; } + + // FIXME: + // stop and reset are semantically different. + // We treat them the same for now, and will change this in the future. + doCleanUp(); mCurrentState = MEDIA_RECORDER_IDLE; return ret; } -- cgit v1.1