robotpy-cscore 2025.0.0b1__cp311-cp311-macosx_13_0_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of robotpy-cscore might be problematic. Click here for more details.

cscore/_cscore.pyi ADDED
@@ -0,0 +1,1679 @@
1
+ from __future__ import annotations
2
+ import numpy
3
+ import typing
4
+ import wpiutil
5
+ __all__ = ['AxisCamera', 'CameraServer', 'CvSink', 'CvSource', 'HttpCamera', 'ImageSink', 'ImageSource', 'MjpegServer', 'RawEvent', 'UsbCamera', 'UsbCameraInfo', 'VideoCamera', 'VideoEvent', 'VideoListener', 'VideoMode', 'VideoProperty', 'VideoSink', 'VideoSource', 'runMainRunLoop', 'runMainRunLoopTimeout', 'stopMainRunLoop']
6
+ class AxisCamera(HttpCamera):
7
+ """
8
+ A source that represents an Axis IP camera.
9
+
10
+ :deprecated: Use HttpCamera instead.
11
+ """
12
+ @staticmethod
13
+ def _pybind11_conduit_v1_(*args, **kwargs):
14
+ ...
15
+ @typing.overload
16
+ def __init__(self, name: str, host: str) -> None:
17
+ """
18
+ Create a source for an Axis IP camera.
19
+
20
+ :param name: Source name (arbitrary unique identifier)
21
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
22
+ """
23
+ @typing.overload
24
+ def __init__(self, name: str, host: str) -> None:
25
+ """
26
+ Create a source for an Axis IP camera.
27
+
28
+ :param name: Source name (arbitrary unique identifier)
29
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
30
+ """
31
+ @typing.overload
32
+ def __init__(self, name: str, host: str) -> None:
33
+ """
34
+ Create a source for an Axis IP camera.
35
+
36
+ :param name: Source name (arbitrary unique identifier)
37
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
38
+ """
39
+ @typing.overload
40
+ def __init__(self, name: str, hosts: list[str]) -> None:
41
+ """
42
+ Create a source for an Axis IP camera.
43
+
44
+ :param name: Source name (arbitrary unique identifier)
45
+ :param hosts: Array of Camera host IPs/DNS names
46
+ """
47
+ class CameraServer:
48
+ """
49
+ Singleton class for creating and keeping camera servers.
50
+
51
+ Also publishes camera information to NetworkTables.
52
+ """
53
+ kBasePort: typing.ClassVar[int] = 1181
54
+ @staticmethod
55
+ def _pybind11_conduit_v1_(*args, **kwargs):
56
+ ...
57
+ @staticmethod
58
+ @typing.overload
59
+ def addAxisCamera(host: str) -> AxisCamera:
60
+ """
61
+ Adds an Axis IP camera.
62
+
63
+ This overload calls AddAxisCamera() with name "Axis Camera".
64
+
65
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
66
+
67
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
68
+ """
69
+ @staticmethod
70
+ @typing.overload
71
+ def addAxisCamera(hosts: list[str]) -> AxisCamera:
72
+ """
73
+ Adds an Axis IP camera.
74
+
75
+ This overload calls AddAxisCamera() with name "Axis Camera".
76
+
77
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
78
+
79
+ :param hosts: Array of Camera host IPs/DNS names
80
+ """
81
+ @staticmethod
82
+ @typing.overload
83
+ def addAxisCamera(name: str, host: str) -> AxisCamera:
84
+ """
85
+ Adds an Axis IP camera.
86
+
87
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
88
+
89
+ :param name: The name to give the camera
90
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
91
+ """
92
+ @staticmethod
93
+ @typing.overload
94
+ def addAxisCamera(name: str, hosts: list[str]) -> AxisCamera:
95
+ """
96
+ Adds an Axis IP camera.
97
+
98
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
99
+
100
+ :param name: The name to give the camera
101
+ :param hosts: Array of Camera host IPs/DNS names
102
+ """
103
+ @staticmethod
104
+ def addCamera(camera: VideoSource) -> None:
105
+ """
106
+ Adds an already created camera.
107
+
108
+ :param camera: Camera
109
+ """
110
+ @staticmethod
111
+ @typing.overload
112
+ def addServer(name: str) -> MjpegServer:
113
+ """
114
+ Adds a MJPEG server at the next available port.
115
+
116
+ :param name: Server name
117
+ """
118
+ @staticmethod
119
+ @typing.overload
120
+ def addServer(name: str, port: int) -> MjpegServer:
121
+ """
122
+ Adds a MJPEG server.
123
+
124
+ :param name: Server name
125
+ :param port: Port number
126
+ """
127
+ @staticmethod
128
+ @typing.overload
129
+ def addServer(server: VideoSink) -> None:
130
+ """
131
+ Adds an already created server.
132
+
133
+ :param server: Server
134
+ """
135
+ @staticmethod
136
+ def addSwitchedCamera(name: str) -> MjpegServer:
137
+ """
138
+ Adds a virtual camera for switching between two streams. Unlike the
139
+ other addCamera methods, this returns a VideoSink rather than a
140
+ VideoSource. Calling SetSource() on the returned object can be used
141
+ to switch the actual source of the stream.
142
+ """
143
+ @staticmethod
144
+ def enableLogging(level: int | None = None) -> None:
145
+ """
146
+ Enable cscore logging
147
+ """
148
+ @staticmethod
149
+ @typing.overload
150
+ def getServer() -> VideoSink:
151
+ """
152
+ Get server for the primary camera feed.
153
+
154
+ This is only valid to call after a camera feed has been added with
155
+ StartAutomaticCapture() or AddServer().
156
+ """
157
+ @staticmethod
158
+ @typing.overload
159
+ def getServer(name: str) -> VideoSink:
160
+ """
161
+ Gets a server by name.
162
+
163
+ :param name: Server name
164
+ """
165
+ @staticmethod
166
+ @typing.overload
167
+ def getVideo() -> CvSink:
168
+ """
169
+ Get OpenCV access to the primary camera feed. This allows you to
170
+ get images from the camera for image processing on the roboRIO.
171
+
172
+ This is only valid to call after a camera feed has been added
173
+ with startAutomaticCapture() or addServer().
174
+ """
175
+ @staticmethod
176
+ @typing.overload
177
+ def getVideo(camera: VideoSource) -> CvSink:
178
+ """
179
+ Get OpenCV access to the specified camera. This allows you to get
180
+ images from the camera for image processing on the roboRIO.
181
+
182
+ :param camera: Camera (e.g. as returned by startAutomaticCapture).
183
+ """
184
+ @staticmethod
185
+ @typing.overload
186
+ def getVideo(camera: VideoSource, pixelFormat: VideoMode.PixelFormat) -> CvSink:
187
+ """
188
+ Get OpenCV access to the specified camera. This allows you to get
189
+ images from the camera for image processing on the roboRIO.
190
+
191
+ :param camera: Camera (e.g. as returned by startAutomaticCapture).
192
+ :param pixelFormat: The desired pixelFormat of captured frames from the
193
+ camera
194
+ """
195
+ @staticmethod
196
+ @typing.overload
197
+ def getVideo(name: str) -> CvSink:
198
+ """
199
+ Get OpenCV access to the specified camera. This allows you to get
200
+ images from the camera for image processing on the roboRIO.
201
+
202
+ :param name: Camera name
203
+ """
204
+ @staticmethod
205
+ @typing.overload
206
+ def getVideo(name: str, pixelFormat: VideoMode.PixelFormat) -> CvSink:
207
+ """
208
+ Get OpenCV access to the specified camera. This allows you to get
209
+ images from the camera for image processing on the roboRIO.
210
+
211
+ :param name: Camera name
212
+ :param pixelFormat: The desired pixelFormat of captured frames from the
213
+ camera
214
+ """
215
+ @staticmethod
216
+ def putVideo(name: str, width: int, height: int) -> CvSource:
217
+ """
218
+ Create a MJPEG stream with OpenCV input. This can be called to pass custom
219
+ annotated images to the dashboard.
220
+
221
+ :param name: Name to give the stream
222
+ :param width: Width of the image being sent
223
+ :param height: Height of the image being sent
224
+ """
225
+ @staticmethod
226
+ def removeCamera(name: str) -> None:
227
+ """
228
+ Removes a camera by name.
229
+
230
+ :param name: Camera name
231
+ """
232
+ @staticmethod
233
+ def removeServer(name: str) -> None:
234
+ """
235
+ Removes a server by name.
236
+
237
+ :param name: Server name
238
+ """
239
+ @staticmethod
240
+ @typing.overload
241
+ def startAutomaticCapture() -> UsbCamera:
242
+ """
243
+ Start automatically capturing images to send to the dashboard.
244
+
245
+ You should call this method to see a camera feed on the dashboard. If you
246
+ also want to perform vision processing on the roboRIO, use getVideo() to
247
+ get access to the camera images.
248
+
249
+ The first time this overload is called, it calls StartAutomaticCapture()
250
+ with device 0, creating a camera named "USB Camera 0". Subsequent calls
251
+ increment the device number (e.g. 1, 2, etc).
252
+ """
253
+ @staticmethod
254
+ @typing.overload
255
+ def startAutomaticCapture(dev: int) -> UsbCamera:
256
+ """
257
+ Start automatically capturing images to send to the dashboard.
258
+
259
+ This overload calls StartAutomaticCapture() with a name of "USB Camera
260
+ {dev}".
261
+
262
+ :param dev: The device number of the camera interface
263
+ """
264
+ @staticmethod
265
+ @typing.overload
266
+ def startAutomaticCapture(name: str, dev: int) -> UsbCamera:
267
+ """
268
+ Start automatically capturing images to send to the dashboard.
269
+
270
+ :param name: The name to give the camera
271
+ :param dev: The device number of the camera interface
272
+ """
273
+ @staticmethod
274
+ @typing.overload
275
+ def startAutomaticCapture(name: str, path: str) -> UsbCamera:
276
+ """
277
+ Start automatically capturing images to send to the dashboard.
278
+
279
+ :param name: The name to give the camera
280
+ :param path: The device path (e.g. "/dev/video0") of the camera
281
+ """
282
+ @staticmethod
283
+ @typing.overload
284
+ def startAutomaticCapture(camera: VideoSource) -> MjpegServer:
285
+ """
286
+ Start automatically capturing images to send to the dashboard from
287
+ an existing camera.
288
+
289
+ :param camera: Camera
290
+ """
291
+ @staticmethod
292
+ def waitForever() -> None:
293
+ """
294
+ Infinitely loops until the process dies
295
+ """
296
+ class CvSink(ImageSink):
297
+ """
298
+ A sink for user code to accept video frames as OpenCV images.
299
+ """
300
+ @staticmethod
301
+ def _pybind11_conduit_v1_(*args, **kwargs):
302
+ ...
303
+ def __init__(self, name: str, pixelFormat: VideoMode.PixelFormat = ...) -> None:
304
+ """
305
+ Create a sink for accepting OpenCV images.
306
+
307
+ WaitForFrame() must be called on the created sink to get each new
308
+ image.
309
+
310
+ :param name: Source name (arbitrary unique identifier)
311
+ :param pixelFormat: The pixel format to read
312
+ """
313
+ def grabFrame(self, image: numpy.ndarray, timeout: float = 0.225) -> tuple[int, numpy.ndarray]:
314
+ """
315
+ Wait for the next frame and get the image.
316
+ Times out (returning 0) after timeout seconds.
317
+ The provided image will have the pixelFormat this class was constructed
318
+ with.
319
+
320
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
321
+ message); the frame time is in the same time base as wpi::Now(),
322
+ and is in 1 us increments.
323
+ """
324
+ def grabFrameDirect(self, image: numpy.ndarray, timeout: float = 0.225) -> int:
325
+ """
326
+ Wait for the next frame and get the image.
327
+ Times out (returning 0) after timeout seconds.
328
+ The provided image will have the pixelFormat this class was constructed
329
+ with. The data is backed by data in the CvSink. It will be invalidated by
330
+ any grabFrame*() call on the sink.
331
+
332
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
333
+ message); the frame time is in the same time base as wpi::Now(),
334
+ and is in 1 us increments.
335
+ """
336
+ def grabFrameNoTimeout(self, image: numpy.ndarray) -> tuple[int, numpy.ndarray]:
337
+ """
338
+ Wait for the next frame and get the image. May block forever.
339
+ The provided image will have the pixelFormat this class was constructed
340
+ with.
341
+
342
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
343
+ message); the frame time is in the same time base as wpi::Now(),
344
+ and is in 1 us increments.
345
+ """
346
+ def grabFrameNoTimeoutDirect(self, image: numpy.ndarray) -> int:
347
+ """
348
+ Wait for the next frame and get the image. May block forever.
349
+ The provided image will have the pixelFormat this class was constructed
350
+ with. The data is backed by data in the CvSink. It will be invalidated by
351
+ any grabFrame*() call on the sink.
352
+
353
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
354
+ message); the frame time is in the same time base as wpi::Now(),
355
+ and is in 1 us increments.
356
+ """
357
+ class CvSource(ImageSource):
358
+ """
359
+ A source for user code to provide OpenCV images as video frames.
360
+ """
361
+ @staticmethod
362
+ def _pybind11_conduit_v1_(*args, **kwargs):
363
+ ...
364
+ @typing.overload
365
+ def __init__(self, name: str, mode: VideoMode) -> None:
366
+ """
367
+ Create an OpenCV source.
368
+
369
+ :param name: Source name (arbitrary unique identifier)
370
+ :param mode: Video mode being generated
371
+ """
372
+ @typing.overload
373
+ def __init__(self, name: str, pixelFormat: VideoMode.PixelFormat, width: int, height: int, fps: int) -> None:
374
+ """
375
+ Create an OpenCV source.
376
+
377
+ :param name: Source name (arbitrary unique identifier)
378
+ :param pixelFormat: Pixel format
379
+ :param width: width
380
+ :param height: height
381
+ :param fps: fps
382
+ """
383
+ @typing.overload
384
+ def putFrame(self, image: numpy.ndarray) -> None:
385
+ """
386
+ Put an OpenCV image and notify sinks
387
+
388
+ The image format is guessed from the number of channels. The channel
389
+ mapping is as follows. 1: kGray 2: kYUYV 3: BGR 4: BGRA Any other channel
390
+ numbers will throw an error. If your image is an in alternate format, use
391
+ the overload that takes a PixelFormat.
392
+
393
+ :param image: OpenCV Image
394
+ """
395
+ @typing.overload
396
+ def putFrame(self, image: numpy.ndarray, pixelFormat: VideoMode.PixelFormat, skipVerification: bool) -> None:
397
+ """
398
+ Put an OpenCV image and notify sinks.
399
+
400
+ The format of the Mat must match the PixelFormat. You will corrupt memory
401
+ if they dont. With skipVerification false, we will verify the number of
402
+ channels matches the pixel format. If skipVerification is true, this step
403
+ is skipped and is passed straight through.
404
+
405
+ :param image: OpenCV image
406
+ :param pixelFormat: The pixel format of the image
407
+ :param skipVerification: skip verifying pixel format
408
+ """
409
+ class HttpCamera(VideoCamera):
410
+ """
411
+ A source that represents a MJPEG-over-HTTP (IP) camera.
412
+ """
413
+ class HttpCameraKind:
414
+ """
415
+ HTTP camera kind.
416
+
417
+ Members:
418
+
419
+ kUnknown : Unknown camera kind.
420
+
421
+ kMJPGStreamer : MJPG Streamer camera.
422
+
423
+ kCSCore : CS Core camera.
424
+
425
+ kAxis : Axis camera.
426
+ """
427
+ __members__: typing.ClassVar[dict[str, HttpCamera.HttpCameraKind]] # value = {'kUnknown': <HttpCameraKind.kUnknown: 0>, 'kMJPGStreamer': <HttpCameraKind.kMJPGStreamer: 1>, 'kCSCore': <HttpCameraKind.kCSCore: 2>, 'kAxis': <HttpCameraKind.kAxis: 3>}
428
+ kAxis: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kAxis: 3>
429
+ kCSCore: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kCSCore: 2>
430
+ kMJPGStreamer: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kMJPGStreamer: 1>
431
+ kUnknown: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kUnknown: 0>
432
+ @staticmethod
433
+ def _pybind11_conduit_v1_(*args, **kwargs):
434
+ ...
435
+ def __eq__(self, other: typing.Any) -> bool:
436
+ ...
437
+ def __getstate__(self) -> int:
438
+ ...
439
+ def __hash__(self) -> int:
440
+ ...
441
+ def __index__(self) -> int:
442
+ ...
443
+ def __init__(self, value: int) -> None:
444
+ ...
445
+ def __int__(self) -> int:
446
+ ...
447
+ def __ne__(self, other: typing.Any) -> bool:
448
+ ...
449
+ def __repr__(self) -> str:
450
+ ...
451
+ def __setstate__(self, state: int) -> None:
452
+ ...
453
+ def __str__(self) -> str:
454
+ ...
455
+ @property
456
+ def name(self) -> str:
457
+ ...
458
+ @property
459
+ def value(self) -> int:
460
+ ...
461
+ @staticmethod
462
+ def _pybind11_conduit_v1_(*args, **kwargs):
463
+ ...
464
+ @typing.overload
465
+ def __init__(self, name: str, url: str, kind: HttpCamera.HttpCameraKind = ...) -> None:
466
+ """
467
+ Create a source for a MJPEG-over-HTTP (IP) camera.
468
+
469
+ :param name: Source name (arbitrary unique identifier)
470
+ :param url: Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg")
471
+ :param kind: Camera kind (e.g. kAxis)
472
+ """
473
+ @typing.overload
474
+ def __init__(self, name: str, url: str, kind: HttpCamera.HttpCameraKind = ...) -> None:
475
+ """
476
+ Create a source for a MJPEG-over-HTTP (IP) camera.
477
+
478
+ :param name: Source name (arbitrary unique identifier)
479
+ :param url: Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg")
480
+ :param kind: Camera kind (e.g. kAxis)
481
+ """
482
+ @typing.overload
483
+ def __init__(self, name: str, url: str, kind: HttpCamera.HttpCameraKind = ...) -> None:
484
+ """
485
+ Create a source for a MJPEG-over-HTTP (IP) camera.
486
+
487
+ :param name: Source name (arbitrary unique identifier)
488
+ :param url: Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg")
489
+ :param kind: Camera kind (e.g. kAxis)
490
+ """
491
+ @typing.overload
492
+ def __init__(self, name: str, urls: list[str], kind: HttpCamera.HttpCameraKind = ...) -> None:
493
+ """
494
+ Create a source for a MJPEG-over-HTTP (IP) camera.
495
+
496
+ :param name: Source name (arbitrary unique identifier)
497
+ :param urls: Array of Camera URLs
498
+ :param kind: Camera kind (e.g. kAxis)
499
+ """
500
+ def getHttpCameraKind(self) -> HttpCamera.HttpCameraKind:
501
+ """
502
+ Get the kind of HTTP camera.
503
+
504
+ Autodetection can result in returning a different value than the camera
505
+ was created with.
506
+ """
507
+ def getUrls(self) -> list[str]:
508
+ """
509
+ Get the URLs used to connect to the camera.
510
+ """
511
+ def setUrls(self, urls: list[str]) -> None:
512
+ """
513
+ Change the URLs used to connect to the camera.
514
+ """
515
+ class ImageSink(VideoSink):
516
+ """
517
+ A base class for single image reading sinks.
518
+ """
519
+ @staticmethod
520
+ def _pybind11_conduit_v1_(*args, **kwargs):
521
+ ...
522
+ def getError(self) -> str:
523
+ """
524
+ Get error string. Call this if WaitForFrame() returns 0 to determine
525
+ what the error is.
526
+ """
527
+ def setDescription(self, description: str) -> None:
528
+ """
529
+ Set sink description.
530
+
531
+ :param description: Description
532
+ """
533
+ def setEnabled(self, enabled: bool) -> None:
534
+ """
535
+ Enable or disable getting new frames.
536
+
537
+ Disabling will cause processFrame (for callback-based CvSinks) to not
538
+ be called and WaitForFrame() to not return. This can be used to save
539
+ processor resources when frames are not needed.
540
+ """
541
+ class ImageSource(VideoSource):
542
+ """
543
+ A base class for single image providing sources.
544
+ """
545
+ @staticmethod
546
+ def _pybind11_conduit_v1_(*args, **kwargs):
547
+ ...
548
+ def createBooleanProperty(self, name: str, defaultValue: bool, value: bool) -> VideoProperty:
549
+ """
550
+ Create a boolean property.
551
+
552
+ :param name: Property name
553
+ :param defaultValue: Default value
554
+ :param value: Current value
555
+
556
+ :returns: Property
557
+ """
558
+ def createIntegerProperty(self, name: str, minimum: int, maximum: int, step: int, defaultValue: int, value: int) -> VideoProperty:
559
+ """
560
+ Create an integer property.
561
+
562
+ :param name: Property name
563
+ :param minimum: Minimum value
564
+ :param maximum: Maximum value
565
+ :param step: Step value
566
+ :param defaultValue: Default value
567
+ :param value: Current value
568
+
569
+ :returns: Property
570
+ """
571
+ def createProperty(self, name: str, kind: VideoProperty.Kind, minimum: int, maximum: int, step: int, defaultValue: int, value: int) -> VideoProperty:
572
+ """
573
+ Create a property.
574
+
575
+ :param name: Property name
576
+ :param kind: Property kind
577
+ :param minimum: Minimum value
578
+ :param maximum: Maximum value
579
+ :param step: Step value
580
+ :param defaultValue: Default value
581
+ :param value: Current value
582
+
583
+ :returns: Property
584
+ """
585
+ def createStringProperty(self, name: str, value: str) -> VideoProperty:
586
+ """
587
+ Create a string property.
588
+
589
+ :param name: Property name
590
+ :param value: Current value
591
+
592
+ :returns: Property
593
+ """
594
+ def notifyError(self, msg: str) -> None:
595
+ """
596
+ Signal sinks that an error has occurred. This should be called instead
597
+ of NotifyFrame when an error occurs.
598
+
599
+ :param msg: Notification message.
600
+ """
601
+ def setConnected(self, connected: bool) -> None:
602
+ """
603
+ Set source connection status. Defaults to true.
604
+
605
+ :param connected: True for connected, false for disconnected
606
+ """
607
+ def setDescription(self, description: str) -> None:
608
+ """
609
+ Set source description.
610
+
611
+ :param description: Description
612
+ """
613
+ def setEnumPropertyChoices(self, property: VideoProperty, choices: list[str]) -> None:
614
+ """
615
+ Configure enum property choices.
616
+
617
+ :param property: Property
618
+ :param choices: Choices
619
+ """
620
+ class MjpegServer(VideoSink):
621
+ """
622
+ A sink that acts as a MJPEG-over-HTTP network server.
623
+ """
624
+ @staticmethod
625
+ def _pybind11_conduit_v1_(*args, **kwargs):
626
+ ...
627
+ @typing.overload
628
+ def __init__(self) -> None:
629
+ ...
630
+ @typing.overload
631
+ def __init__(self, name: str, listenAddress: str, port: int) -> None:
632
+ """
633
+ Create a MJPEG-over-HTTP server sink.
634
+
635
+ :param name: Sink name (arbitrary unique identifier)
636
+ :param listenAddress: TCP listen address (empty string for all addresses)
637
+ :param port: TCP port number
638
+ """
639
+ @typing.overload
640
+ def __init__(self, name: str, port: int) -> None:
641
+ """
642
+ Create a MJPEG-over-HTTP server sink.
643
+
644
+ :param name: Sink name (arbitrary unique identifier)
645
+ :param port: TCP port number
646
+ """
647
+ def getListenAddress(self) -> str:
648
+ """
649
+ Get the listen address of the server.
650
+ """
651
+ def getPort(self) -> int:
652
+ """
653
+ Get the port number of the server.
654
+ """
655
+ def setCompression(self, quality: int) -> None:
656
+ """
657
+ Set the compression for clients that don't specify it.
658
+
659
+ Setting this will result in increased CPU usage for MJPEG source cameras
660
+ as it will decompress and recompress the image instead of using the
661
+ camera's MJPEG image directly.
662
+
663
+ :param quality: JPEG compression quality (0-100), -1 for unspecified
664
+ """
665
+ def setDefaultCompression(self, quality: int) -> None:
666
+ """
667
+ Set the default compression used for non-MJPEG sources. If not set,
668
+ 80 is used. This function has no effect on MJPEG source cameras; use
669
+ SetCompression() instead to force recompression of MJPEG source images.
670
+
671
+ :param quality: JPEG compression quality (0-100)
672
+ """
673
+ def setFPS(self, fps: int) -> None:
674
+ """
675
+ Set the stream frames per second (FPS) for clients that don't specify it.
676
+
677
+ It is not necessary to set this if it is the same as the source FPS.
678
+
679
+ :param fps: FPS, 0 for unspecified
680
+ """
681
+ def setResolution(self, width: int, height: int) -> None:
682
+ """
683
+ Set the stream resolution for clients that don't specify it.
684
+
685
+ It is not necessary to set this if it is the same as the source
686
+ resolution.
687
+
688
+ Setting this different than the source resolution will result in
689
+ increased CPU usage, particularly for MJPEG source cameras, as it will
690
+ decompress, resize, and recompress the image, instead of using the
691
+ camera's MJPEG image directly.
692
+
693
+ :param width: width, 0 for unspecified
694
+ :param height: height, 0 for unspecified
695
+ """
696
+ class RawEvent:
697
+ """
698
+ Listener event
699
+ """
700
+ @staticmethod
701
+ def _pybind11_conduit_v1_(*args, **kwargs):
702
+ ...
703
+ class UsbCamera(VideoCamera):
704
+ """
705
+ A source that represents a USB camera.
706
+ """
707
+ @staticmethod
708
+ def _pybind11_conduit_v1_(*args, **kwargs):
709
+ ...
710
+ @staticmethod
711
+ def enumerateUsbCameras() -> list[UsbCameraInfo]:
712
+ """
713
+ Enumerate USB cameras on the local system.
714
+
715
+ :returns: Vector of USB camera information (one for each camera)
716
+ """
717
+ @typing.overload
718
+ def __init__(self) -> None:
719
+ ...
720
+ @typing.overload
721
+ def __init__(self, name: str, dev: int) -> None:
722
+ """
723
+ Create a source for a USB camera based on device number.
724
+
725
+ :param name: Source name (arbitrary unique identifier)
726
+ :param dev: Device number (e.g. 0 for /dev/video0)
727
+ """
728
+ @typing.overload
729
+ def __init__(self, name: str, path: str) -> None:
730
+ """
731
+ Create a source for a USB camera based on device path.
732
+
733
+ :param name: Source name (arbitrary unique identifier)
734
+ :param path: Path to device (e.g. "/dev/video0" on Linux)
735
+ """
736
+ def getInfo(self) -> UsbCameraInfo:
737
+ """
738
+ Get the full camera information for the device.
739
+ """
740
+ def getPath(self) -> str:
741
+ """
742
+ Get the path to the device.
743
+ """
744
+ def setConnectVerbose(self, level: int) -> None:
745
+ """
746
+ Set how verbose the camera connection messages are.
747
+
748
+ :param level: 0=don't display Connecting message, 1=do display message
749
+ """
750
+ def setPath(self, path: str) -> None:
751
+ """
752
+ Change the path to the device.
753
+ """
754
+ class UsbCameraInfo:
755
+ """
756
+ USB camera information
757
+ """
758
+ @staticmethod
759
+ def _pybind11_conduit_v1_(*args, **kwargs):
760
+ ...
761
+ def __init__(self) -> None:
762
+ ...
763
+ @property
764
+ def dev(self) -> int:
765
+ """
766
+ Device number (e.g. N in '/dev/videoN' on Linux)
767
+ """
768
+ @dev.setter
769
+ def dev(self, arg0: int) -> None:
770
+ ...
771
+ @property
772
+ def name(self) -> str:
773
+ """
774
+ Vendor/model name of the camera as provided by the USB driver
775
+ """
776
+ @name.setter
777
+ def name(self, arg0: str) -> None:
778
+ ...
779
+ @property
780
+ def otherPaths(self) -> list[str]:
781
+ """
782
+ Other path aliases to device (e.g. '/dev/v4l/by-id/...' etc on Linux)
783
+ """
784
+ @otherPaths.setter
785
+ def otherPaths(self, arg0: list[str]) -> None:
786
+ ...
787
+ @property
788
+ def path(self) -> str:
789
+ """
790
+ Path to device if available (e.g. '/dev/video0' on Linux)
791
+ """
792
+ @path.setter
793
+ def path(self, arg0: str) -> None:
794
+ ...
795
+ @property
796
+ def productId(self) -> int:
797
+ """
798
+ USB Product Id
799
+ """
800
+ @productId.setter
801
+ def productId(self, arg0: int) -> None:
802
+ ...
803
+ @property
804
+ def vendorId(self) -> int:
805
+ """
806
+ USB Vendor Id
807
+ """
808
+ @vendorId.setter
809
+ def vendorId(self, arg0: int) -> None:
810
+ ...
811
+ class VideoCamera(VideoSource):
812
+ """
813
+ A source that represents a video camera.
814
+ """
815
+ class WhiteBalance:
816
+ """
817
+ White balance.
818
+
819
+ Members:
820
+
821
+ kFixedIndoor : Fixed indoor white balance.
822
+
823
+ kFixedOutdoor1 : Fixed outdoor white balance 1.
824
+
825
+ kFixedOutdoor2 : Fixed outdoor white balance 2.
826
+
827
+ kFixedFluorescent1 : Fixed fluorescent white balance 1.
828
+
829
+ kFixedFlourescent2 : Fixed fluorescent white balance 2.
830
+ """
831
+ __members__: typing.ClassVar[dict[str, VideoCamera.WhiteBalance]] # value = {'kFixedIndoor': <WhiteBalance.kFixedIndoor: 3000>, 'kFixedOutdoor1': <WhiteBalance.kFixedOutdoor1: 4000>, 'kFixedOutdoor2': <WhiteBalance.kFixedOutdoor2: 5000>, 'kFixedFluorescent1': <WhiteBalance.kFixedFluorescent1: 5100>, 'kFixedFlourescent2': <WhiteBalance.kFixedFlourescent2: 5200>}
832
+ kFixedFlourescent2: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedFlourescent2: 5200>
833
+ kFixedFluorescent1: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedFluorescent1: 5100>
834
+ kFixedIndoor: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedIndoor: 3000>
835
+ kFixedOutdoor1: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedOutdoor1: 4000>
836
+ kFixedOutdoor2: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedOutdoor2: 5000>
837
+ @staticmethod
838
+ def _pybind11_conduit_v1_(*args, **kwargs):
839
+ ...
840
+ def __eq__(self, other: typing.Any) -> bool:
841
+ ...
842
+ def __getstate__(self) -> int:
843
+ ...
844
+ def __hash__(self) -> int:
845
+ ...
846
+ def __index__(self) -> int:
847
+ ...
848
+ def __init__(self, value: int) -> None:
849
+ ...
850
+ def __int__(self) -> int:
851
+ ...
852
+ def __ne__(self, other: typing.Any) -> bool:
853
+ ...
854
+ def __repr__(self) -> str:
855
+ ...
856
+ def __setstate__(self, state: int) -> None:
857
+ ...
858
+ def __str__(self) -> str:
859
+ ...
860
+ @property
861
+ def name(self) -> str:
862
+ ...
863
+ @property
864
+ def value(self) -> int:
865
+ ...
866
+ @staticmethod
867
+ def _pybind11_conduit_v1_(*args, **kwargs):
868
+ ...
869
+ def __init__(self) -> None:
870
+ ...
871
+ def getBrightness(self) -> int:
872
+ """
873
+ Get the brightness, as a percentage (0-100).
874
+ """
875
+ def setBrightness(self, brightness: int) -> None:
876
+ """
877
+ Set the brightness, as a percentage (0-100).
878
+ """
879
+ def setExposureAuto(self) -> None:
880
+ """
881
+ Set the exposure to auto aperture.
882
+ """
883
+ def setExposureHoldCurrent(self) -> None:
884
+ """
885
+ Set the exposure to hold current.
886
+ """
887
+ def setExposureManual(self, value: int) -> None:
888
+ """
889
+ Set the exposure to manual, as a percentage (0-100).
890
+ """
891
+ def setWhiteBalanceAuto(self) -> None:
892
+ """
893
+ Set the white balance to auto.
894
+ """
895
+ def setWhiteBalanceHoldCurrent(self) -> None:
896
+ """
897
+ Set the white balance to hold current.
898
+ """
899
+ def setWhiteBalanceManual(self, value: int) -> None:
900
+ """
901
+ Set the white balance to manual, with specified color temperature.
902
+ """
903
+ class VideoEvent(RawEvent):
904
+ """
905
+ An event generated by the library and provided to event listeners.
906
+ """
907
+ @staticmethod
908
+ def _pybind11_conduit_v1_(*args, **kwargs):
909
+ ...
910
+ def __init__(self) -> None:
911
+ ...
912
+ def getProperty(self) -> VideoProperty:
913
+ """
914
+ Returns the property associated with the event (if any).
915
+
916
+ :returns: The property associated with the event (if any).
917
+ """
918
+ def getSink(self) -> VideoSink:
919
+ """
920
+ Returns the sink associated with the event (if any).
921
+
922
+ :returns: The sink associated with the event (if any).
923
+ """
924
+ def getSource(self) -> VideoSource:
925
+ """
926
+ Returns the source associated with the event (if any).
927
+
928
+ :returns: The source associated with the event (if any).
929
+ """
930
+ class VideoListener:
931
+ """
932
+ An event listener. This calls back to a designated callback function when
933
+ an event matching the specified mask is generated by the library.
934
+ """
935
+ @staticmethod
936
+ def _pybind11_conduit_v1_(*args, **kwargs):
937
+ ...
938
+ @typing.overload
939
+ def __init__(self) -> None:
940
+ ...
941
+ @typing.overload
942
+ def __init__(self, callback: typing.Callable[[VideoEvent], None], eventMask: int, immediateNotify: bool) -> None:
943
+ """
944
+ Create an event listener.
945
+
946
+ :param callback: Callback function
947
+ :param eventMask: Bitmask of VideoEvent::Kind values
948
+ :param immediateNotify: Whether callback should be immediately called with
949
+ a representative set of events for the current library state.
950
+ """
951
+ class VideoMode:
952
+ """
953
+ Video mode
954
+ """
955
+ class PixelFormat:
956
+ """
957
+ Members:
958
+
959
+ kUnknown
960
+
961
+ kMJPEG
962
+
963
+ kYUYV
964
+
965
+ kRGB565
966
+
967
+ kBGR
968
+
969
+ kGray
970
+
971
+ kY16
972
+
973
+ kUYVY
974
+
975
+ kBGRA
976
+ """
977
+ __members__: typing.ClassVar[dict[str, VideoMode.PixelFormat]] # value = {'kUnknown': <PixelFormat.kUnknown: 0>, 'kMJPEG': <PixelFormat.kMJPEG: 1>, 'kYUYV': <PixelFormat.kYUYV: 2>, 'kRGB565': <PixelFormat.kRGB565: 3>, 'kBGR': <PixelFormat.kBGR: 4>, 'kGray': <PixelFormat.kGray: 5>, 'kY16': <PixelFormat.kY16: 6>, 'kUYVY': <PixelFormat.kUYVY: 7>, 'kBGRA': <PixelFormat.kBGRA: 8>}
978
+ kBGR: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kBGR: 4>
979
+ kBGRA: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kBGRA: 8>
980
+ kGray: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kGray: 5>
981
+ kMJPEG: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kMJPEG: 1>
982
+ kRGB565: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kRGB565: 3>
983
+ kUYVY: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kUYVY: 7>
984
+ kUnknown: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kUnknown: 0>
985
+ kY16: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kY16: 6>
986
+ kYUYV: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kYUYV: 2>
987
+ @staticmethod
988
+ def _pybind11_conduit_v1_(*args, **kwargs):
989
+ ...
990
+ def __eq__(self, other: typing.Any) -> bool:
991
+ ...
992
+ def __getstate__(self) -> int:
993
+ ...
994
+ def __hash__(self) -> int:
995
+ ...
996
+ def __index__(self) -> int:
997
+ ...
998
+ def __init__(self, value: int) -> None:
999
+ ...
1000
+ def __int__(self) -> int:
1001
+ ...
1002
+ def __ne__(self, other: typing.Any) -> bool:
1003
+ ...
1004
+ def __repr__(self) -> str:
1005
+ ...
1006
+ def __setstate__(self, state: int) -> None:
1007
+ ...
1008
+ def __str__(self) -> str:
1009
+ ...
1010
+ @property
1011
+ def name(self) -> str:
1012
+ ...
1013
+ @property
1014
+ def value(self) -> int:
1015
+ ...
1016
+ __hash__: typing.ClassVar[None] = None
1017
+ fps: int
1018
+ height: int
1019
+ pixelFormat: int
1020
+ width: int
1021
+ @staticmethod
1022
+ def _pybind11_conduit_v1_(*args, **kwargs):
1023
+ ...
1024
+ def __eq__(self, arg0: VideoMode) -> bool:
1025
+ ...
1026
+ @typing.overload
1027
+ def __init__(self) -> None:
1028
+ ...
1029
+ @typing.overload
1030
+ def __init__(self, pixelFormat_: VideoMode.PixelFormat, width_: int, height_: int, fps_: int) -> None:
1031
+ ...
1032
+ def compareWithoutFps(self, other: VideoMode) -> bool:
1033
+ ...
1034
+ class VideoProperty:
1035
+ """
1036
+ A source or sink property.
1037
+ """
1038
+ class Kind:
1039
+ """
1040
+ Members:
1041
+
1042
+ kNone : No specific property.
1043
+
1044
+ kBoolean : Boolean property.
1045
+
1046
+ kInteger : Integer property.
1047
+
1048
+ kString : String property.
1049
+
1050
+ kEnum : Enum property.
1051
+ """
1052
+ __members__: typing.ClassVar[dict[str, VideoProperty.Kind]] # value = {'kNone': <Kind.kNone: 0>, 'kBoolean': <Kind.kBoolean: 1>, 'kInteger': <Kind.kInteger: 2>, 'kString': <Kind.kString: 4>, 'kEnum': <Kind.kEnum: 8>}
1053
+ kBoolean: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kBoolean: 1>
1054
+ kEnum: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kEnum: 8>
1055
+ kInteger: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kInteger: 2>
1056
+ kNone: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kNone: 0>
1057
+ kString: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kString: 4>
1058
+ @staticmethod
1059
+ def _pybind11_conduit_v1_(*args, **kwargs):
1060
+ ...
1061
+ def __eq__(self, other: typing.Any) -> bool:
1062
+ ...
1063
+ def __getstate__(self) -> int:
1064
+ ...
1065
+ def __hash__(self) -> int:
1066
+ ...
1067
+ def __index__(self) -> int:
1068
+ ...
1069
+ def __init__(self, value: int) -> None:
1070
+ ...
1071
+ def __int__(self) -> int:
1072
+ ...
1073
+ def __ne__(self, other: typing.Any) -> bool:
1074
+ ...
1075
+ def __repr__(self) -> str:
1076
+ ...
1077
+ def __setstate__(self, state: int) -> None:
1078
+ ...
1079
+ def __str__(self) -> str:
1080
+ ...
1081
+ @property
1082
+ def name(self) -> str:
1083
+ ...
1084
+ @property
1085
+ def value(self) -> int:
1086
+ ...
1087
+ @staticmethod
1088
+ def _pybind11_conduit_v1_(*args, **kwargs):
1089
+ ...
1090
+ def __init__(self) -> None:
1091
+ ...
1092
+ def get(self) -> int:
1093
+ """
1094
+ Returns property value.
1095
+
1096
+ :returns: Property value.
1097
+ """
1098
+ def getChoices(self) -> list[str]:
1099
+ """
1100
+ Returns the possible values for the enum property value.
1101
+
1102
+ This function is enum-specific.
1103
+
1104
+ :returns: The possible values for the enum property value.
1105
+ """
1106
+ def getDefault(self) -> int:
1107
+ """
1108
+ Returns property default value.
1109
+
1110
+ :returns: Property default value.
1111
+ """
1112
+ def getKind(self) -> VideoProperty.Kind:
1113
+ """
1114
+ Returns property kind.
1115
+
1116
+ :returns: Property kind.
1117
+ """
1118
+ def getLastStatus(self) -> int:
1119
+ """
1120
+ Returns the last status.
1121
+
1122
+ :returns: The last status.
1123
+ """
1124
+ def getMax(self) -> int:
1125
+ """
1126
+ Returns property maximum value.
1127
+
1128
+ :returns: Property maximum value.
1129
+ """
1130
+ def getMin(self) -> int:
1131
+ """
1132
+ Returns property minimum value.
1133
+
1134
+ :returns: Property minimum value.
1135
+ """
1136
+ def getName(self) -> str:
1137
+ """
1138
+ Returns property name.
1139
+
1140
+ :returns: Property name.
1141
+ """
1142
+ def getStep(self) -> int:
1143
+ """
1144
+ Returns property step size.
1145
+
1146
+ :returns: Property step size.
1147
+ """
1148
+ @typing.overload
1149
+ def getString(self) -> str:
1150
+ """
1151
+ Returns the string property value.
1152
+
1153
+ This function is string-specific.
1154
+
1155
+ :returns: The string property value.
1156
+ """
1157
+ @typing.overload
1158
+ def getString(self, buf: list[str]) -> str:
1159
+ """
1160
+ Returns the string property value as a reference to the given buffer.
1161
+
1162
+ This function is string-specific.
1163
+
1164
+ :param buf: The backing storage to which to write the property value.
1165
+
1166
+ :returns: The string property value as a reference to the given buffer.
1167
+ """
1168
+ def isBoolean(self) -> bool:
1169
+ """
1170
+ Returns true if property is a boolean.
1171
+
1172
+ :returns: True if property is a boolean.
1173
+ """
1174
+ def isEnum(self) -> bool:
1175
+ """
1176
+ Returns true if property is an enum.
1177
+
1178
+ :returns: True if property is an enum.
1179
+ """
1180
+ def isInteger(self) -> bool:
1181
+ """
1182
+ Returns true if property is an integer.
1183
+
1184
+ :returns: True if property is an integer.
1185
+ """
1186
+ def isString(self) -> bool:
1187
+ """
1188
+ Returns true if property is a string.
1189
+
1190
+ :returns: True if property is a string.
1191
+ """
1192
+ def set(self, value: int) -> None:
1193
+ """
1194
+ Sets property value.
1195
+
1196
+ :param value: Property value.
1197
+ """
1198
+ def setString(self, value: str) -> None:
1199
+ """
1200
+ Sets the string property value.
1201
+
1202
+ This function is string-specific.
1203
+
1204
+ :param value: String property value.
1205
+ """
1206
+ class VideoSink:
1207
+ """
1208
+ A sink for video that accepts a sequence of frames.
1209
+ """
1210
+ class Kind:
1211
+ """
1212
+ Members:
1213
+
1214
+ kUnknown : Unknown sink type.
1215
+
1216
+ kMjpeg : MJPEG video sink.
1217
+
1218
+ kCv : CV video sink.
1219
+
1220
+ kRaw : Raw video sink.
1221
+ """
1222
+ __members__: typing.ClassVar[dict[str, VideoSink.Kind]] # value = {'kUnknown': <Kind.kUnknown: 0>, 'kMjpeg': <Kind.kMjpeg: 2>, 'kCv': <Kind.kCv: 4>, 'kRaw': <Kind.kRaw: 8>}
1223
+ kCv: typing.ClassVar[VideoSink.Kind] # value = <Kind.kCv: 4>
1224
+ kMjpeg: typing.ClassVar[VideoSink.Kind] # value = <Kind.kMjpeg: 2>
1225
+ kRaw: typing.ClassVar[VideoSink.Kind] # value = <Kind.kRaw: 8>
1226
+ kUnknown: typing.ClassVar[VideoSink.Kind] # value = <Kind.kUnknown: 0>
1227
+ @staticmethod
1228
+ def _pybind11_conduit_v1_(*args, **kwargs):
1229
+ ...
1230
+ def __eq__(self, other: typing.Any) -> bool:
1231
+ ...
1232
+ def __getstate__(self) -> int:
1233
+ ...
1234
+ def __hash__(self) -> int:
1235
+ ...
1236
+ def __index__(self) -> int:
1237
+ ...
1238
+ def __init__(self, value: int) -> None:
1239
+ ...
1240
+ def __int__(self) -> int:
1241
+ ...
1242
+ def __ne__(self, other: typing.Any) -> bool:
1243
+ ...
1244
+ def __repr__(self) -> str:
1245
+ ...
1246
+ def __setstate__(self, state: int) -> None:
1247
+ ...
1248
+ def __str__(self) -> str:
1249
+ ...
1250
+ @property
1251
+ def name(self) -> str:
1252
+ ...
1253
+ @property
1254
+ def value(self) -> int:
1255
+ ...
1256
+ __hash__: typing.ClassVar[None] = None
1257
+ @staticmethod
1258
+ def _pybind11_conduit_v1_(*args, **kwargs):
1259
+ ...
1260
+ @staticmethod
1261
+ def enumerateSinks() -> list[VideoSink]:
1262
+ """
1263
+ Enumerate all existing sinks.
1264
+
1265
+ :returns: Vector of sinks.
1266
+ """
1267
+ def __eq__(self, arg0: VideoSink) -> bool:
1268
+ ...
1269
+ def __init__(self) -> None:
1270
+ ...
1271
+ def enumerateProperties(self) -> list[VideoProperty]:
1272
+ """
1273
+ Enumerate all properties of this sink.
1274
+ """
1275
+ def getConfigJson(self) -> str:
1276
+ """
1277
+ Get a JSON configuration string.
1278
+
1279
+ :returns: JSON configuration string
1280
+ """
1281
+ def getConfigJsonObject(self) -> wpiutil.json:
1282
+ """
1283
+ Get a JSON configuration object.
1284
+
1285
+ :returns: JSON configuration object
1286
+ """
1287
+ def getDescription(self) -> str:
1288
+ """
1289
+ Get the sink description. This is sink-kind specific.
1290
+ """
1291
+ def getHandle(self) -> int:
1292
+ """
1293
+ Returns the VideoSink handle.
1294
+
1295
+ :returns: The VideoSink handle.
1296
+ """
1297
+ def getKind(self) -> VideoSink.Kind:
1298
+ """
1299
+ Get the kind of the sink.
1300
+ """
1301
+ def getLastStatus(self) -> int:
1302
+ ...
1303
+ def getName(self) -> str:
1304
+ """
1305
+ Get the name of the sink. The name is an arbitrary identifier
1306
+ provided when the sink is created, and should be unique.
1307
+ """
1308
+ def getProperty(self, name: str) -> VideoProperty:
1309
+ """
1310
+ Get a property of the sink.
1311
+
1312
+ :param name: Property name
1313
+
1314
+ :returns: Property (kind Property::kNone if no property with
1315
+ the given name exists)
1316
+ """
1317
+ def getSource(self) -> VideoSource:
1318
+ """
1319
+ Get the connected source.
1320
+
1321
+ :returns: Connected source (empty if none connected).
1322
+ """
1323
+ def getSourceProperty(self, name: str) -> VideoProperty:
1324
+ """
1325
+ Get a property of the associated source.
1326
+
1327
+ :param name: Property name
1328
+
1329
+ :returns: Property (kind Property::kNone if no property with
1330
+ the given name exists or no source connected)
1331
+ """
1332
+ @typing.overload
1333
+ def setConfigJson(self, config: str) -> bool:
1334
+ """
1335
+ Set properties from a JSON configuration string.
1336
+
1337
+ The format of the JSON input is:
1338
+
1339
+ ::
1340
+
1341
+ {
1342
+ "properties": [
1343
+ {
1344
+ "name": property name
1345
+ "value": property value
1346
+ }
1347
+ ]
1348
+ }
1349
+
1350
+ :param config: configuration
1351
+
1352
+ :returns: True if set successfully
1353
+ """
1354
+ @typing.overload
1355
+ def setConfigJson(self, config: wpiutil.json) -> bool:
1356
+ """
1357
+ Set properties from a JSON configuration object.
1358
+
1359
+ :param config: configuration
1360
+
1361
+ :returns: True if set successfully
1362
+ """
1363
+ def setSource(self, source: VideoSource) -> None:
1364
+ """
1365
+ Configure which source should provide frames to this sink. Each sink
1366
+ can accept frames from only a single source, but a single source can
1367
+ provide frames to multiple clients.
1368
+
1369
+ :param source: Source
1370
+ """
1371
+ class VideoSource:
1372
+ """
1373
+ A source for video that provides a sequence of frames.
1374
+ """
1375
+ class ConnectionStrategy:
1376
+ """
1377
+ Connection strategy. Used for SetConnectionStrategy().
1378
+
1379
+ Members:
1380
+
1381
+ kConnectionAutoManage : Automatically connect or disconnect based on whether any sinks are
1382
+ connected to this source. This is the default behavior.
1383
+
1384
+ kConnectionKeepOpen : Try to keep the connection open regardless of whether any sinks are
1385
+ connected.
1386
+
1387
+ kConnectionForceClose : Never open the connection. If this is set when the connection is open,
1388
+ close the connection.
1389
+ """
1390
+ __members__: typing.ClassVar[dict[str, VideoSource.ConnectionStrategy]] # value = {'kConnectionAutoManage': <ConnectionStrategy.kConnectionAutoManage: 0>, 'kConnectionKeepOpen': <ConnectionStrategy.kConnectionKeepOpen: 1>, 'kConnectionForceClose': <ConnectionStrategy.kConnectionForceClose: 2>}
1391
+ kConnectionAutoManage: typing.ClassVar[VideoSource.ConnectionStrategy] # value = <ConnectionStrategy.kConnectionAutoManage: 0>
1392
+ kConnectionForceClose: typing.ClassVar[VideoSource.ConnectionStrategy] # value = <ConnectionStrategy.kConnectionForceClose: 2>
1393
+ kConnectionKeepOpen: typing.ClassVar[VideoSource.ConnectionStrategy] # value = <ConnectionStrategy.kConnectionKeepOpen: 1>
1394
+ @staticmethod
1395
+ def _pybind11_conduit_v1_(*args, **kwargs):
1396
+ ...
1397
+ def __eq__(self, other: typing.Any) -> bool:
1398
+ ...
1399
+ def __getstate__(self) -> int:
1400
+ ...
1401
+ def __hash__(self) -> int:
1402
+ ...
1403
+ def __index__(self) -> int:
1404
+ ...
1405
+ def __init__(self, value: int) -> None:
1406
+ ...
1407
+ def __int__(self) -> int:
1408
+ ...
1409
+ def __ne__(self, other: typing.Any) -> bool:
1410
+ ...
1411
+ def __repr__(self) -> str:
1412
+ ...
1413
+ def __setstate__(self, state: int) -> None:
1414
+ ...
1415
+ def __str__(self) -> str:
1416
+ ...
1417
+ @property
1418
+ def name(self) -> str:
1419
+ ...
1420
+ @property
1421
+ def value(self) -> int:
1422
+ ...
1423
+ class Kind:
1424
+ """
1425
+ Video source kind.
1426
+
1427
+ Members:
1428
+
1429
+ kUnknown : Unknown video source.
1430
+
1431
+ kUsb : USB video source.
1432
+
1433
+ kHttp : HTTP video source.
1434
+
1435
+ kCv : CV video source.
1436
+
1437
+ kRaw : Raw video source.
1438
+ """
1439
+ __members__: typing.ClassVar[dict[str, VideoSource.Kind]] # value = {'kUnknown': <Kind.kUnknown: 0>, 'kUsb': <Kind.kUsb: 1>, 'kHttp': <Kind.kHttp: 2>, 'kCv': <Kind.kCv: 4>, 'kRaw': <Kind.kRaw: 8>}
1440
+ kCv: typing.ClassVar[VideoSource.Kind] # value = <Kind.kCv: 4>
1441
+ kHttp: typing.ClassVar[VideoSource.Kind] # value = <Kind.kHttp: 2>
1442
+ kRaw: typing.ClassVar[VideoSource.Kind] # value = <Kind.kRaw: 8>
1443
+ kUnknown: typing.ClassVar[VideoSource.Kind] # value = <Kind.kUnknown: 0>
1444
+ kUsb: typing.ClassVar[VideoSource.Kind] # value = <Kind.kUsb: 1>
1445
+ @staticmethod
1446
+ def _pybind11_conduit_v1_(*args, **kwargs):
1447
+ ...
1448
+ def __eq__(self, other: typing.Any) -> bool:
1449
+ ...
1450
+ def __getstate__(self) -> int:
1451
+ ...
1452
+ def __hash__(self) -> int:
1453
+ ...
1454
+ def __index__(self) -> int:
1455
+ ...
1456
+ def __init__(self, value: int) -> None:
1457
+ ...
1458
+ def __int__(self) -> int:
1459
+ ...
1460
+ def __ne__(self, other: typing.Any) -> bool:
1461
+ ...
1462
+ def __repr__(self) -> str:
1463
+ ...
1464
+ def __setstate__(self, state: int) -> None:
1465
+ ...
1466
+ def __str__(self) -> str:
1467
+ ...
1468
+ @property
1469
+ def name(self) -> str:
1470
+ ...
1471
+ @property
1472
+ def value(self) -> int:
1473
+ ...
1474
+ __hash__: typing.ClassVar[None] = None
1475
+ @staticmethod
1476
+ def _pybind11_conduit_v1_(*args, **kwargs):
1477
+ ...
1478
+ @staticmethod
1479
+ def enumerateSources() -> list[VideoSource]:
1480
+ """
1481
+ Enumerate all existing sources.
1482
+
1483
+ :returns: Vector of sources.
1484
+ """
1485
+ def __eq__(self, arg0: VideoSource) -> bool:
1486
+ ...
1487
+ def __init__(self) -> None:
1488
+ ...
1489
+ def enumerateProperties(self) -> list[VideoProperty]:
1490
+ """
1491
+ Enumerate all properties of this source.
1492
+ """
1493
+ def enumerateSinks(self) -> list[VideoSink]:
1494
+ """
1495
+ Enumerate all sinks connected to this source.
1496
+
1497
+ :returns: Vector of sinks.
1498
+ """
1499
+ def enumerateVideoModes(self) -> list[VideoMode]:
1500
+ """
1501
+ Enumerate all known video modes for this source.
1502
+ """
1503
+ def getActualDataRate(self) -> float:
1504
+ """
1505
+ Get the data rate (in bytes per second).
1506
+
1507
+ SetTelemetryPeriod() must be called for this to be valid.
1508
+
1509
+ :returns: Data rate averaged over the telemetry period.
1510
+ """
1511
+ def getActualFPS(self) -> float:
1512
+ """
1513
+ Get the actual FPS.
1514
+
1515
+ SetTelemetryPeriod() must be called for this to be valid.
1516
+
1517
+ :returns: Actual FPS averaged over the telemetry period.
1518
+ """
1519
+ def getConfigJson(self) -> str:
1520
+ """
1521
+ Get a JSON configuration string.
1522
+
1523
+ :returns: JSON configuration string
1524
+ """
1525
+ def getConfigJsonObject(self) -> wpiutil.json:
1526
+ """
1527
+ Get a JSON configuration object.
1528
+
1529
+ :returns: JSON configuration object
1530
+ """
1531
+ def getDescription(self) -> str:
1532
+ """
1533
+ Get the source description. This is source-kind specific.
1534
+ """
1535
+ def getHandle(self) -> int:
1536
+ ...
1537
+ def getKind(self) -> VideoSource.Kind:
1538
+ """
1539
+ Get the kind of the source.
1540
+ """
1541
+ def getLastFrameTime(self) -> int:
1542
+ """
1543
+ Get the last time a frame was captured.
1544
+ This uses the same time base as wpi::Now().
1545
+
1546
+ :returns: Time in 1 us increments.
1547
+ """
1548
+ def getLastStatus(self) -> int:
1549
+ ...
1550
+ def getName(self) -> str:
1551
+ """
1552
+ Get the name of the source. The name is an arbitrary identifier
1553
+ provided when the source is created, and should be unique.
1554
+ """
1555
+ def getProperty(self, name: str) -> VideoProperty:
1556
+ """
1557
+ Get a property.
1558
+
1559
+ :param name: Property name
1560
+
1561
+ :returns: Property contents (of kind Property::kNone if no property with
1562
+ the given name exists)
1563
+ """
1564
+ def getVideoMode(self) -> VideoMode:
1565
+ """
1566
+ Get the current video mode.
1567
+ """
1568
+ def isConnected(self) -> bool:
1569
+ """
1570
+ Is the source currently connected to whatever is providing the images?
1571
+ """
1572
+ def isEnabled(self) -> bool:
1573
+ """
1574
+ Gets source enable status. This is determined with a combination of
1575
+ connection strategy and the number of sinks connected.
1576
+
1577
+ :returns: True if enabled, false otherwise.
1578
+ """
1579
+ @typing.overload
1580
+ def setConfigJson(self, config: str) -> bool:
1581
+ """
1582
+ Set video mode and properties from a JSON configuration string.
1583
+
1584
+ The format of the JSON input is:
1585
+
1586
+ ::
1587
+
1588
+ {
1589
+ "pixel format": "MJPEG", "YUYV", etc
1590
+ "width": video mode width
1591
+ "height": video mode height
1592
+ "fps": video mode fps
1593
+ "brightness": percentage brightness
1594
+ "white balance": "auto", "hold", or value
1595
+ "exposure": "auto", "hold", or value
1596
+ "properties": [
1597
+ {
1598
+ "name": property name
1599
+ "value": property value
1600
+ }
1601
+ ]
1602
+ }
1603
+
1604
+ :param config: configuration
1605
+
1606
+ :returns: True if set successfully
1607
+ """
1608
+ @typing.overload
1609
+ def setConfigJson(self, config: wpiutil.json) -> bool:
1610
+ """
1611
+ Set video mode and properties from a JSON configuration object.
1612
+
1613
+ :param config: configuration
1614
+
1615
+ :returns: True if set successfully
1616
+ """
1617
+ def setConnectionStrategy(self, strategy: VideoSource.ConnectionStrategy) -> None:
1618
+ """
1619
+ Sets the connection strategy. By default, the source will automatically
1620
+ connect or disconnect based on whether any sinks are connected.
1621
+
1622
+ This function is non-blocking; look for either a connection open or
1623
+ close event or call IsConnected() to determine the connection state.
1624
+
1625
+ :param strategy: connection strategy (auto, keep open, or force close)
1626
+ """
1627
+ def setFPS(self, fps: int) -> bool:
1628
+ """
1629
+ Set the frames per second (FPS).
1630
+
1631
+ :param fps: desired FPS
1632
+
1633
+ :returns: True if set successfully
1634
+ """
1635
+ def setPixelFormat(self, pixelFormat: VideoMode.PixelFormat) -> bool:
1636
+ """
1637
+ Set the pixel format.
1638
+
1639
+ :param pixelFormat: desired pixel format
1640
+
1641
+ :returns: True if set successfully
1642
+ """
1643
+ def setResolution(self, width: int, height: int) -> bool:
1644
+ """
1645
+ Set the resolution.
1646
+
1647
+ :param width: desired width
1648
+ :param height: desired height
1649
+
1650
+ :returns: True if set successfully
1651
+ """
1652
+ @typing.overload
1653
+ def setVideoMode(self, mode: VideoMode) -> bool:
1654
+ """
1655
+ Set the video mode.
1656
+
1657
+ :param mode: Video mode
1658
+ """
1659
+ @typing.overload
1660
+ def setVideoMode(self, pixelFormat: VideoMode.PixelFormat, width: int, height: int, fps: int) -> bool:
1661
+ """
1662
+ Set the video mode.
1663
+
1664
+ :param pixelFormat: desired pixel format
1665
+ :param width: desired width
1666
+ :param height: desired height
1667
+ :param fps: desired FPS
1668
+
1669
+ :returns: True if set successfully
1670
+ """
1671
+ def _setLogger(func: typing.Callable[[int, str, int, str], None], min_level: int) -> None:
1672
+ ...
1673
+ def runMainRunLoop() -> None:
1674
+ ...
1675
+ def runMainRunLoopTimeout(timeoutSeconds: float) -> int:
1676
+ ...
1677
+ def stopMainRunLoop() -> None:
1678
+ ...
1679
+ _cleanup: typing.Any # value = <capsule object>