From 8555d0867c3e8fe6cc5c7ad40af557fe6b92fa72 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 5 Mar 2009 14:34:35 -0800 Subject: auto import from //depot/cupcake/@136594 --- media/libmedia/mediarecorder.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'media/libmedia/mediarecorder.cpp') diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp index 98aac39..5eba0ef 100644 --- a/media/libmedia/mediarecorder.cpp +++ b/media/libmedia/mediarecorder.cpp @@ -42,7 +42,7 @@ status_t MediaRecorder::setCamera(const sp& camera) if (OK != ret) { LOGV("setCamera failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } return ret; } @@ -67,7 +67,7 @@ status_t MediaRecorder::setPreviewSurface(const sp& surface) if (OK != ret) { LOGV("setPreviewSurface failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } return ret; } @@ -88,14 +88,14 @@ status_t MediaRecorder::init() if (OK != ret) { LOGV("init failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } ret = mMediaRecorder->setListener(this); if (OK != ret) { LOGV("setListener failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mCurrentState = MEDIA_RECORDER_INITIALIZED; @@ -129,7 +129,7 @@ status_t MediaRecorder::setVideoSource(int vs) if (OK != ret) { LOGV("setVideoSource failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mIsVideoSourceSet = true; return ret; @@ -162,7 +162,7 @@ status_t MediaRecorder::setAudioSource(int as) if (OK != ret) { LOGV("setAudioSource failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mIsAudioSourceSet = true; return ret; @@ -188,7 +188,7 @@ status_t MediaRecorder::setOutputFormat(int of) if (OK != ret) { LOGE("setOutputFormat failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mCurrentState = MEDIA_RECORDER_DATASOURCE_CONFIGURED; return ret; @@ -218,7 +218,7 @@ status_t MediaRecorder::setVideoEncoder(int ve) if (OK != ret) { LOGV("setVideoEncoder failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mIsVideoEncoderSet = true; return ret; @@ -248,7 +248,7 @@ status_t MediaRecorder::setAudioEncoder(int ae) if (OK != ret) { LOGV("setAudioEncoder failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mIsAudioEncoderSet = true; return ret; @@ -274,7 +274,7 @@ status_t MediaRecorder::setOutputFile(const char* path) if (OK != ret) { LOGV("setOutputFile failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mIsOutputFileSet = true; return ret; @@ -300,7 +300,7 @@ status_t MediaRecorder::setOutputFile(int fd, int64_t offset, int64_t length) if (OK != ret) { LOGV("setOutputFile failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mIsOutputFileSet = true; return ret; @@ -326,7 +326,7 @@ status_t MediaRecorder::setVideoSize(int width, int height) if (OK != ret) { LOGE("setVideoSize failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } return ret; } @@ -351,7 +351,7 @@ status_t MediaRecorder::setVideoFrameRate(int frames_per_second) if (OK != ret) { LOGE("setVideoFrameRate failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } return ret; } @@ -389,7 +389,7 @@ status_t MediaRecorder::prepare() if (OK != ret) { LOGE("prepare failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mCurrentState = MEDIA_RECORDER_PREPARED; return ret; @@ -411,7 +411,7 @@ status_t MediaRecorder::getMaxAmplitude(int* max) if (OK != ret) { LOGE("getMaxAmplitude failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } return ret; } @@ -432,7 +432,7 @@ status_t MediaRecorder::start() if (OK != ret) { LOGE("start failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mCurrentState = MEDIA_RECORDER_RECORDING; return ret; @@ -454,7 +454,7 @@ status_t MediaRecorder::stop() if (OK != ret) { LOGE("stop failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } mCurrentState = MEDIA_RECORDER_IDLE; return ret; @@ -522,7 +522,7 @@ status_t MediaRecorder::doReset() if (OK != ret) { LOGE("doReset failed: %d", ret); mCurrentState = MEDIA_RECORDER_ERROR; - return UNKNOWN_ERROR; + return ret; } else { mCurrentState = MEDIA_RECORDER_INITIALIZED; } -- cgit v1.1