-2

Recently started toying around with the Android Media Codec class to render the video frames from a Native C++ application. Was able to successfully decode and render both audio and video streams using Android MediaCodec class using synchronous approach[queueInputBuffer and deququeInputBuffer].

Android has a good reference example of how to do it in Native C++ Application. Ex : SimplePlayer.cpp

Now i have started with the implementation of asynchronous approach using callbacks and feed the input streams to codec in those callbacks[OnInputBufferAvailable/ OnOutPutBufferAvailable].

I was searching around for a sample code on internet and all i can find are the references which are based on Java MediaCodec class.

If anyone has any sample reference code or any links to the C++ based asynchronous usage of MediaCodec to render a video file, that would be great.

Any guidance on this would also be great on this.

Nick
  • 11
  • 1

1 Answers1

0

An example of converting the ExtractDecodeEditEncodeMuxTest example from synchronous mode to asynchronous mode is available at https://github.com/mstorsjo/android-decodeencodetest. See the commit history for all the steps leading up to this.

This isn't C++ and it isn't for rendering, but it covers a few of the essential aspects at least.

mstorsjo
  • 12,983
  • 2
  • 39
  • 62
  • Can you please have a look at a question I posted if you have the time - https://stackoverflow.com/q/52036704/8199772 – ClassA Aug 31 '18 at 17:29