summaryrefslogtreecommitdiffstats
path: root/media/libmedia/mediarecorder.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 14:04:24 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 14:04:24 -0800
commitad04d9201452001dbaac4349f084cc9316190b89 (patch)
treee8a8fbc4b27adf44a21e884351eecf47fca7e0b6 /media/libmedia/mediarecorder.cpp
parent99ffda877980468a9ae31e013cd10fb3645df1b0 (diff)
downloadframeworks_av-ad04d9201452001dbaac4349f084cc9316190b89.zip
frameworks_av-ad04d9201452001dbaac4349f084cc9316190b89.tar.gz
frameworks_av-ad04d9201452001dbaac4349f084cc9316190b89.tar.bz2
auto import from //depot/cupcake/@132589
Diffstat (limited to 'media/libmedia/mediarecorder.cpp')
-rw-r--r--media/libmedia/mediarecorder.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp
index 98aac39..4ab26ac 100644
--- a/media/libmedia/mediarecorder.cpp
+++ b/media/libmedia/mediarecorder.cpp
@@ -58,10 +58,6 @@ status_t MediaRecorder::setPreviewSurface(const sp<Surface>& surface)
LOGE("setPreviewSurface called in an invalid state(%d)", mCurrentState);
return INVALID_OPERATION;
}
- if (!mIsVideoSourceSet) {
- LOGE("try to set preview surface without setting the video source first");
- return INVALID_OPERATION;
- }
status_t ret = mMediaRecorder->setPreviewSurface(surface->getISurface());
if (OK != ret) {
@@ -90,14 +86,6 @@ status_t MediaRecorder::init()
mCurrentState = MEDIA_RECORDER_ERROR;
return UNKNOWN_ERROR;
}
-
- ret = mMediaRecorder->setListener(this);
- if (OK != ret) {
- LOGV("setListener failed: %d", ret);
- mCurrentState = MEDIA_RECORDER_ERROR;
- return UNKNOWN_ERROR;
- }
-
mCurrentState = MEDIA_RECORDER_INITIALIZED;
return ret;
}
@@ -179,10 +167,6 @@ status_t MediaRecorder::setOutputFormat(int of)
LOGE("setOutputFormat called in an invalid state: %d", mCurrentState);
return INVALID_OPERATION;
}
- if (mIsVideoSourceSet && of >= OUTPUT_FORMAT_RAW_AMR) {
- LOGE("output format (%d) is meant for audio recording only and incompatible with video recording", of);
- return INVALID_OPERATION;
- }
status_t ret = mMediaRecorder->setOutputFormat(of);
if (OK != ret) {
@@ -201,10 +185,6 @@ status_t MediaRecorder::setVideoEncoder(int ve)
LOGE("media recorder is not initialized yet");
return INVALID_OPERATION;
}
- if (!mIsVideoSourceSet) {
- LOGE("try to set the video encoder without setting the video source first");
- return INVALID_OPERATION;
- }
if (mIsVideoEncoderSet) {
LOGE("video encoder has already been set");
return INVALID_OPERATION;
@@ -231,10 +211,6 @@ status_t MediaRecorder::setAudioEncoder(int ae)
LOGE("media recorder is not initialized yet");
return INVALID_OPERATION;
}
- if (!mIsAudioSourceSet) {
- LOGE("try to set the audio encoder without setting the audio source first");
- return INVALID_OPERATION;
- }
if (mIsAudioEncoderSet) {
LOGE("audio encoder has already been set");
return INVALID_OPERATION;
@@ -317,10 +293,6 @@ status_t MediaRecorder::setVideoSize(int width, int height)
LOGE("setVideoSize called in an invalid state: %d", mCurrentState);
return INVALID_OPERATION;
}
- if (!mIsVideoSourceSet) {
- LOGE("try to set video size without setting video source first");
- return INVALID_OPERATION;
- }
status_t ret = mMediaRecorder->setVideoSize(width, height);
if (OK != ret) {
@@ -342,10 +314,6 @@ status_t MediaRecorder::setVideoFrameRate(int frames_per_second)
LOGE("setVideoFrameRate called in an invalid state: %d", mCurrentState);
return INVALID_OPERATION;
}
- if (!mIsVideoSourceSet) {
- LOGE("try to set video frame rate without setting video source first");
- return INVALID_OPERATION;
- }
status_t ret = mMediaRecorder->setVideoFrameRate(frames_per_second);
if (OK != ret) {
@@ -367,23 +335,6 @@ status_t MediaRecorder::prepare()
LOGE("prepare called in an invalid state: %d", mCurrentState);
return INVALID_OPERATION;
}
- if (mIsAudioSourceSet != mIsAudioEncoderSet) {
- if (mIsAudioSourceSet) {
- LOGE("audio source is set, but audio encoder is not set");
- } else { // must not happen, since setAudioEncoder checks this already
- LOGE("audio encoder is set, but audio source is not set");
- }
- return INVALID_OPERATION;
- }
-
- if (mIsVideoSourceSet != mIsVideoEncoderSet) {
- if (mIsVideoSourceSet) {
- LOGE("video source is set, but video encoder is not set");
- } else { // must not happen, since setVideoEncoder checks this already
- LOGE("video encoder is set, but video source is not set");
- }
- return INVALID_OPERATION;
- }
status_t ret = mMediaRecorder->prepare();
if (OK != ret) {
@@ -587,31 +538,5 @@ MediaRecorder::~MediaRecorder()
}
}
-status_t MediaRecorder::setListener(const sp<MediaRecorderListener>& listener)
-{
- LOGV("setListener");
- Mutex::Autolock _l(mLock);
- mListener = listener;
-
- return NO_ERROR;
-}
-
-void MediaRecorder::notify(int msg, int ext1, int ext2)
-{
- LOGV("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2);
-
- sp<MediaRecorderListener> listener;
- mLock.lock();
- listener = mListener;
- mLock.unlock();
-
- if (listener != NULL) {
- Mutex::Autolock _l(mNotifyLock);
- LOGV("callback application");
- listener->notify(msg, ext1, ext2);
- LOGV("back from callback");
- }
-}
-
}; // namespace android