-
-
Notifications
You must be signed in to change notification settings - Fork 327
/
system_info.go
222 lines (157 loc) · 7.6 KB
/
system_info.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// This file is generated by "./lib/proto/generate"
package proto
import (
"github.com/ysmood/gson"
)
/*
SystemInfo
The SystemInfo domain defines methods and events for querying low-level system information.
*/
// SystemInfoGPUDevice Describes a single graphics processor (GPU).
type SystemInfoGPUDevice struct {
// VendorID PCI ID of the GPU vendor, if available; 0 otherwise.
VendorID float64 `json:"vendorId"`
// DeviceID PCI ID of the GPU device, if available; 0 otherwise.
DeviceID float64 `json:"deviceId"`
// SubSysID (optional) Sub sys ID of the GPU, only available on Windows.
SubSysID float64 `json:"subSysId,omitempty"`
// Revision (optional) Revision of the GPU, only available on Windows.
Revision float64 `json:"revision,omitempty"`
// VendorString String description of the GPU vendor, if the PCI ID is not available.
VendorString string `json:"vendorString"`
// DeviceString String description of the GPU device, if the PCI ID is not available.
DeviceString string `json:"deviceString"`
// DriverVendor String description of the GPU driver vendor.
DriverVendor string `json:"driverVendor"`
// DriverVersion String description of the GPU driver version.
DriverVersion string `json:"driverVersion"`
}
// SystemInfoSize Describes the width and height dimensions of an entity.
type SystemInfoSize struct {
// Width Width in pixels.
Width int `json:"width"`
// Height Height in pixels.
Height int `json:"height"`
}
// SystemInfoVideoDecodeAcceleratorCapability Describes a supported video decoding profile with its associated minimum and
// maximum resolutions.
type SystemInfoVideoDecodeAcceleratorCapability struct {
// Profile Video codec profile that is supported, e.g. VP9 Profile 2.
Profile string `json:"profile"`
// MaxResolution Maximum video dimensions in pixels supported for this |profile|.
MaxResolution *SystemInfoSize `json:"maxResolution"`
// MinResolution Minimum video dimensions in pixels supported for this |profile|.
MinResolution *SystemInfoSize `json:"minResolution"`
}
// SystemInfoVideoEncodeAcceleratorCapability Describes a supported video encoding profile with its associated maximum
// resolution and maximum framerate.
type SystemInfoVideoEncodeAcceleratorCapability struct {
// Profile Video codec profile that is supported, e.g H264 Main.
Profile string `json:"profile"`
// MaxResolution Maximum video dimensions in pixels supported for this |profile|.
MaxResolution *SystemInfoSize `json:"maxResolution"`
// MaxFramerateNumerator Maximum encoding framerate in frames per second supported for this
// |profile|, as fraction's numerator and denominator, e.g. 24/1 fps,
// 24000/1001 fps, etc.
MaxFramerateNumerator int `json:"maxFramerateNumerator"`
// MaxFramerateDenominator ...
MaxFramerateDenominator int `json:"maxFramerateDenominator"`
}
// SystemInfoSubsamplingFormat YUV subsampling type of the pixels of a given image.
type SystemInfoSubsamplingFormat string
const (
// SystemInfoSubsamplingFormatYuv420 enum const
SystemInfoSubsamplingFormatYuv420 SystemInfoSubsamplingFormat = "yuv420"
// SystemInfoSubsamplingFormatYuv422 enum const
SystemInfoSubsamplingFormatYuv422 SystemInfoSubsamplingFormat = "yuv422"
// SystemInfoSubsamplingFormatYuv444 enum const
SystemInfoSubsamplingFormatYuv444 SystemInfoSubsamplingFormat = "yuv444"
)
// SystemInfoImageType Image format of a given image.
type SystemInfoImageType string
const (
// SystemInfoImageTypeJpeg enum const
SystemInfoImageTypeJpeg SystemInfoImageType = "jpeg"
// SystemInfoImageTypeWebp enum const
SystemInfoImageTypeWebp SystemInfoImageType = "webp"
// SystemInfoImageTypeUnknown enum const
SystemInfoImageTypeUnknown SystemInfoImageType = "unknown"
)
// SystemInfoImageDecodeAcceleratorCapability Describes a supported image decoding profile with its associated minimum and
// maximum resolutions and subsampling.
type SystemInfoImageDecodeAcceleratorCapability struct {
// ImageType Image coded, e.g. Jpeg.
ImageType SystemInfoImageType `json:"imageType"`
// MaxDimensions Maximum supported dimensions of the image in pixels.
MaxDimensions *SystemInfoSize `json:"maxDimensions"`
// MinDimensions Minimum supported dimensions of the image in pixels.
MinDimensions *SystemInfoSize `json:"minDimensions"`
// Subsamplings Optional array of supported subsampling formats, e.g. 4:2:0, if known.
Subsamplings []SystemInfoSubsamplingFormat `json:"subsamplings"`
}
// SystemInfoGPUInfo Provides information about the GPU(s) on the system.
type SystemInfoGPUInfo struct {
// Devices The graphics devices on the system. Element 0 is the primary GPU.
Devices []*SystemInfoGPUDevice `json:"devices"`
// AuxAttributes (optional) An optional dictionary of additional GPU related attributes.
AuxAttributes map[string]gson.JSON `json:"auxAttributes,omitempty"`
// FeatureStatus (optional) An optional dictionary of graphics features and their status.
FeatureStatus map[string]gson.JSON `json:"featureStatus,omitempty"`
// DriverBugWorkarounds An optional array of GPU driver bug workarounds.
DriverBugWorkarounds []string `json:"driverBugWorkarounds"`
// VideoDecoding Supported accelerated video decoding capabilities.
VideoDecoding []*SystemInfoVideoDecodeAcceleratorCapability `json:"videoDecoding"`
// VideoEncoding Supported accelerated video encoding capabilities.
VideoEncoding []*SystemInfoVideoEncodeAcceleratorCapability `json:"videoEncoding"`
// ImageDecoding Supported accelerated image decoding capabilities.
ImageDecoding []*SystemInfoImageDecodeAcceleratorCapability `json:"imageDecoding"`
}
// SystemInfoProcessInfo Represents process info.
type SystemInfoProcessInfo struct {
// Type Specifies process type.
Type string `json:"type"`
// ID Specifies process id.
ID int `json:"id"`
// CPUTime Specifies cumulative CPU usage in seconds across all threads of the
// process since the process start.
CPUTime float64 `json:"cpuTime"`
}
// SystemInfoGetInfo Returns information about the system.
type SystemInfoGetInfo struct {
}
// ProtoReq name
func (m SystemInfoGetInfo) ProtoReq() string { return "SystemInfo.getInfo" }
// Call the request
func (m SystemInfoGetInfo) Call(c Client) (*SystemInfoGetInfoResult, error) {
var res SystemInfoGetInfoResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// SystemInfoGetInfoResult Returns information about the system.
type SystemInfoGetInfoResult struct {
// Gpu Information about the GPUs on the system.
Gpu *SystemInfoGPUInfo `json:"gpu"`
// ModelName A platform-dependent description of the model of the machine. On Mac OS, this is, for
// example, 'MacBookPro'. Will be the empty string if not supported.
ModelName string `json:"modelName"`
// ModelVersion A platform-dependent description of the version of the machine. On Mac OS, this is, for
// example, '10.1'. Will be the empty string if not supported.
ModelVersion string `json:"modelVersion"`
// CommandLine The command line string used to launch the browser. Will be the empty string if not
// supported.
CommandLine string `json:"commandLine"`
}
// SystemInfoGetProcessInfo Returns information about all running processes.
type SystemInfoGetProcessInfo struct {
}
// ProtoReq name
func (m SystemInfoGetProcessInfo) ProtoReq() string { return "SystemInfo.getProcessInfo" }
// Call the request
func (m SystemInfoGetProcessInfo) Call(c Client) (*SystemInfoGetProcessInfoResult, error) {
var res SystemInfoGetProcessInfoResult
return &res, call(m.ProtoReq(), m, &res, c)
}
// SystemInfoGetProcessInfoResult Returns information about all running processes.
type SystemInfoGetProcessInfoResult struct {
// ProcessInfo An array of process info blocks.
ProcessInfo []*SystemInfoProcessInfo `json:"processInfo"`
}