Closed
Bug 961618
Opened 10 years ago
Closed 10 years ago
[MediaEncoder] Reduce ISOMediaWriter memory usage
Categories
(Core :: Audio/Video: Recording, defect)
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: ayang, Assigned: ayang)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
11.02 KB,
patch
|
ayang
:
review+
|
Details | Diff | Splinter Review |
The original design is to create a buffer (150k in this case) to write down the audio/video and ISO box info. It can be improved by swapping the audio/video data pointer to an array of uint8_t array. So the ISOMediaWriter only need to allocate small memory for ISO boxes.
Assignee | ||
Comment 1•10 years ago
|
||
Assignee: nobody → ayang
Attachment #8362398 -
Flags: review?(cpearce)
Comment 2•10 years ago
|
||
Comment on attachment 8362398 [details] [diff] [review] reduce_muxer_memory_usage Review of attachment 8362398 [details] [diff] [review]: ----------------------------------------------------------------- r=cpearce with the const violation fixed. ::: content/media/encoder/fmp4_muxer/ISOMediaBoxes.cpp @@ +87,5 @@ > NS_ENSURE_SUCCESS(rv, rv); > > uint32_t len = frames.Length(); > for (uint32_t i = 0; i < len; i++) { > + mControl->WriteAVData((nsTArray<uint8_t>&)frames.ElementAt(i)->GetFrameData()); You're casting a "const nsTArray" to a nsTArray here so you can change the contents. This is bad because some code may make assumptions based on GetFrameData() being const, and you break it here. I think you should rename EncodedFrame::SetFrameData() to SwapFrameData(), and call: nsTArray<uint8_t> frameData; frames.ElementAt(i)->SwapFrameData(&frameData); mControl->WriteAVData(frameData); That way you don't violate the "contract" of that const is supposed to enforce.
Attachment #8362398 -
Flags: review?(cpearce) → review+
Comment 3•10 years ago
|
||
Put the renaming change reqeust of SetFrameData on Bug 959021 :)
Assignee | ||
Comment 4•10 years ago
|
||
Using SwapOutFrameData(), carry r+. https://tbpl.mozilla.org/?tree=Try&rev=295643509c0f
Attachment #8362398 -
Attachment is obsolete: true
Attachment #8368982 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/81d4d1ff6333
Keywords: checkin-needed
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/81d4d1ff6333
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Updated•10 years ago
|
Component: Video/Audio → Video/Audio: Recording
You need to log in
before you can comment on or make changes to this bug.
Description
•