-
Notifications
You must be signed in to change notification settings - Fork 9
/
profileType.go
36 lines (32 loc) · 930 Bytes
/
profileType.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//Copyright (c) 2017, Technomancers. All rights reserved.
//Use of this source code is governed by a BSD-style
//license that can be found in the LICENSE file.
package piCamera
//ProfileType sets the H264 profile to be used for the encoding.
type ProfileType int
const (
//ProfileNone tells this package to use whatever the default is.
ProfileNone ProfileType = iota
//ProfileBaseline is for the baseline profile
ProfileBaseline
//ProfileMain is for the main profile
ProfileMain
//ProfileHigh is for a high profile
ProfileHigh
)
//Convert takes the type and returns the string representation of that value.
//Returns true as well if it is the default value.
func (t ProfileType) Convert() (string, bool) {
switch t {
case ProfileBaseline:
return "baseline", false
case ProfileMain:
return "main", false
case ProfileHigh:
return "high", false
case ProfileNone:
fallthrough
default:
return "", true
}
}