revid: fixed some general commenting

This commit is contained in:
Saxon 2019-04-02 13:45:36 +10:30
parent 681e07540a
commit dbcac80d1f
3 changed files with 7 additions and 3 deletions

View File

@ -177,6 +177,8 @@ func (r *Revid) setConfig(config Config) error {
return nil return nil
} }
// setupPipeline performs logic pertinent to setting up the data pipeline based
// on the current config.
func (r *Revid) setupPipeline(mtsEnc func(io.Writer, int) io.Writer, func (r *Revid) setupPipeline(mtsEnc func(io.Writer, int) io.Writer,
flvEnc func(io.Writer, int) (io.Writer, error), multiWriter func(...io.Writer) io.Writer) error { flvEnc func(io.Writer, int) (io.Writer, error), multiWriter func(...io.Writer) io.Writer) error {
r.buffer = (*buffer)(ring.NewBuffer(ringBufferSize, ringBufferElementSize, writeTimeout)) r.buffer = (*buffer)(ring.NewBuffer(ringBufferSize, ringBufferElementSize, writeTimeout))

View File

@ -48,7 +48,8 @@ import (
// Log is used by the multiSender. // Log is used by the multiSender.
type Log func(level int8, message string, params ...interface{}) type Log func(level int8, message string, params ...interface{})
// minimalHttpSender implements Sender for posting HTTP to netreceiver or vidgrind. // httpSender provides an implemntation of io.Writer to perform sends to a http
// destination.
type httpSender struct { type httpSender struct {
client *netsender.Sender client *netsender.Sender
log func(lvl int8, msg string, args ...interface{}) log func(lvl int8, msg string, args ...interface{})
@ -62,7 +63,7 @@ func newHttpSender(ns *netsender.Sender, log func(lvl int8, msg string, args ...
} }
} }
// send takes a bytes slice d and sends to http using s' http client. // Write implements io.Writer.
func (s *httpSender) Write(d []byte) (int, error) { func (s *httpSender) Write(d []byte) (int, error) {
return len(d), httpSend(d, s.client, s.log) return len(d), httpSend(d, s.client, s.log)
} }

View File

@ -64,7 +64,8 @@ type destination struct {
currentPkt int currentPkt int
} }
// send takes d and neglects if testDiscontinuities is true, returning an error, // Write implements io.Writer.
// Write takes d and neglects if testDiscontinuities is true, returning an error,
// otherwise d is appended to senders buf. // otherwise d is appended to senders buf.
func (ts *destination) Write(d []byte) (int, error) { func (ts *destination) Write(d []byte) (int, error) {
//fmt.Println("sending") //fmt.Println("sending")