From 77cb074ede14c8293564e015cabf03aaa9d2e835 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Sun, 17 Jun 2018 21:30:00 +0930 Subject: [PATCH] parser: expose MJPEG documentation --- parser/mjpeg.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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