A CircularBuffer that can be used for buffering a MediaCodec's output when feeding MediaMuxer.
This class is used in Horizon app for Android. You can read more about how it's used in our blog post.
The original code is from Grafika's CircularEndoderBuffer.