@camstack/addon-go2rtc 0.1.3 → 0.1.5

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.
package/dist/index.d.ts DELETED
@@ -1,97 +0,0 @@
1
- import { IStreamingEngine, StreamingSource, StreamFormat, StreamInfo, StreamStatus, EncodedPacket, ICamstackAddon, IConfigurable, IRestreamer, AddonManifest, AddonContext, CapabilityProviderMap, RegisteredStream, RestreamerExposedResource, ConfigUISchema } from '@camstack/types';
2
-
3
- interface Go2rtcConfig {
4
- readonly apiPort: number;
5
- readonly rtspPort: number;
6
- readonly webrtcPort: number;
7
- readonly binaryPath?: string;
8
- }
9
- declare class Go2rtcEngine implements IStreamingEngine {
10
- private readonly config;
11
- private readonly baseUrl;
12
- private readonly streams;
13
- constructor(config: Go2rtcConfig);
14
- initialize(_config?: Record<string, unknown>): Promise<void>;
15
- shutdown(): Promise<void>;
16
- registerStream(streamId: string, source: StreamingSource): Promise<void>;
17
- unregisterStream(streamId: string): Promise<void>;
18
- getStreamUrl(streamId: string, format: StreamFormat): string | null;
19
- proxyWhepOffer(streamId: string, sdpOffer: string): Promise<string>;
20
- listStreams(): StreamInfo[];
21
- getStreamStatus(streamId: string): StreamStatus | null;
22
- }
23
-
24
- /**
25
- * IWebRtcProvider interface — copied from server/backend/src/interfaces/webrtc-provider.ts
26
- * to avoid cross-package dependency.
27
- */
28
-
29
- interface IWebRtcProvider {
30
- readonly id: string;
31
- readonly name: string;
32
- /** Negotiate SDP for a specific stream */
33
- handleOffer(streamId: string, sdpOffer: string): Promise<string>;
34
- /** Check if this provider can serve the stream */
35
- supportsStream(streamId: string): boolean;
36
- /** Register a stream so the provider knows about it */
37
- registerStream(streamId: string, codec: string): Promise<void>;
38
- /** Push encoded packets (provider needs video data to serve WebRTC) */
39
- pushPacket(streamId: string, packet: EncodedPacket): void;
40
- /** Unregister a stream */
41
- unregisterStream(streamId: string): Promise<void>;
42
- }
43
-
44
- interface Go2rtcProcessConfig {
45
- readonly apiPort: number;
46
- readonly rtspPort: number;
47
- readonly webrtcPort: number;
48
- readonly binaryPath: string;
49
- }
50
- declare class Go2rtcAddon implements ICamstackAddon, IConfigurable, IRestreamer, IWebRtcProvider {
51
- readonly manifest: AddonManifest;
52
- /** IRestreamer identity */
53
- readonly id = "go2rtc";
54
- readonly name = "go2rtc Restreamer";
55
- private engine;
56
- private process;
57
- private readonly registeredDevices;
58
- private currentConfig;
59
- initialize(context: AddonContext): Promise<void>;
60
- shutdown(): Promise<void>;
61
- getEngine(): Go2rtcEngine;
62
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
63
- registerDevice(deviceId: string, streams: readonly RegisteredStream[]): Promise<void>;
64
- pushPacket(_streamId: string, _packet: EncodedPacket): void;
65
- unregisterDevice(deviceId: string): Promise<void>;
66
- getExposedResources(deviceId: string): readonly RestreamerExposedResource[];
67
- proxyWhepOffer(streamId: string, sdpOffer: string): Promise<string>;
68
- handleOffer(streamId: string, sdpOffer: string): Promise<string>;
69
- supportsStream(streamId: string): boolean;
70
- registerStream(streamId: string, _codec: string): Promise<void>;
71
- unregisterStream(streamId: string): Promise<void>;
72
- /** Exposed for testing */
73
- waitForReady(url: string, timeoutMs: number): Promise<void>;
74
- getConfigSchema(): ConfigUISchema;
75
- getConfig(): Record<string, unknown>;
76
- onConfigChange(config: Record<string, unknown>): Promise<void>;
77
- }
78
-
79
- interface Go2rtcGeneratedConfig {
80
- api: {
81
- listen: string;
82
- };
83
- rtsp: {
84
- listen: string;
85
- };
86
- webrtc: {
87
- listen: string;
88
- };
89
- streams: Record<string, string[]>;
90
- }
91
- declare function generateGo2rtcConfig(config: {
92
- apiPort: number;
93
- rtspPort: number;
94
- webrtcPort: number;
95
- }): string;
96
-
97
- export { Go2rtcAddon, type Go2rtcConfig, Go2rtcEngine, type Go2rtcGeneratedConfig, type Go2rtcProcessConfig, generateGo2rtcConfig };