mirror of https://bitbucket.org/ausocean/av.git
stream/flv & stream/mts: updated commenting for flv and mts encoders
This commit is contained in:
parent
9f4f9e8920
commit
f55daa02c1
|
@ -42,6 +42,7 @@ type noop struct {
|
|||
dst io.Writer
|
||||
}
|
||||
|
||||
// Write implements io.Writer.
|
||||
func (e noop) Write(p []byte) (int, error) {
|
||||
n, err := e.dst.Write(p)
|
||||
return n, err
|
||||
|
|
|
@ -187,8 +187,8 @@ func (s *frameScanner) readByte() (b byte, ok bool) {
|
|||
return b, true
|
||||
}
|
||||
|
||||
// generate takes in raw video data from the input chan and packetises it into
|
||||
// flv tags, which are then passed to the output channel.
|
||||
// write implements io.Writer. It takes raw h264 and encodes into flv, then
|
||||
// writes to the encoders io.Writer destination.
|
||||
func (e *Encoder) Write(frame []byte) (int, error) {
|
||||
var frameType byte
|
||||
var packetType byte
|
||||
|
|
|
@ -178,8 +178,8 @@ func (e *Encoder) TimeBasedPsi(b bool, sendCount int) {
|
|||
e.pktCount = e.psiSendCount
|
||||
}
|
||||
|
||||
// generate handles the incoming data and generates equivalent mpegts packets -
|
||||
// sending them to the output channel.
|
||||
// Write implements io.Writer. Write takes raw h264 and encodes into mpegts,
|
||||
// then sending it to the encoder's io.Writer destination.
|
||||
func (e *Encoder) Write(nalu []byte) (int, error) {
|
||||
now := time.Now()
|
||||
if (e.timeBasedPsi && (now.Sub(e.psiLastTime) > psiInterval)) || (!e.timeBasedPsi && (e.pktCount >= e.psiSendCount)) {
|
||||
|
|
Loading…
Reference in New Issue