av/filter/filter.go

50 lines
1.4 KiB
Go
Raw Normal View History

/*
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.
*/
// Package filter provides the interface and implementations of the filters to be used
2019-12-23 03:59:25 +03:00
// on video input that has been lexed.
package filter
import (
"io"
)
2019-12-23 04:29:17 +03:00
// Interface for all filters.
type Filter interface {
io.WriteCloser
2019-12-23 03:59:25 +03:00
//NB: Filter interface may evolve with more methods as required.
}
// 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} }
2020-01-20 08:49:04 +03:00
func (n *NoOp) Write(p []byte) (int, error) { return n.dst.Write(p) }
func (n *NoOp) Close() error { return nil }