/*
NAME
  list.go

AUTHOR
  Trek Hopton <trek@ausocean.org>

LICENSE
  This file 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 [GNU licenses](http://www.gnu.org/licenses).
*/

package codecutil

// numCodecs is the number of entries in the list of codecs.
const numCodecs = 5

// A global list containing all available codecs for reference in any application.
// When adding or removing a codec from this list, the numCodecs const must be updated.
const (
	Undef = iota
	PCM
	ADPCM
	H264
	H265
	MJPEG
)

// IsValid recieves an int representing a codec and checks if it is valid.
func IsValid(codec uint8) bool {
	return 0 <= codec && codec < numCodecs
}