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
|
|
|
|
|
2021-02-22 07:45:30 +03:00
|
|
|
// All available codecs for reference in any application.
|
2021-02-22 08:00:00 +03:00
|
|
|
// When adding or removing a codec from this list, the IsValid function below must be updated.
|
2021-02-22 06:46:41 +03:00
|
|
|
const (
|
2021-02-22 07:45:30 +03:00
|
|
|
PCM = "pcm"
|
|
|
|
ADPCM = "adpcm"
|
|
|
|
H264 = "h264"
|
|
|
|
H265 = "h265"
|
|
|
|
MJPEG = "mjpeg"
|
|
|
|
JPEG = "jpeg"
|
2021-02-22 06:46:41 +03:00
|
|
|
)
|
|
|
|
|
2021-02-22 07:45:30 +03:00
|
|
|
// IsValid checks if a string is a known and valid codec in the right format.
|
|
|
|
func IsValid(s string) bool {
|
|
|
|
switch s {
|
|
|
|
case PCM, ADPCM, H264, H265, MJPEG, JPEG:
|
|
|
|
return true
|
2021-02-22 06:46:41 +03:00
|
|
|
default:
|
2021-02-22 07:45:30 +03:00
|
|
|
return false
|
2021-02-22 06:46:41 +03:00
|
|
|
}
|
2019-06-18 12:05:45 +03:00
|
|
|
}
|