-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedid.go
52 lines (48 loc) · 1.92 KB
/
edid.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package edid // import "github.com/srlehn/edid"
import (
"time"
)
type EDID struct {
Display string
data []byte
IsActive bool
Querier string
Model uint32
Serial uint64
ProductionYear uint
ProductionWeek uint
ProductionWeekFF bool
VersionMajor uint
VersionMinor uint
PNPID [3]byte
Manufacturer string
ManufacturerPNPDateOfApproval time.Time
Input string // "digital" / "analog"
VideoInterface string
BitDepth string
VSyncPulseMustBeSerratedWhenCompositeOrSyncOnGreenIsUsed bool
SyncOnGreenSupport bool
CompositeSyncOnHSyncSupport bool
SeparateSyncSupport bool
BlankToBlackSetupPedestalExpected bool
VideoWhiteAndSyncLevelsRelativeToBlank string
ResolutionPreferredX int
ResolutionPreferredY int
}
func New(b []byte) (*EDID, error) {
if !isEDID(b) {
return nil, errNotEDID
}
e := &EDID{data: b}
err := e.parse()
if err != nil {
return nil, err
}
return e, nil
}
func (e *EDID) Data() []byte {
if e == nil {
return nil
}
return e.data
}