This came to my attention when investigating the excessive memory usage in VPXDecoder: https://bugs.chromium.org/p/webrtc/issues/detail?id=6484#c29 Media recorder keeps video frames alive until WebmMuxer::OnEncodedVideo(). It seems to only need frame rate and size information there. If we can extract that information earlier, we can release the frames. WDYT? https://cs.chromium.org/chromium/src/media/muxers/webm_muxer.cc?rcl=1483460625&l=127
Good insight, and perhaps is causing https://crbug.com/675521 !
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8bddd84ffe3009bd204fc3ed94464af46ed4d872 commit 8bddd84ffe3009bd204fc3ed94464af46ed4d872 Author: emircan <emircan@chromium.org> Date: Fri Jan 06 02:50:51 2017 Release video frames earlier in Media Recorder This CL tries to shorten the lifetime of VideoFrames that go to MediaRecorder sink. In order to release frames earlier, the video parameters that WebmMuxer later needs are stored in VideoParameters struct and passed. BUG= 678095 TEST=Tested https://rawgit.com/Miguelao/demos/master/mediarecorder.html H264/VPX on Mac. Review-Url: https://codereview.chromium.org/2612403002 Cr-Commit-Position: refs/heads/master@{#441851} [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/content/renderer/media/media_recorder_handler.cc [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/content/renderer/media/media_recorder_handler.h [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/content/renderer/media/video_track_recorder.cc [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/content/renderer/media/video_track_recorder.h [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/content/renderer/media/video_track_recorder_unittest.cc [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/media/muxers/webm_muxer.cc [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/media/muxers/webm_muxer.h [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/media/muxers/webm_muxer_fuzzertest.cc [modify] https://crrev.com/8bddd84ffe3009bd204fc3ed94464af46ed4d872/media/muxers/webm_muxer_unittest.cc
Comment 1 by mcasas@chromium.org
, Jan 4 2017