forked from use-go/onvif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onvif.go
1913 lines (1526 loc) · 51.8 KB
/
onvif.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package onvif
import (
"github.com/ErfannNikooee/onvif/xsd"
)
// BUG(r): Enum types implemented as simple string
//TODO: enumerations
//TODO: type <typeName> struct {Any string} convert to type <typeName> AnyType
//TODO: process restrictions
//todo посмотреть все Extensions (Any string)
//todo что делать с xs:any = Any
//todo IntList и ему подобные. Проверить нужен ли слайс. Изменить на slice
//todo посмотреть можно ли заменить StreamType и ему подобные типы на вмтроенные типы
//todo оттестировать тип VideoSourceMode из-за Description-а
//todo в документации описать, что Capabilities повторяеся у каждого сервиса, поэтому у каждого свой Capabilities (MediaCapabilities)
//todo AuxiliaryData и другие simpleTypes, как реализовать рестрикшн
//todo Name и ему подобные необходимо изучить на наличие "List of..." ошибок
//todo Add in buit in
type ContentType string // minLength value="3"
type DNSName xsd.Token
type DeviceEntity struct {
Token ReferenceToken `xml:"token,attr"`
}
type ReferenceToken xsd.String
type Name xsd.String
type IntRectangle struct {
X int `xml:"x,attr"`
Y int `xml:"y,attr"`
Width int `xml:"width,attr"`
Height int `xml:"height,attr"`
}
type IntRectangleRange struct {
XRange IntRange
YRange IntRange
WidthRange IntRange
HeightRange IntRange
}
type IntRange struct {
Min int
Max int
}
type FloatRange struct {
Min float64 `xml:"Min"`
Max float64 `xml:"Max"`
}
type OSDConfiguration struct {
DeviceEntity `xml:"token,attr"`
VideoSourceConfigurationToken OSDReference `xml:"onvif:VideoSourceConfigurationToken"`
Type OSDType `xml:"onvif:Type"`
Position OSDPosConfiguration `xml:"onvif:Position"`
TextString OSDTextConfiguration `xml:"onvif:TextString"`
Image OSDImgConfiguration `xml:"onvif:Image"`
Extension OSDConfigurationExtension `xml:"onvif:Extension"`
}
type OSDType xsd.String
type OSDPosConfiguration struct {
Type string `xml:"onvif:Type"`
Pos Vector `xml:"onvif:Pos"`
Extension OSDPosConfigurationExtension `xml:"onvif:Extension"`
}
type Vector struct {
X float64 `xml:"x,attr"`
Y float64 `xml:"y,attr"`
}
type OSDPosConfigurationExtension xsd.AnyType
type OSDReference ReferenceToken
type OSDTextConfiguration struct {
IsPersistentText xsd.Boolean `xml:"IsPersistentText,attr"`
Type xsd.String `xml:"onvif:Type"`
DateFormat xsd.String `xml:"onvif:DateFormat"`
TimeFormat xsd.String `xml:"onvif:TimeFormat"`
FontSize xsd.Int `xml:"onvif:FontSize"`
FontColor OSDColor `xml:"onvif:FontColor"`
BackgroundColor OSDColor `xml:"onvif:BackgroundColor"`
PlainText xsd.String `xml:"onvif:PlainText"`
Extension OSDTextConfigurationExtension `xml:"onvif:Extension"`
}
type OSDColor struct {
Transparent int `xml:"Transparent,attr"`
Color Color `xml:"onvif:Color"`
}
type Color struct {
X float64 `xml:"X,attr"`
Y float64 `xml:"Y,attr"`
Z float64 `xml:"Z,attr"`
Colorspace xsd.AnyURI `xml:"Colorspace,attr"`
}
type OSDTextConfigurationExtension xsd.AnyType
type OSDImgConfiguration struct {
ImgPath xsd.AnyURI `xml:"onvif:ImgPath"`
Extension OSDImgConfigurationExtension `xml:"onvif:Extension"`
}
type OSDImgConfigurationExtension xsd.AnyType
type OSDConfigurationExtension xsd.AnyType
type VideoSource struct {
DeviceEntity
Framerate float64
Resolution VideoResolution
Imaging ImagingSettings
Extension VideoSourceExtension
}
type VideoResolution struct {
Width xsd.Int `xml:"Width"`
Height xsd.Int `xml:"Height"`
}
type ImagingSettings struct {
BacklightCompensation BacklightCompensation
Brightness float64
ColorSaturation float64
Contrast float64
Exposure Exposure
Focus FocusConfiguration
IrCutFilter IrCutFilterMode
Sharpness float64
WideDynamicRange WideDynamicRange
WhiteBalance WhiteBalance
Extension ImagingSettingsExtension
}
type BacklightCompensation struct {
Mode BacklightCompensationMode
Level float64
}
type BacklightCompensationMode xsd.String
type Exposure struct {
Mode ExposureMode
Priority ExposurePriority
Window Rectangle
MinExposureTime float64
MaxExposureTime float64
MinGain float64
MaxGain float64
MinIris float64
MaxIris float64
ExposureTime float64
Gain float64
Iris float64
}
type ExposureMode xsd.String
type ExposurePriority xsd.String
type Rectangle struct {
Bottom float64 `xml:"bottom,attr"`
Top float64 `xml:"top,attr"`
Right float64 `xml:"right,attr"`
Left float64 `xml:"left,attr"`
}
type FocusConfiguration struct {
AutoFocusMode AutoFocusMode
DefaultSpeed float64
NearLimit float64
FarLimit float64
}
type AutoFocusMode xsd.String
type IrCutFilterMode xsd.String
type WideDynamicRange struct {
Mode WideDynamicMode `xml:"onvif:Mode"`
Level float64 `xml:"onvif:Level"`
}
type WideDynamicMode xsd.String
type WhiteBalance struct {
Mode WhiteBalanceMode
CrGain float64
CbGain float64
}
type WhiteBalanceMode xsd.String
type ImagingSettingsExtension xsd.AnyType
type VideoSourceExtension struct {
Imaging ImagingSettings20
Extension VideoSourceExtension2
}
type ImagingSettings20 struct {
BacklightCompensation *BacklightCompensation20 `xml:"BacklightCompensation"`
Brightness float64 `xml:"Brightness,omitempty"`
ColorSaturation float64 `xml:"ColorSaturation,omitempty"`
Contrast float64 `xml:"Contrast,omitempty"`
Exposure *Exposure20 `xml:"Exposure"`
Focus *FocusConfiguration20 `xml:"Focus"`
IrCutFilter *IrCutFilterMode `xml:"IrCutFilter"`
Sharpness float64 `xml:"Sharpness,omitempty"`
WideDynamicRange *WideDynamicRange20 `xml:"WideDynamicRange"`
WhiteBalance *WhiteBalance20 `xml:"WhiteBalance"`
Extension *ImagingSettingsExtension20 `xml:"Extension"`
}
type BacklightCompensation20 struct {
Mode BacklightCompensationMode `xml:"Mode"`
Level float64 `xml:"Level"`
}
type Exposure20 struct {
Mode ExposureMode `xml:"Mode,omitempty"`
Priority ExposurePriority `xml:"Priority,omitempty"`
Window Rectangle `xml:"Window,omitempty"`
MinExposureTime float64 `xml:"MinExposureTime,omitempty"`
MaxExposureTime float64 `xml:"MaxExposureTime,omitempty"`
MinGain float64 `xml:"MinGain,omitempty"`
MaxGain float64 `xml:"MaxGain,omitempty"`
MinIris float64 `xml:"MinIris,omitempty"`
MaxIris float64 `xml:"MaxIris,omitempty"`
ExposureTime float64 `xml:"ExposureTime,omitempty"`
Gain float64 `xml:"Gain,omitempty"`
Iris float64 `xml:"Iris,omitempty"`
}
type FocusConfiguration20 struct {
AutoFocusMode AutoFocusMode `xml:"AutoFocusMode"`
DefaultSpeed float64 `xml:"DefaultSpeed"`
NearLimit float64 `xml:"NearLimit"`
FarLimit float64 `xml:"FarLimit"`
Extension FocusConfiguration20Extension `xml:"Extension"`
}
type FocusConfiguration20Extension xsd.AnyType
type WideDynamicRange20 struct {
Mode WideDynamicMode `xml:"Mode"`
Level float64 `xml:"Level"`
}
type WhiteBalance20 struct {
Mode WhiteBalanceMode `xml:"Mode"`
CrGain float64 `xml:"CrGain"`
CbGain float64 `xml:"CbGain"`
Extension WhiteBalance20Extension `xml:"Extension"`
}
type WhiteBalance20Extension xsd.AnyType
type ImagingSettingsExtension20 struct {
ImageStabilization ImageStabilization `xml:"ImageStabilization"`
Extension ImagingSettingsExtension202 `xml:"Extension"`
}
type ImageStabilization struct {
Mode ImageStabilizationMode `xml:"Mode"`
Level float64 `xml:"Level"`
Extension ImageStabilizationExtension `xml:"Extension"`
}
type ImageStabilizationMode xsd.String
type ImageStabilizationExtension xsd.AnyType
type ImagingSettingsExtension202 struct {
IrCutFilterAutoAdjustment IrCutFilterAutoAdjustment `xml:"IrCutFilterAutoAdjustment"`
Extension ImagingSettingsExtension203 `xml:"Extension"`
}
type IrCutFilterAutoAdjustment struct {
BoundaryType string `xml:"onvif:BoundaryType"`
BoundaryOffset float64 `xml:"onvif:BoundaryOffset"`
ResponseTime xsd.Duration `xml:"onvif:ResponseTime"`
Extension IrCutFilterAutoAdjustmentExtension `xml:"onvif:Extension"`
}
type IrCutFilterAutoAdjustmentExtension xsd.AnyType
type ImagingSettingsExtension203 struct {
ToneCompensation ToneCompensation `xml:"onvif:ToneCompensation"`
Defogging Defogging `xml:"onvif:Defogging"`
NoiseReduction NoiseReduction `xml:"onvif:NoiseReduction"`
Extension ImagingSettingsExtension204 `xml:"onvif:Extension"`
}
type ImagingStatus20 struct {
FocusStatus FocusStatus20 `xml:"FocusStatus20"`
Extension string `xml:"Extention"`
}
type FocusStatus20 struct {
Position float64 `xml:"Position"`
MoveStatus string `xml:"MoveStatus"`
Error string `xml:"Error"`
Extension string `xml:"FocusStatus20Extension"`
}
type ToneCompensation struct {
Mode string `xml:"onvif:Mode"`
Level float64 `xml:"onvif:Level"`
Extension ToneCompensationExtension `xml:"onvif:Extension"`
}
type ToneCompensationExtension xsd.AnyType
type Defogging struct {
Mode string
Level float64
Extension DefoggingExtension
}
type DefoggingExtension xsd.AnyType
type NoiseReduction struct {
Level float64 `xml:"onvif:Level"`
}
type ImagingSettingsExtension204 xsd.AnyType
type VideoSourceExtension2 xsd.AnyType
type AudioSource struct {
DeviceEntity
Channels int
}
type AudioOutput struct {
DeviceEntity
}
type Profile struct { // TODO: Profile
Token ReferenceToken `xml:"token,attr"`
Fixed bool `xml:"fixed,attr"`
Name Name
VideoSourceConfiguration VideoSourceConfiguration //fix
AudioSourceConfiguration AudioSourceConfiguration
VideoEncoderConfiguration VideoEncoderConfiguration
AudioEncoderConfiguration AudioEncoderConfiguration
VideoAnalyticsConfiguration VideoAnalyticsConfiguration
PTZConfiguration PTZConfiguration
MetadataConfiguration MetadataConfiguration
Extension ProfileExtension
}
type VideoSourceConfiguration struct {
ConfigurationEntity
ViewMode string `xml:"ViewMode,attr"`
SourceToken ReferenceToken `xml:"SourceToken"`
Bounds IntRectangle `xml:"Bounds"`
Extension VideoSourceConfigurationExtension `xml:"Extension"`
}
type ConfigurationEntity struct {
Token ReferenceToken `xml:"token,attr"`
Name Name `xml:"Name"`
UseCount int `xml:"UseCount"`
}
type VideoSourceConfigurationExtension struct {
Rotate Rotate `xml:"Rotate"`
Extension VideoSourceConfigurationExtension2 `xml:"Extension"`
}
type Rotate struct {
Mode RotateMode `xml:"Mode"`
Degree xsd.Int `xml:"Degree"`
Extension RotateExtension `xml:"Extension"`
}
type RotateMode xsd.String
type RotateExtension xsd.AnyType
type VideoSourceConfigurationExtension2 struct {
LensDescription LensDescription `xml:"LensDescription"`
SceneOrientation SceneOrientation `xml:"SceneOrientation"`
}
type LensDescription struct {
FocalLength float64 `xml:"FocalLength,attr"`
Offset LensOffset `xml:"Offset"`
Projection LensProjection `xml:"Projection"`
XFactor float64 `xml:"XFactor"`
}
type LensOffset struct {
X float64 `xml:"x,attr"`
Y float64 `xml:"y,attr"`
}
type LensProjection struct {
Angle float64 `xml:"onvif:Angle"`
Radius float64 `xml:"onvif:Radius"`
Transmittance float64 `xml:"onvif:Transmittance"`
}
type SceneOrientation struct {
Mode SceneOrientationMode `xml:"onvif:Mode"`
Orientation xsd.String `xml:"onvif:Orientation"`
}
type SceneOrientationMode xsd.String
type AudioSourceConfiguration struct {
ConfigurationEntity
SourceToken ReferenceToken `xml:"SourceToken"`
}
type VideoEncoderConfiguration struct {
ConfigurationEntity
Encoding VideoEncoding `xml:"Encoding"`
Resolution VideoResolution `xml:"Resolution"`
Quality float64 `xml:"Quality"`
RateControl VideoRateControl `xml:"RateControl"`
MPEG4 Mpeg4Configuration `xml:"MPEG4"`
H264 H264Configuration `xml:"H264"`
Multicast MulticastConfiguration `xml:"Multicast"`
SessionTimeout xsd.Duration `xml:"SessionTimeout"`
}
type VideoEncoding xsd.String
type VideoRateControl struct {
FrameRateLimit xsd.Int `xml:"FrameRateLimit"`
EncodingInterval xsd.Int `xml:"EncodingInterval"`
BitrateLimit xsd.Int `xml:"BitrateLimit"`
}
type Mpeg4Configuration struct {
GovLength xsd.Int `xml:"GovLength"`
Mpeg4Profile Mpeg4Profile `xml:"Mpeg4Profile"`
}
type Mpeg4Profile xsd.String
type H264Configuration struct {
GovLength xsd.Int `xml:"GovLength"`
H264Profile H264Profile `xml:"H264Profile"`
}
type H264Profile xsd.String
type MulticastConfiguration struct {
Address IPAddress `xml:"Address"`
Port int `xml:"Port"`
TTL int `xml:"TTL"`
AutoStart xsd.Boolean `xml:"AutoStart"`
}
type IPAddress struct {
Type IPType `xml:"Type"`
IPv4Address IPv4Address `xml:"IPv4Address"`
IPv6Address IPv6Address `xml:"IPv6Address"`
}
type IPType xsd.String
// IPv4 address
type IPv4Address xsd.Token
// IPv6 address
type IPv6Address xsd.Token
type AudioEncoderConfiguration struct {
ConfigurationEntity
Encoding AudioEncoding `xml:"Encoding"`
Bitrate int `xml:"Bitrate"`
SampleRate int `xml:"SampleRate"`
Multicast MulticastConfiguration `xml:"Multicast"`
SessionTimeout xsd.Duration `xml:"SessionTimeout"`
}
type AudioEncoding xsd.String
type VideoAnalyticsConfiguration struct {
ConfigurationEntity
AnalyticsEngineConfiguration AnalyticsEngineConfiguration `xml:"AnalyticsEngineConfiguration"`
RuleEngineConfiguration RuleEngineConfiguration `xml:"RuleEngineConfiguration"`
}
type AnalyticsEngineConfiguration struct {
AnalyticsModule Config `xml:"AnalyticsModule"`
Extension AnalyticsEngineConfigurationExtension `xml:"Extension"`
}
type Config struct {
Name string `xml:"Name,attr"`
Type xsd.QName `xml:"Type,attr"`
Parameters ItemList `xml:"Parameters"`
}
type ItemList struct {
SimpleItem []SimpleItem `xml:"SimpleItem"`
ElementItem ElementItem `xml:"ElementItem"`
Extension ItemListExtension `xml:"Extension"`
}
type SimpleItem struct {
Name string `xml:"Name,attr"`
Value xsd.AnySimpleType `xml:"Value,attr"`
}
type ElementItem struct { // TODO: CallLayout, Transformation
Name string `xml:"Name,attr"`
}
type ItemListExtension xsd.AnyType
type AnalyticsEngineConfigurationExtension xsd.AnyType
type RuleEngineConfiguration struct {
Rule Config `xml:"Rule"`
Extension RuleEngineConfigurationExtension `xml:"Extension"`
}
type RuleEngineConfigurationExtension xsd.AnyType
type PTZConfiguration struct {
ConfigurationEntity
MoveRamp int `xml:"MoveRamp,attr"`
PresetRamp int `xml:"PresetRamp,attr"`
PresetTourRamp int `xml:"PresetTourRamp,attr"`
NodeToken ReferenceToken `xml:"NodeToken"`
DefaultAbsolutePantTiltPositionSpace xsd.AnyURI `xml:"DefaultAbsolutePantTiltPositionSpace"`
DefaultAbsoluteZoomPositionSpace xsd.AnyURI `xml:"DefaultAbsoluteZoomPositionSpace"`
DefaultRelativePanTiltTranslationSpace xsd.AnyURI `xml:"DefaultRelativePanTiltTranslationSpace"`
DefaultRelativeZoomTranslationSpace xsd.AnyURI `xml:"DefaultRelativeZoomTranslationSpace"`
DefaultContinuousPanTiltVelocitySpace xsd.AnyURI `xml:"DefaultContinuousPanTiltVelocitySpace"`
DefaultContinuousZoomVelocitySpace xsd.AnyURI `xml:"DefaultContinuousZoomVelocitySpace"`
DefaultPTZSpeed PTZSpeed `xml:"DefaultPTZSpeed"`
DefaultPTZTimeout xsd.Duration `xml:"DefaultPTZTimeout"`
PanTiltLimits PanTiltLimits `xml:"PanTiltLimits"`
ZoomLimits ZoomLimits `xml:"ZoomLimits"`
Extension PTZConfigurationExtension `xml:"Extension"`
}
type PTZSpeed struct {
PanTilt Vector2D `xml:"PanTilt"`
Zoom Vector1D `xml:"Zoom"`
}
type Vector2D struct {
X float64 `xml:"x,attr"`
Y float64 `xml:"y,attr"`
Space xsd.AnyURI `xml:"space,attr"`
}
type Vector1D struct {
X float64 `xml:"x,attr"`
Space xsd.AnyURI `xml:"space,attr"`
}
type PanTiltLimits struct {
Range Space2DDescription `xml:"Range"`
}
type Space2DDescription struct {
URI xsd.AnyURI `xml:"URI"`
XRange FloatRange `xml:"XRange"`
YRange FloatRange `xml:"YRange"`
}
type ZoomLimits struct {
Range Space1DDescription `xml:"Range"`
}
type Space1DDescription struct {
URI xsd.AnyURI `xml:"URI"`
XRange FloatRange `xml:"XRange"`
}
type PTZConfigurationExtension struct {
PTControlDirection PTControlDirection `xml:"PTControlDirection"`
Extension PTZConfigurationExtension2 `xml:"Extension"`
}
type PTControlDirection struct {
EFlip EFlip `xml:"EFlip"`
Reverse Reverse `xml:"Reverse"`
Extension PTControlDirectionExtension `xml:"Extension"`
}
type EFlip struct {
Mode EFlipMode `xml:"onvif:Mode"`
}
type EFlipMode xsd.String
type Reverse struct {
Mode ReverseMode `xml:"onvif:Mode"`
}
type ReverseMode xsd.String
type PTControlDirectionExtension xsd.AnyType
type PTZConfigurationExtension2 xsd.AnyType
type MetadataConfiguration struct {
ConfigurationEntity
CompressionType string `xml:"CompressionType,attr"`
PTZStatus PTZFilter `xml:"PTZStatus"`
Events EventSubscription `xml:"Events"`
Analytics xsd.Boolean `xml:"Analytics"`
Multicast MulticastConfiguration `xml:"Multicast"`
SessionTimeout xsd.Duration `xml:"SessionTimeout"`
AnalyticsEngineConfiguration AnalyticsEngineConfiguration `xml:"AnalyticsEngineConfiguration"`
Extension MetadataConfigurationExtension `xml:"Extension"`
}
type PTZFilter struct {
Status bool `xml:"Status"`
Position bool `xml:"Position"`
}
type EventSubscription struct {
Filter FilterType `xml:"Filter"`
SubscriptionPolicy `xml:"SubscriptionPolicy"`
}
type FilterType xsd.AnyType
type SubscriptionPolicy xsd.AnyType
type MetadataConfigurationExtension xsd.AnyType
type ProfileExtension struct {
AudioOutputConfiguration AudioOutputConfiguration
AudioDecoderConfiguration AudioDecoderConfiguration
Extension ProfileExtension2
}
type AudioOutputConfiguration struct {
ConfigurationEntity
OutputToken ReferenceToken `xml:"OutputToken"`
SendPrimacy xsd.AnyURI `xml:"SendPrimacy"`
OutputLevel int `xml:"OutputLevel"`
}
type AudioDecoderConfiguration struct {
ConfigurationEntity
}
type ProfileExtension2 xsd.AnyType
type VideoSourceConfigurationOptions struct {
MaximumNumberOfProfiles int `xml:"MaximumNumberOfProfiles,attr"`
BoundsRange IntRectangleRange
VideoSourceTokensAvailable ReferenceToken
Extension VideoSourceConfigurationOptionsExtension
}
type VideoSourceConfigurationOptionsExtension struct {
Rotate RotateOptions
Extension VideoSourceConfigurationOptionsExtension2
}
type RotateOptions struct {
Mode RotateMode
DegreeList IntList
Extension RotateOptionsExtension
}
type IntList struct {
Items []int
}
type RotateOptionsExtension xsd.AnyType
type VideoSourceConfigurationOptionsExtension2 struct {
SceneOrientationMode SceneOrientationMode
}
type VideoEncoderConfigurationOptions struct {
QualityRange IntRange
JPEG JpegOptions
MPEG4 Mpeg4Options
H264 H264Options
Extension VideoEncoderOptionsExtension
}
type JpegOptions struct {
ResolutionsAvailable VideoResolution
FrameRateRange IntRange
EncodingIntervalRange IntRange
}
type Mpeg4Options struct {
ResolutionsAvailable VideoResolution
GovLengthRange IntRange
FrameRateRange IntRange
EncodingIntervalRange IntRange
Mpeg4ProfilesSupported Mpeg4Profile
}
type H264Options struct {
ResolutionsAvailable VideoResolution
GovLengthRange IntRange
FrameRateRange IntRange
EncodingIntervalRange IntRange
H264ProfilesSupported H264Profile
}
type VideoEncoderOptionsExtension struct {
JPEG JpegOptions2
MPEG4 Mpeg4Options2
H264 H264Options2
Extension VideoEncoderOptionsExtension2
}
type JpegOptions2 struct {
JpegOptions
BitrateRange IntRange
}
type Mpeg4Options2 struct {
Mpeg4Options
BitrateRange IntRange
}
type H264Options2 struct {
H264Options
BitrateRange IntRange
}
type VideoEncoderOptionsExtension2 xsd.AnyType
type AudioSourceConfigurationOptions struct {
InputTokensAvailable ReferenceToken
Extension AudioSourceOptionsExtension
}
type AudioSourceOptionsExtension xsd.AnyType
type AudioEncoderConfigurationOptions struct {
Options AudioEncoderConfigurationOption
}
type AudioEncoderConfigurationOption struct {
Encoding AudioEncoding
BitrateList IntList
SampleRateList IntList
}
type MetadataConfigurationOptions struct {
PTZStatusFilterOptions PTZStatusFilterOptions
Extension MetadataConfigurationOptionsExtension
}
type PTZStatusFilterOptions struct {
PanTiltStatusSupported bool
ZoomStatusSupported bool
PanTiltPositionSupported bool
ZoomPositionSupported bool
Extension PTZStatusFilterOptionsExtension
}
type PTZStatusFilterOptionsExtension xsd.AnyType
type MetadataConfigurationOptionsExtension struct {
CompressionType string
Extension MetadataConfigurationOptionsExtension2
}
type MetadataConfigurationOptionsExtension2 xsd.AnyType
type AudioOutputConfigurationOptions struct {
OutputTokensAvailable ReferenceToken
SendPrimacyOptions xsd.AnyURI
OutputLevelRange IntRange
}
type AudioDecoderConfigurationOptions struct {
AACDecOptions AACDecOptions
G711DecOptions G711DecOptions
G726DecOptions G726DecOptions
Extension AudioDecoderConfigurationOptionsExtension
}
type AACDecOptions struct {
Bitrate IntList
SampleRateRange IntList
}
type G711DecOptions struct {
Bitrate IntList
SampleRateRange IntList
}
type G726DecOptions struct {
Bitrate IntList
SampleRateRange IntList
}
type AudioDecoderConfigurationOptionsExtension xsd.AnyType
type StreamSetup struct {
Stream StreamType `xml:"onvif:Stream"`
Transport Transport `xml:"onvif:Transport"`
}
type StreamType xsd.String
type Transport struct {
Protocol TransportProtocol `xml:"onvif:Protocol"`
Tunnel *Transport `xml:"onvif:Tunnel"`
}
// enum
type TransportProtocol xsd.String
type MediaUri struct {
Uri xsd.AnyURI
InvalidAfterConnect bool
InvalidAfterReboot bool
Timeout xsd.Duration
}
type VideoSourceMode struct {
Token ReferenceToken `xml:"token,attr"`
Enabled bool `xml:"Enabled,attr"`
MaxFramerate float64
MaxResolution VideoResolution
Encodings EncodingTypes
Reboot bool
Description Description
Extension VideoSourceModeExtension
}
type EncodingTypes struct {
EncodingTypes []string
}
type Description struct {
Description string
}
type VideoSourceModeExtension xsd.AnyType
type OSDConfigurationOptions struct {
MaximumNumberOfOSDs MaximumNumberOfOSDs
Type OSDType
PositionOption string
TextOption OSDTextOptions
ImageOption OSDImgOptions
Extension OSDConfigurationOptionsExtension
}
type MaximumNumberOfOSDs struct {
Total int `xml:"Total,attr"`
Image int `xml:"Image,attr"`
PlainText int `xml:"PlainText,attr"`
Date int `xml:"Date,attr"`
Time int `xml:"Time,attr"`
DateAndTime int `xml:"DateAndTime,attr"`
}
type OSDTextOptions struct {
Type string
FontSizeRange IntRange
DateFormat string
TimeFormat string
FontColor OSDColorOptions
BackgroundColor OSDColorOptions
Extension OSDTextOptionsExtension
}
type OSDColorOptions struct {
Color ColorOptions
Transparent IntRange
Extension OSDColorOptionsExtension
}
type ColorOptions struct {
ColorList Color
ColorspaceRange ColorspaceRange
}
type ColorspaceRange struct {
X FloatRange
Y FloatRange
Z FloatRange
Colorspace xsd.AnyURI
}
type OSDColorOptionsExtension xsd.AnyType
type OSDTextOptionsExtension xsd.AnyType
type OSDImgOptions struct {
FormatsSupported StringAttrList `xml:"FormatsSupported,attr"`
MaxSize int `xml:"MaxSize,attr"`
MaxWidth int `xml:"MaxWidth,attr"`
MaxHeight int `xml:"MaxHeight,attr"`
ImagePath xsd.AnyURI
Extension OSDImgOptionsExtension
}
type StringAttrList struct {
AttrList []string
}
type OSDImgOptionsExtension xsd.AnyType
type OSDConfigurationOptionsExtension xsd.AnyType
//PTZ
type PTZNode struct {
DeviceEntity
FixedHomePosition xsd.Boolean `xml:"FixedHomePosition,attr"`
GeoMove xsd.Boolean `xml:"GeoMove,attr"`
Name Name
SupportedPTZSpaces PTZSpaces
MaximumNumberOfPresets int
HomeSupported xsd.Boolean
AuxiliaryCommands AuxiliaryData
Extension PTZNodeExtension
}
type PTZSpaces struct {
AbsolutePanTiltPositionSpace Space2DDescription
AbsoluteZoomPositionSpace Space1DDescription
RelativePanTiltTranslationSpace Space2DDescription
RelativeZoomTranslationSpace Space1DDescription
ContinuousPanTiltVelocitySpace Space2DDescription
ContinuousZoomVelocitySpace Space1DDescription
PanTiltSpeedSpace Space1DDescription
ZoomSpeedSpace Space1DDescription
Extension PTZSpacesExtension
}
type PTZSpacesExtension xsd.AnyType
// TODO: restriction
type AuxiliaryData xsd.String
type PTZNodeExtension struct {
SupportedPresetTour PTZPresetTourSupported
Extension PTZNodeExtension2
}
type PTZPresetTourSupported struct {
MaximumNumberOfPresetTours int
PTZPresetTourOperation PTZPresetTourOperation
Extension PTZPresetTourSupportedExtension
}
type PTZPresetTourOperation xsd.String
type PTZPresetTourSupportedExtension xsd.AnyType
type PTZNodeExtension2 xsd.AnyType
type PTZConfigurationOptions struct {
PTZRamps IntAttrList `xml:"PTZRamps,attr"`
Spaces PTZSpaces
PTZTimeout DurationRange
PTControlDirection PTControlDirectionOptions
Extension PTZConfigurationOptions2
}
type IntAttrList struct {
IntAttrList []int
}
type DurationRange struct {
Min xsd.Duration
Max xsd.Duration
}
type PTControlDirectionOptions struct {
EFlip EFlipOptions
Reverse ReverseOptions
Extension PTControlDirectionOptionsExtension