diff --git a/parser/mjpeg.go b/parser/mjpeg.go index 70901658..4271601a 100644 --- a/parser/mjpeg.go +++ b/parser/mjpeg.go @@ -29,7 +29,7 @@ package parser const frameStartCode = 0xD8 -type mjpegParser struct { +type MJPEG struct { inputBuffer []byte isParsing bool parserOutputChanRef chan []byte @@ -38,39 +38,39 @@ type mjpegParser struct { delay uint } -func NewMJPEGParser(inputChanLen int) (p *mjpegParser) { - p = new(mjpegParser) +func NewMJPEGParser(inputChanLen int) (p *MJPEG) { + p = new(MJPEG) p.isParsing = true p.inputChan = make(chan byte, inputChanLen) return } -func (p *mjpegParser) Stop() { +func (p *MJPEG) Stop() { p.isParsing = false } -func (p *mjpegParser) Start() { +func (p *MJPEG) Start() { go p.parse() } -func (p *mjpegParser) SetDelay(delay uint) { +func (p *MJPEG) SetDelay(delay uint) { p.delay = delay } -func (p *mjpegParser) InputChan() chan byte { +func (p *MJPEG) InputChan() chan byte { return p.inputChan } -func (p *mjpegParser) OutputChan() <-chan []byte { +func (p *MJPEG) OutputChan() <-chan []byte { return p.userOutputChanRef } -func (p *mjpegParser) SetOutputChan(o chan []byte) { +func (p *MJPEG) SetOutputChan(o chan []byte) { p.parserOutputChanRef = o p.userOutputChanRef = o } -func (p *mjpegParser) parse() { +func (p *MJPEG) parse() { var outputBuffer []byte for p.isParsing { aByte := <-p.inputChan