-
Notifications
You must be signed in to change notification settings - Fork 119
/
recordertrack.go
47 lines (36 loc) · 941 Bytes
/
recordertrack.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
package mediaserver
type RecorderTrackStopListener func()
// RecorderTrack a track to record
type RecorderTrack struct {
id string
track *IncomingStreamTrack
encoding *Encoding
}
// NewRecorderTrack create a new recorder track
func NewRecorderTrack(id string, track *IncomingStreamTrack, encoding *Encoding) *RecorderTrack {
recorderTrack := &RecorderTrack{}
recorderTrack.id = id
recorderTrack.track = track
recorderTrack.encoding = encoding
return recorderTrack
}
// GetID get recorder track id
func (r *RecorderTrack) GetID() string {
return r.id
}
// GetTrack get internal IncomingStreamTrack
func (r *RecorderTrack) GetTrack() *IncomingStreamTrack {
return r.track
}
// GetEncoding get encoding info
func (r *RecorderTrack) GetEncoding() *Encoding {
return r.encoding
}
// Stop stop the recorder track
func (r *RecorderTrack) Stop() {
if r.track == nil {
return
}
r.track = nil
r.encoding = nil
}