-
Notifications
You must be signed in to change notification settings - Fork 1
/
live_lobby_manager.go
73 lines (60 loc) · 2.8 KB
/
live_lobby_manager.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package stream
import (
"context"
"github.com/google/uuid"
"github.com/pion/webrtc/v3"
"github.com/shigde/sfu/internal/lobby/resources"
)
type liveLobbyManager interface {
NewIngressResource(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription, option ...resources.Option) (*resources.WebRTC, error)
NewEgressResource(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription, option ...resources.Option) (*resources.WebRTC, error)
LeaveLobby(ctx context.Context, lobbyId uuid.UUID, userId uuid.UUID) (bool, error)
// Live Stream Publishing API
StartLiveStream(ctx context.Context, lobbyId uuid.UUID, key string, rtmpUrl string, userId uuid.UUID) error
StopLiveStream(ctx context.Context, lobbyId uuid.UUID, userId uuid.UUID) error
// Deprecated API
// CreateLobbyIngressEndpoint
// Deprecated: Because the Endpoint API is getting simpler
CreateLobbyIngressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription) (struct {
Answer *webrtc.SessionDescription
Resource uuid.UUID
RtpSessionId uuid.UUID
}, error)
// InitLobbyEgressEndpoint
// Deprecated: Because the Endpoint API is getting simpler
InitLobbyEgressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID) (struct {
Offer *webrtc.SessionDescription
Active bool
RtpSessionId uuid.UUID
}, error)
// FinalCreateLobbyEgressEndpoint
// Deprecated: Because the Endpoint API is getting simpler
FinalCreateLobbyEgressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription) (struct {
Answer *webrtc.SessionDescription
Active bool
RtpSessionId uuid.UUID
}, error)
// CreateMainStreamLobbyEgressEndpoint
// Deprecated: Because the Endpoint API is getting simpler
CreateMainStreamLobbyEgressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription) (struct {
Answer *webrtc.SessionDescription
RtpSessionId uuid.UUID
}, error)
// CreateLobbyHostPipe
// Deprecated: Because the Endpoint API is getting simpler
CreateLobbyHostPipe(ctx context.Context, u uuid.UUID, offer *webrtc.SessionDescription, instanceId uuid.UUID) (struct {
Answer *webrtc.SessionDescription
Resource uuid.UUID
RtpSessionId uuid.UUID
}, error)
// CreateLobbyHostIngress
// Deprecated: Because the Endpoint API is getting simpler
CreateLobbyHostIngress(ctx context.Context, u uuid.UUID, offer *webrtc.SessionDescription, instanceId uuid.UUID) (struct {
Answer *webrtc.SessionDescription
Resource uuid.UUID
RtpSessionId uuid.UUID
}, error)
// CloseLobbyHostPipe
// Deprecated: Because the Endpoint API is getting simpler
CloseLobbyHostPipe(ctx context.Context, u uuid.UUID, id uuid.UUID) (bool, error)
}