2019-12-20 03:12:51 +03:00
|
|
|
/*
|
|
|
|
NAME
|
|
|
|
filter.go
|
|
|
|
|
|
|
|
AUTHORS
|
|
|
|
Ella Pietraroia <ella@ausocean.org>
|
|
|
|
|
|
|
|
LICENSE
|
|
|
|
filter.go is Copyright (C) 2019 the Australian Ocean Lab (AusOcean)
|
|
|
|
|
|
|
|
It is free software: you can redistribute it and/or modify them
|
|
|
|
under the terms of the GNU General Public License as published by the
|
|
|
|
Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
in gpl.txt. If not, see http://www.gnu.org/licenses.
|
|
|
|
*/
|
|
|
|
|
2020-04-23 06:04:11 +03:00
|
|
|
// Package filter provides the interface and implementations of the filters
|
|
|
|
// to be used on video input that has been lexed.
|
2019-12-20 03:12:51 +03:00
|
|
|
package filter
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
2019-12-23 04:29:17 +03:00
|
|
|
// Interface for all filters.
|
2019-12-20 03:12:51 +03:00
|
|
|
type Filter interface {
|
|
|
|
io.WriteCloser
|
2019-12-23 03:59:25 +03:00
|
|
|
//NB: Filter interface may evolve with more methods as required.
|
2019-12-20 03:12:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// The NoOp filter will perform no operation on the data that is being recieved,
|
|
|
|
// it will pass it on to the encoder with no changes.
|
|
|
|
type NoOp struct {
|
|
|
|
dst io.Writer
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewNoOp(dst io.Writer) *NoOp { return &NoOp{dst: dst} }
|
|
|
|
|
|
|
|
func (n *NoOp) Write(p []byte) (int, error) { return n.dst.Write(p) }
|
|
|
|
|
|
|
|
func (n *NoOp) Close() error { return nil }
|