Loading include/media/mediarecorder.h +2 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,8 @@ enum media_recorder_error_type { enum media_recorder_info_type { MEDIA_RECORDER_INFO_UNKNOWN = 1, MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801 MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, MEDIA_RECORDER_INFO_STOP_PREMATURELY = 802 }; // ---------------------------------------------------------------------------- Loading media/libmediaplayerservice/StagefrightRecorder.cpp +1 −6 Original line number Diff line number Diff line Loading @@ -269,7 +269,7 @@ status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) { status_t StagefrightRecorder::setParamMaxDurationOrFileSize(int64_t limit, bool limit_is_duration) { LOGV("setParamMaxDurationOrFileSize: limit (%d) for %s", LOGV("setParamMaxDurationOrFileSize: limit (%lld) for %s", limit, limit_is_duration?"duration":"size"); if (limit_is_duration) { // limit is in ms if (limit <= 1000) { // XXX: 1 second Loading Loading @@ -563,11 +563,6 @@ status_t StagefrightRecorder::startMPEG4Recording() { || mVideoSource == VIDEO_SOURCE_CAMERA) { CHECK(mCamera != NULL); if (mCamera == 0) { mCamera = Camera::connect(0); } CHECK(mCamera != NULL); // Set the actual video recording frame size CameraParameters params(mCamera->getParameters()); params.setPreviewSize(mVideoWidth, mVideoHeight); Loading media/libstagefright/AMRWriter.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ void *AMRWriter::ThreadWrapper(void *me) { void AMRWriter::threadFunc() { mEstimatedDurationUs = 0; mEstimatedSizeBytes = 0; bool stoppedPrematurely = true; while (!mDone) { MediaBuffer *buffer; status_t err = mSource->read(&buffer); Loading Loading @@ -202,10 +203,22 @@ void AMRWriter::threadFunc() { break; } // XXX: How to tell it is stopped prematurely? if (stoppedPrematurely) { stoppedPrematurely = false; } buffer->release(); buffer = NULL; } if (stoppedPrematurely) { notify(MEDIA_RECORDER_EVENT_INFO, MEDIA_RECORDER_INFO_STOP_PREMATURELY, 0); } fflush(mFile); fclose(mFile); mFile = NULL; mReachedEOS = true; } Loading media/libstagefright/MPEG4Writer.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -924,7 +924,9 @@ void MPEG4Writer::Track::threadEntry() { buffer = NULL; } CHECK(!mSampleInfos.empty()); if (mSampleInfos.empty()) { mOwner->notify(MEDIA_RECORDER_EVENT_INFO, MEDIA_RECORDER_INFO_STOP_PREMATURELY, 0); } // Last chunk if (!mChunkSamples.empty()) { Loading Loading
include/media/mediarecorder.h +2 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,8 @@ enum media_recorder_error_type { enum media_recorder_info_type { MEDIA_RECORDER_INFO_UNKNOWN = 1, MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801 MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, MEDIA_RECORDER_INFO_STOP_PREMATURELY = 802 }; // ---------------------------------------------------------------------------- Loading
media/libmediaplayerservice/StagefrightRecorder.cpp +1 −6 Original line number Diff line number Diff line Loading @@ -269,7 +269,7 @@ status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) { status_t StagefrightRecorder::setParamMaxDurationOrFileSize(int64_t limit, bool limit_is_duration) { LOGV("setParamMaxDurationOrFileSize: limit (%d) for %s", LOGV("setParamMaxDurationOrFileSize: limit (%lld) for %s", limit, limit_is_duration?"duration":"size"); if (limit_is_duration) { // limit is in ms if (limit <= 1000) { // XXX: 1 second Loading Loading @@ -563,11 +563,6 @@ status_t StagefrightRecorder::startMPEG4Recording() { || mVideoSource == VIDEO_SOURCE_CAMERA) { CHECK(mCamera != NULL); if (mCamera == 0) { mCamera = Camera::connect(0); } CHECK(mCamera != NULL); // Set the actual video recording frame size CameraParameters params(mCamera->getParameters()); params.setPreviewSize(mVideoWidth, mVideoHeight); Loading
media/libstagefright/AMRWriter.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -162,6 +162,7 @@ void *AMRWriter::ThreadWrapper(void *me) { void AMRWriter::threadFunc() { mEstimatedDurationUs = 0; mEstimatedSizeBytes = 0; bool stoppedPrematurely = true; while (!mDone) { MediaBuffer *buffer; status_t err = mSource->read(&buffer); Loading Loading @@ -202,10 +203,22 @@ void AMRWriter::threadFunc() { break; } // XXX: How to tell it is stopped prematurely? if (stoppedPrematurely) { stoppedPrematurely = false; } buffer->release(); buffer = NULL; } if (stoppedPrematurely) { notify(MEDIA_RECORDER_EVENT_INFO, MEDIA_RECORDER_INFO_STOP_PREMATURELY, 0); } fflush(mFile); fclose(mFile); mFile = NULL; mReachedEOS = true; } Loading
media/libstagefright/MPEG4Writer.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -924,7 +924,9 @@ void MPEG4Writer::Track::threadEntry() { buffer = NULL; } CHECK(!mSampleInfos.empty()); if (mSampleInfos.empty()) { mOwner->notify(MEDIA_RECORDER_EVENT_INFO, MEDIA_RECORDER_INFO_STOP_PREMATURELY, 0); } // Last chunk if (!mChunkSamples.empty()) { Loading