@camstack/addon-go2rtc 0.1.7 → 0.1.9
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/go2rtc.addon-CONM8rgq.d.mts +79 -0
- package/dist/go2rtc.addon-CONM8rgq.d.ts +79 -0
- package/dist/go2rtc.addon.d.mts +2 -0
- package/dist/go2rtc.addon.d.ts +2 -0
- package/dist/index.d.mts +22 -0
- package/dist/index.d.ts +22 -0
- package/package.json +3 -3
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { EncodedPacket, IStreamingEngine, StreamingSource, StreamFormat, StreamInfo, StreamStatus, ICamstackAddon, IConfigurable, IRestreamer, AddonManifest, AddonContext, CapabilityProviderMap, RegisteredStream, RestreamerExposedResource, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* IWebRtcProvider interface — copied from server/backend/src/interfaces/webrtc-provider.ts
|
|
5
|
+
* to avoid cross-package dependency.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface IWebRtcProvider {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** Negotiate SDP for a specific stream */
|
|
12
|
+
handleOffer(streamId: string, sdpOffer: string): Promise<string>;
|
|
13
|
+
/** Check if this provider can serve the stream */
|
|
14
|
+
supportsStream(streamId: string): boolean;
|
|
15
|
+
/** Register a stream so the provider knows about it */
|
|
16
|
+
registerStream(streamId: string, codec: string): Promise<void>;
|
|
17
|
+
/** Push encoded packets (provider needs video data to serve WebRTC) */
|
|
18
|
+
pushPacket(streamId: string, packet: EncodedPacket): void;
|
|
19
|
+
/** Unregister a stream */
|
|
20
|
+
unregisterStream(streamId: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Go2rtcConfig {
|
|
24
|
+
readonly apiPort: number;
|
|
25
|
+
readonly rtspPort: number;
|
|
26
|
+
readonly webrtcPort: number;
|
|
27
|
+
readonly binaryPath?: string;
|
|
28
|
+
}
|
|
29
|
+
declare class Go2rtcEngine implements IStreamingEngine {
|
|
30
|
+
private readonly config;
|
|
31
|
+
private readonly baseUrl;
|
|
32
|
+
private readonly streams;
|
|
33
|
+
constructor(config: Go2rtcConfig);
|
|
34
|
+
initialize(_config?: Record<string, unknown>): Promise<void>;
|
|
35
|
+
shutdown(): Promise<void>;
|
|
36
|
+
registerStream(streamId: string, source: StreamingSource): Promise<void>;
|
|
37
|
+
unregisterStream(streamId: string): Promise<void>;
|
|
38
|
+
getStreamUrl(streamId: string, format: StreamFormat): string | null;
|
|
39
|
+
proxyWhepOffer(streamId: string, sdpOffer: string): Promise<string>;
|
|
40
|
+
listStreams(): StreamInfo[];
|
|
41
|
+
getStreamStatus(streamId: string): StreamStatus | null;
|
|
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
|
+
export { Go2rtcAddon as G, type Go2rtcConfig as a, Go2rtcEngine as b, type Go2rtcProcessConfig as c };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { EncodedPacket, IStreamingEngine, StreamingSource, StreamFormat, StreamInfo, StreamStatus, ICamstackAddon, IConfigurable, IRestreamer, AddonManifest, AddonContext, CapabilityProviderMap, RegisteredStream, RestreamerExposedResource, ConfigUISchema } from '@camstack/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* IWebRtcProvider interface — copied from server/backend/src/interfaces/webrtc-provider.ts
|
|
5
|
+
* to avoid cross-package dependency.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface IWebRtcProvider {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
/** Negotiate SDP for a specific stream */
|
|
12
|
+
handleOffer(streamId: string, sdpOffer: string): Promise<string>;
|
|
13
|
+
/** Check if this provider can serve the stream */
|
|
14
|
+
supportsStream(streamId: string): boolean;
|
|
15
|
+
/** Register a stream so the provider knows about it */
|
|
16
|
+
registerStream(streamId: string, codec: string): Promise<void>;
|
|
17
|
+
/** Push encoded packets (provider needs video data to serve WebRTC) */
|
|
18
|
+
pushPacket(streamId: string, packet: EncodedPacket): void;
|
|
19
|
+
/** Unregister a stream */
|
|
20
|
+
unregisterStream(streamId: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Go2rtcConfig {
|
|
24
|
+
readonly apiPort: number;
|
|
25
|
+
readonly rtspPort: number;
|
|
26
|
+
readonly webrtcPort: number;
|
|
27
|
+
readonly binaryPath?: string;
|
|
28
|
+
}
|
|
29
|
+
declare class Go2rtcEngine implements IStreamingEngine {
|
|
30
|
+
private readonly config;
|
|
31
|
+
private readonly baseUrl;
|
|
32
|
+
private readonly streams;
|
|
33
|
+
constructor(config: Go2rtcConfig);
|
|
34
|
+
initialize(_config?: Record<string, unknown>): Promise<void>;
|
|
35
|
+
shutdown(): Promise<void>;
|
|
36
|
+
registerStream(streamId: string, source: StreamingSource): Promise<void>;
|
|
37
|
+
unregisterStream(streamId: string): Promise<void>;
|
|
38
|
+
getStreamUrl(streamId: string, format: StreamFormat): string | null;
|
|
39
|
+
proxyWhepOffer(streamId: string, sdpOffer: string): Promise<string>;
|
|
40
|
+
listStreams(): StreamInfo[];
|
|
41
|
+
getStreamStatus(streamId: string): StreamStatus | null;
|
|
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
|
+
export { Go2rtcAddon as G, type Go2rtcConfig as a, Go2rtcEngine as b, type Go2rtcProcessConfig as c };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { G as Go2rtcAddon, a as Go2rtcConfig, b as Go2rtcEngine, c as Go2rtcProcessConfig } from './go2rtc.addon-CONM8rgq.mjs';
|
|
2
|
+
import '@camstack/types';
|
|
3
|
+
|
|
4
|
+
interface Go2rtcGeneratedConfig {
|
|
5
|
+
api: {
|
|
6
|
+
listen: string;
|
|
7
|
+
};
|
|
8
|
+
rtsp: {
|
|
9
|
+
listen: string;
|
|
10
|
+
};
|
|
11
|
+
webrtc: {
|
|
12
|
+
listen: string;
|
|
13
|
+
};
|
|
14
|
+
streams: Record<string, string[]>;
|
|
15
|
+
}
|
|
16
|
+
declare function generateGo2rtcConfig(config: {
|
|
17
|
+
apiPort: number;
|
|
18
|
+
rtspPort: number;
|
|
19
|
+
webrtcPort: number;
|
|
20
|
+
}): string;
|
|
21
|
+
|
|
22
|
+
export { type Go2rtcGeneratedConfig, generateGo2rtcConfig };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { G as Go2rtcAddon, a as Go2rtcConfig, b as Go2rtcEngine, c as Go2rtcProcessConfig } from './go2rtc.addon-CONM8rgq.js';
|
|
2
|
+
import '@camstack/types';
|
|
3
|
+
|
|
4
|
+
interface Go2rtcGeneratedConfig {
|
|
5
|
+
api: {
|
|
6
|
+
listen: string;
|
|
7
|
+
};
|
|
8
|
+
rtsp: {
|
|
9
|
+
listen: string;
|
|
10
|
+
};
|
|
11
|
+
webrtc: {
|
|
12
|
+
listen: string;
|
|
13
|
+
};
|
|
14
|
+
streams: Record<string, string[]>;
|
|
15
|
+
}
|
|
16
|
+
declare function generateGo2rtcConfig(config: {
|
|
17
|
+
apiPort: number;
|
|
18
|
+
rtspPort: number;
|
|
19
|
+
webrtcPort: number;
|
|
20
|
+
}): string;
|
|
21
|
+
|
|
22
|
+
export { type Go2rtcGeneratedConfig, generateGo2rtcConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-go2rtc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "go2rtc streaming engine addon for CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"import": "./dist/index.mjs",
|
|
25
|
-
"require": "./dist/index.js"
|
|
26
|
-
"types": "./dist/index.d.ts"
|
|
26
|
+
"require": "./dist/index.js"
|
|
27
27
|
},
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|