2019-06-05 19:39:55 +03:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
2019-06-18 12:05:45 +03:00
|
|
|
// numCodecs is the number of entries in the list of codecs.
|
|
|
|
const numCodecs = 5
|
|
|
|
|
2019-06-05 19:39:55 +03:00
|
|
|
// A global list containing all available codecs for reference in any application.
|
2019-06-18 12:05:45 +03:00
|
|
|
// When adding or removing a codec from this list, the numCodecs const must be updated.
|
2019-06-05 19:39:55 +03:00
|
|
|
const (
|
|
|
|
PCM = iota
|
|
|
|
ADPCM
|
|
|
|
H264
|
|
|
|
H265
|
|
|
|
MJPEG
|
|
|
|
)
|
2019-06-18 12:05:45 +03:00
|
|
|
|
2019-06-20 11:34:58 +03:00
|
|
|
// IsValid recieves an int representing a codec and checks if it is valid.
|
|
|
|
func IsValid(codec uint8) bool {
|
|
|
|
return 0 <= codec && codec < numCodecs
|
2019-06-18 12:05:45 +03:00
|
|
|
}
|