Add MediaEncoderEngine comments

pull/507/head
Mattia Iavarone 6 years ago
parent 575f256fce
commit ac620c7f0c
  1. 11
      cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoderEngine.java

@ -309,6 +309,17 @@ public class MediaEncoderEngine {
/**
* Writes the given data to the muxer. Should be called after {@link #isStarted()}
* returns true. Note: this seems to be thread safe, no lock.
*
* TODO: Skip first frames from encoder A when encoder B reported a firstTimeMillis
* time that is significantly later. This can happen even if we wait for both to start,
* because {@link MediaEncoder#notifyFirstFrameMillis(long)} can be called while the
* muxer is still closed.
*
* The firstFrameMillis still has a value in computing the absolute times, but it is meant
* to be the time of the first frame read, not necessarily a frame that will be written.
*
* This controller should coordinate between firstFrameMillis and skip frames that have
* large differences.
*/
public void write(@NonNull OutputBufferPool pool, @NonNull OutputBuffer buffer) {
if (!mMediaMuxerStarted) {

Loading…
Cancel
Save