Two fixes were involved, firstly, access unit delimeters were used to denote access units and the Write timeout on rtmpSender's ringBuffer was
increased to stop the 'unable to dump old write' errors. Also made some small changes elsewhere that should fix future issues, particular with
MTS output.
This change included a rename of IntraRefreshPeriod to MinPeriod, and the addition of the ClipDuration param. PSI are now written before IDR. Clips are no longer outputed
based on PSI but rather a time ClipDuration, where ClipDuration >= MinPeriod, however, PSI must still be at the beginning of each clip. Also created functionality to update
meta time even if we don't have a response to update.
Now that we want buffered senders (as required), the ringBuffer that was after the
lexer has been removed. Instead, we now have an ioext.multiWriterCloser to which the
lexer writes to. This then writes to the encoders, and then encoders write to each of
their own multiWriteClosers, which write to the appropriate senders. We now call
close on the first multiWriteCloser to close down the entired pipeline, as this close
call propogates through each level.
We have removed the outputClips routine as it's not required anymore to get data
from the revid ringBuffer, and have removed other things that were used by this, like
the IsRunning function.
We have also updated tests to work with these changes - they are passing.
The mtsSender now has a ringBuffer and tests have been updated accordingly. The mtsSender now uses an output routine to get data from it's ringBuffer to send.
Revid now uses ioext.multiWriteClosers for encoders to write to so that senders can be closed and therefore any output routines.
We are now using an io.multiWriter rather than the multiSender. Code has been updated inside revid.go to account for this change, and tests have also been updated accordingly. Tests for
the multiSender have been removed. A dummyMultiWriter has been written to inject our own multiWriter during testing.
Now that we're removing the concept of a loadSender, there is no need to have a minimalHttpSender (did not implement loadSender) and a httpSender (implemented loadSender). So we can now have
a single httpSender that implements io.Writer just like every other sender.
mtsSender has been simplified such that load and send are no longer called in Write. Load and Send have removed and logic is now in Write. The logic has been simplified such that it does not
try to send again. On next PR when ringbuffers are added to senders, we will add logic to deal with this.
Added a Write method to senders such that they implement io.Writer. The multiSender now takes a slice of io.writers.
Also modified revid code and tests to account for this chance.