input/gvctrl/gvctrl.go: adapted Height option function to support channel 1 resolution options (just 1080p so far)

This commit is contained in:
Saxon 2019-10-25 00:31:51 +10:30
parent 710a245c89
commit d3cb619389
1 changed files with 9 additions and 1 deletions

View File

@ -148,7 +148,15 @@ func CodecOut(c Codec) Option {
// heights are 256, 360 and 720. // heights are 256, 360 and 720.
func Height(h int) Option { func Height(h int) Option {
return func(s settings) (settings, error) { return func(s settings) (settings, error) {
v, ok := map[int]string{256: res256, 360: res360, 720: res720}[h] var m map[int]string
switch s.ch {
case 1:
// TODO: add other resolutions supported by channel 1.
m = map[int]string{1080: res1080}
case 2:
m = map[int]string{256: res256, 360: res360, 720: res720}
}
v, ok := m[h]
if !ok { if !ok {
return s, fmt.Errorf("invalid display height: %d", h) return s, fmt.Errorf("invalid display height: %d", h)
} }