diff options
author | James Dong <jdong@google.com> | 2010-12-02 10:24:24 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-12-02 10:24:24 -0800 |
commit | 6785699f19ed22b07e9c7b9fa2f29ad3571febed (patch) | |
tree | 1b762b78d0ccd469bd74f739b63d9583a7d9a79c /media | |
parent | d66c63e56e6b89d117bc4ff6dff9d70dec92e427 (diff) | |
parent | 806398755fdc63438b607856574e5b885ad98e6b (diff) | |
download | frameworks_base-6785699f19ed22b07e9c7b9fa2f29ad3571febed.zip frameworks_base-6785699f19ed22b07e9c7b9fa2f29ad3571febed.tar.gz frameworks_base-6785699f19ed22b07e9c7b9fa2f29ad3571febed.tar.bz2 |
am 80639875: am d4c5478a: Merge "Be conservative in estimating the file size limit." into gingerbread
* commit '806398755fdc63438b607856574e5b885ad98e6b':
Be conservative in estimating the file size limit.
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 ec3b5a2..d2dbf0d 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -366,6 +366,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; } @@ -376,6 +379,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 6760707..602aa9f 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -878,7 +878,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() { |