You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/software/SDK/ICaptureFactory.mdx
+32-34Lines changed: 32 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,49 +5,47 @@ sidebar_position: 3
5
5
6
6
# ICaptureFactory Interface
7
7
8
-
The `ICaptureFactory` interface in the Baballonia SDK is the entry point for adding **custom camera sources** to Baballonia. Any new camera backend—USB, IP-based, native hardware, or experimental—must be registered through a factory so the system knows *how* to connect to it.
8
+
### 1. Method configuration
9
9
10
-
:::info
11
-
Every Capture Source requires a Factory.
12
-
A factory tells Baballonia:
10
+
The configuration of this method allows it to be detected and works in tandem with `Camera`.
13
11
14
-
-**Whether it can connect** to a given address
15
-
-**How to create the correct `Capture` subclass**
16
-
-**What provider name** the source should appear under inside Baballonia
17
-
18
-
This system enables full plugin-based extensibility without modifying the core application.
19
-
:::
20
-
21
-
---
22
-
23
-
## Purpose of `ICaptureFactory`
12
+
```csharp
13
+
/// <summary>
14
+
/// This public method allows the interface to create camera-specific Capture instances and for it to work in tandem with the Capture class.
15
+
/// </summary>
16
+
/// public interface ICaptureFactory
17
+
````
24
18
25
-
Baballonia supports many types of cameras, such as:
19
+
### 2. Camera Address Creation
26
20
27
-
- USB webcams
28
-
- Varjo eye-tracking cameras
29
-
- Android/IP camera streams
30
-
- V4L2 devices on Linux
31
-
- Custom or experimental camera hardware
21
+
Thiscodeblockusesanaddressfor the camera to be discoverable by Baballonia to be used somewhere else.
32
22
33
-
Each type often needs unique connection logic—for example, parsing its own address, validating availability, or allocating platform-specific resources.
23
+
```csharp
24
+
/// <summary>
25
+
/// This uses a discoverable address for the camera source for it to be discoverable.
26
+
/// </summary>
27
+
/// public Capture Create(stringaddress);
28
+
````
34
29
35
-
The `ICaptureFactory` interface standardizes this by requiring every plugin to define:
30
+
### 3. Camera Connection Verification
36
31
37
-
-**How to validate an address** (`CanConnect`)
38
-
-**How to construct the correct capture implementation** (`Create`)
39
-
-**What name represents the provider** (`GetProviderName`)
0 commit comments