Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7ab4b9ac authored by Gopalakrishnan Nallasamy's avatar Gopalakrishnan Nallasamy
Browse files

MediaMuxer:Unblock writeSampleData,gate pushBuffer

As MediaMuxer's writeSampleData handles inputs from multiple tracks,
limited the scope of mMuxerLock to an inner block so that the
current track's buffer does not wait until the completion
of processing of previous buffer of the same or another track.
It's the responsibility of individual track - MediaAdapter object
to gate its buffers.  When interleaving is enabled and data
is written in chunks, the delay was very much noticeable.
For example, when video buffers were getting written to the file,
no new audio buffer was queued to it's thread.

This change has decreased the time required
to complete muxing data from multiple tracks by as much as 35%.

Bug: 157373376

Test: atest android.media.cts.MediaMuxerTest \
      android.mediav2.cts.MuxerTest \
      android.mediav2.cts.MuxerUnitTest
Change-Id: If02f60441292afcf29d01939b09a80bbba43e6b6
parent e5c44c76
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment