MPEG4Writer:Optimize number of write(2) calls
Instead of making several write(2) calls to pass length of a video buffer, club them together in an array and call write(2) once. This reduces the number of system calls to write a buffer length from 4 to 1(default case), there by avoiding 75% of user/kernel context switches just for this. At 240 fps, it would be 240 instead of 960 calls. Bug: 157160851 Test: atest android.media.cts.MediaMuxerTest Test: atest android.media.cts.MediaRecorderTest Test: atest android.mediav2.cts.MuxerTest Change-Id: I7f3c8ecd5f2bccc6c4b87ccd0dc8104f4e98198a
Loading