revid/config.go: started commenting config fields

This commit is contained in:
Saxon 2019-05-13 16:12:08 +09:30
parent 8337d87a25
commit 001c8696aa
1 changed files with 43 additions and 12 deletions

View File

@ -111,27 +111,59 @@ const (
// Config provides parameters relevant to a revid instance. A new config must // Config provides parameters relevant to a revid instance. A new config must
// be passed to the constructor. Default values for these fields are defined // be passed to the constructor. Default values for these fields are defined
// as consts at the beginning of this file. // as consts above.
type Config struct { type Config struct {
// LogLevel is the revid logging verbosity level.
// Valid values are defined by enums from the logger package: logger.Debug,
// logger.Info, logger.Warning logger.Error, logger.Fatal.
LogLevel int8 LogLevel int8
Input uint8 // Input defines the input data source.
InputCodec uint8 //
Outputs []uint8 // Valid values are defined by enums:
RtmpMethod uint8 // Raspivid:
Packetization uint8 // Read data from a Raspberry Pi Camera.
// V4l:
// Read from webcam.
// File:
// Location must be specified in InputPath field.
Input uint8
// Quantize specifies whether the input to // InputCodec defines the input codec we wish to use, and therefore define the
// revid will have constant or variable // lexer for use in the pipeline. In most cases this defaults according to a
// particular input. Both Raspivid and V4l use H264, but File input may use
// H264 or MJPEG.
InputCodec uint8
// Outputs define the outputs we wish to output data too.
//
// Valid outputs are defined by enums:
// File:
// Location must be defined by the OutputPath field. MPEG-TS packetization
// is used.
// Http:
// Destination is defined by the sh field located in /etc/netsender.conf.
// MPEGT-TS packetization is used.
// Rtmp:
// Destination URL must be defined in the RtmpUrl field. FLV packetization
// is used.
// Rtp:
// Destination is defined by RtpAddr field, otherwise it will default to
// localhost:6970. MPEGT-TS packetization is used.
Outputs []uint8
// Quantize specifies whether the input to revid will have constant or variable
// bitrate. // bitrate.
Quantize bool Quantize bool
// FlipHorizonatla and FlipVertical specify // FlipHorizonatla and FlipVertical specify whether video frames should be flipped.
// whether video frames should be flipped.
FlipHorizontal bool FlipHorizontal bool
FlipVertical bool FlipVertical bool
FramesPerClip uint FramesPerClip uint
// RtmpUrl specifies the Rtmp output destination URL. This must be defined if
// RTMP is to be used as an output.
RtmpUrl string RtmpUrl string
Bitrate uint Bitrate uint
OutputPath string OutputPath string
@ -223,7 +255,6 @@ func (c *Config) Validate(r *Revid) error {
case Http, Rtp: case Http, Rtp:
c.Logger.Log(logger.Info, pkg+"defaulting frames per clip for http out", "framesPerClip", httpFramesPerClip) c.Logger.Log(logger.Info, pkg+"defaulting frames per clip for http out", "framesPerClip", httpFramesPerClip)
c.FramesPerClip = httpFramesPerClip c.FramesPerClip = httpFramesPerClip
c.Packetization = Mpegts
default: default:
return errors.New("bad output type defined in config") return errors.New("bad output type defined in config")
} }