MPEG4Writer:stop & notify,MediaMuxer:remove notify
1) MPEG4Writer.cpp, Whenever there are critical errors its better
that the threads are stopped before notifying its client.
2) Recent code changes(ag/9886712) in MediaMuxer.cpp in R to receive
notifications from writer threads, MIGHT lead to deadlock in a
scenario when the client thread was waiting for the
writeSampleData to complete while holding mLock, and a
notification was sent from track threads or the main writer
thread to MediaMuxer without stopping the source and/or
stopping the writer threads. Though tough to reproduce(if at all)
it's a bad design that should be avoided to keep the code simple
and less error prone. Now that MPEG4Writer either stops
the source or stop all writer threads based on the severity of
the errors, it would be reflected in the next writeSampleData
or stop call from the client. Hence, removed the code changes
for notifying error from writer to MediaMuxer class.
3) Added logs in MediaWriter to get details of notifications with
track id.
Bug: 157600876
Test: android.media.cts.MediaMuxerTest
Test: android.mediav2.cts.MuxerTest
Test: android.media.cts.MediaRecorderTest
Test: android.mediastress.cts.MediaMuxerStressTest
Change-Id: Idb8996134010669261fa638907b497c0cf70de6b
4 files changed