Closed Bug 1031155 Opened 10 years ago Closed 10 years ago

[tarako][SMS]Can't add the attachment of video from camera into MMS when automatic recording to stop

Categories

(Firefox OS Graveyard :: Gaia::Camera, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 987546

People

(Reporter: chaochao.huang, Unassigned)

References

Details

STR: 1、Open the SMS app. 2、Click on the iconAdd icon. 3、Click on the attachButton button. 4、Click on the camera button. 5、Click on the video button. 6、Click on the begin button and automatic record to stop. 7、Click on the ok button, then click on the select button. OBSERVED: 8. POP up a dialog "The file you have selected is too large". EXPECTED: 9.The attachment of video from camera can be added into MMS normally.
There is a size limitation in SMS, when the camera begins to record videos, the size limitation will be sent to framework function MPEG4Writer::exceedsFileSizeLimit(), if the size reaches (95 * mMaxFileSizeLimitBytes) / 100), it will make a callback to tell gaia to stop recording , during the callback, the camera is still recording videos and the size is probably out of mMaxFileSizeLimitBytes. It may cause the problem.
Now there are two kinds of methods to solve the problem. 1、Decrease the size of activityData.maxFileSizeBytes in sms. if (Settings.mmsSizeLimitation) { //Decrease mms message size to 280K for Bug 325917. - activityData.maxFileSizeBytes = Settings.mmsSizeLimitation; + activityData.maxFileSizeBytes = Settings.mmsSizeLimitation - Settings.mmsSizeLimitationDecrease; } 2、Decrease the size of exceedsFileSizeLimit in framework function. bool MPEG4Writer::exceedsFileSizeLimit() { int64_t nTotalBytesEstimate = static_cast<int64_t>(mEstimatedMoovBoxSize); for (List<Track *>::iterator it = mTracks.begin(); it != mTracks.end(); ++it) { nTotalBytesEstimate += (*it)->getEstimatedTrackSizeBytes(); } // 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); + return (nTotalBytesEstimate >= (85 * mMaxFileSizeLimitBytes) / 100); } Do you think which one is more reasonable? And if you have more reasonable method, tell me. Thank you very much!
Flags: needinfo?(pcheng)
Flags: needinfo?(ehung)
I tried 10 times on latest mozilla pvt build. but didn't see this problem. Could you please let us know the reproduce rate for this problem?
Flags: needinfo?(pcheng)
(In reply to pcheng from comment #3) > I tried 10 times on latest mozilla pvt build. but didn't see this problem. > Could you please let us know the reproduce rate for this problem? Before begin recording, wait for 10 seconds.The reproduce rate is 1/5.
I also noticed that after video stopped recording and was attached to mms, the size of video is around 284kb ~ 288kb but never exceed 300kb. It seems to me that it could happen when device memory is low and it takes longer time to tell gaia to stop recording when it almost reach the limit. But I tried several times and could not reproduce. Test build │ Gaia 925100f6f7b8dbe158d5921d01404ea823f4e64e │ │ Gecko │ │ https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/78268d05d2af │ │ BuildID 20140626164001 │ │ Version 28.1 │ │ ro.build.version.incremental=eng.cltbld.20140626.200526
And the solution in comment 2 only makes it a little better. In some extreme case, it still could happen.
Yes. The decreased value is only from the experience.
(In reply to Xiaohong.Fan from comment #1) > There is a size limitation in SMS, > when the camera begins to record videos, > the size limitation will be sent to framework function > MPEG4Writer::exceedsFileSizeLimit(), > if the size reaches (95 * mMaxFileSizeLimitBytes) / 100), > it will make a callback to tell gaia to stop recording , > during the callback, > the camera is still recording videos and the size is probably out of > mMaxFileSizeLimitBytes. > It may cause the problem. Why couldn't the Writer stop writing at that moment?
Component: Gaia::SMS → Gaia::Camera
(In reply to Julien Wajsberg [:julienw] from comment #8) > (In reply to Xiaohong.Fan from comment #1) > > There is a size limitation in SMS, > > when the camera begins to record videos, > > the size limitation will be sent to framework function > > MPEG4Writer::exceedsFileSizeLimit(), > > if the size reaches (95 * mMaxFileSizeLimitBytes) / 100), > > it will make a callback to tell gaia to stop recording , > > during the callback, > > the camera is still recording videos and the size is probably out of > > mMaxFileSizeLimitBytes. > > It may cause the problem. > > Why couldn't the Writer stop writing at that moment? I also got the same question. Xiaohong, could you explain more?
Flags: needinfo?(ehung) → needinfo?(Xiaohong.Fan)
When the file size limit is exceeded, the MPEG4Writer stops appending new video data to the file. When the Camera eventually calls stopRecording(), the MPEG4Writer commits the final index data to the file. We found that in some cases, the space pre-allocated to this index data is insufficient, and patched our local version of MPEG4Writer in bug 987546.
See Also: → 987546
So, is it a dupe to bug 987546 then? Reporter, can you please precise the version you use?
Flags: needinfo?(chaochao.huang)
I think it's should be a dupe to bug bug 987546. The details of version: Gaia fe0c0bcb572f23ea17170d5e9cac9f1a2415d6a6 Gecko cce8003af6891737d9cd56208aa8eff2bec41ebd BuildID 20140611130733 Version 28.1 ro.build.version.incremental=413 ro.build.date=Wed Jun 11 13:04:33 CST 2014
Flags: needinfo?(chaochao.huang)
So please request the 1.3t+ blocking status on that bug if necessary.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
blocking-b2g: --- → 1.3T?
I meant, please request it on bug 987546.
blocking-b2g: 1.3T? → ---
(In reply to Julien Wajsberg [:julienw] from comment #14) > I meant, please request it on bug 987546. So sorry~
Flags: needinfo?(Xiaohong.Fan)
Blocks: 1040586
No longer blocks: 1040586
Blocks: 1040586
No longer blocks: 1040586
You need to log in before you can comment on or make changes to this bug.