diff options
author | James Dong <jdong@google.com> | 2010-11-30 18:18:08 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-11-30 18:18:08 -0800 |
commit | 5cdcf16ec7c5f6e0de1d17e8246fe4d2a12e7ace (patch) | |
tree | f211d3f6a79bea6c9a80eca5b29a64296a40fddb /media | |
parent | 30c818444d876dd868b84adec2416308c90f32e3 (diff) | |
download | frameworks_base-5cdcf16ec7c5f6e0de1d17e8246fe4d2a12e7ace.zip frameworks_base-5cdcf16ec7c5f6e0de1d17e8246fe4d2a12e7ace.tar.gz frameworks_base-5cdcf16ec7c5f6e0de1d17e8246fe4d2a12e7ace.tar.bz2 |
Be conservative in estimating the file size limit.
bug - 3045580
Change-Id: Ifdffa354b9433639c3f246a0eb581ef14af1e797
Diffstat (limited to 'media')
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.cpp | 8 | ||||
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index 553648d..3261fe6 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -361,6 +361,9 @@ status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) { return BAD_VALUE; } + if (timeUs <= 15 * 1000000LL) { + LOGW("Target duration (%lld us) too short to be respected", timeUs); + } mMaxFileDurationUs = timeUs; return OK; } @@ -371,6 +374,11 @@ status_t StagefrightRecorder::setParamMaxFileSizeBytes(int64_t bytes) { LOGE("Max file size is too small: %lld bytes", bytes); return BAD_VALUE; } + + if (bytes <= 100 * 1024) { + LOGW("Target file size (%lld bytes) is too small to be respected", bytes); + } + mMaxFileSizeBytes = bytes; return OK; } diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index cbb1604..7eb7d46 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -863,7 +863,10 @@ bool MPEG4Writer::exceedsFileSizeLimit() { nTotalBytesEstimate += (*it)->getEstimatedTrackSizeBytes(); } - return (nTotalBytesEstimate >= mMaxFileSizeLimitBytes); + // Be conservative in the estimate: do not exceed 95% of + // the target file limit. For small target file size limit, though, + // this will not help. + return (nTotalBytesEstimate >= (95 * mMaxFileSizeLimitBytes) / 100); } bool MPEG4Writer::exceedsFileDurationLimit() { |