Skip to content

Commit 7c9df29

Browse files
committed
Update ICaptureFactory documentation
1 parent 940351f commit 7c9df29

File tree

1 file changed

+32
-34
lines changed

1 file changed

+32
-34
lines changed

docs/software/SDK/ICaptureFactory.mdx

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,47 @@ sidebar_position: 3
55

66
# ICaptureFactory Interface
77

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
99

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`.
1311

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+
````
2418

25-
Baballonia supports many types of cameras, such as:
19+
### 2. Camera Address Creation
2620

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+
This codeblock uses an address for the camera to be discoverable by Baballonia to be used somewhere else.
3222

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(string address);
28+
````
3429

35-
The `ICaptureFactory` interface standardizes this by requiring every plugin to define:
30+
### 3. Camera Connection Verification
3631

37-
- **How to validate an address** (`CanConnect`)
38-
- **How to construct the correct capture implementation** (`Create`)
39-
- **What name represents the provider** (`GetProviderName`)
32+
This simply checks if the `Camera` source is connectable.
4033

41-
This ensures all camera types behave consistently inside Baballonia.
34+
```csharp
35+
/// <summary>
36+
/// Checks if the camera source is connectable
37+
/// </summary>
38+
/// public bool CanConnect(string address);
39+
````
4240

43-
---
41+
### 4. Device Name Retrieval
4442

45-
## Interface Definition
43+
This retrieves the name of the `Camera` provider.
4644

4745
```csharp
48-
public interface ICaptureFactory
49-
{
50-
Capture Create(string address);
51-
bool CanConnect(string address);
52-
string GetProviderName();
53-
}
46+
/// <summary>
47+
/// Retrieves the name of the Camera provider
48+
/// </summary>
49+
/// public string GetProviderName();
50+
````
51+

0 commit comments

Comments
 (0)