Search code examples
androidaudiovideoandroid-asynctaskmediamuxer

How to send data from one AsyncTask to another AsyncTask?[video system]


I am trying to capture the audio data and video data separately, and to encode/mux them into a .mp4 file. For audio recording and video encoding both are time-costing job, I open two AsyncTasks for them.

Here is the problem, I need to send the data of audio recording task to the video encoding task. But I didn't find the stuff about communication between AsynTasks.

Can anyone give me a hint? Thank you!


Solution

  • MediaCodec API is already async, you submit input data in one method and check for data readiness in another