forked from bluenviron/gortsplib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
track_mpeg2video.go
48 lines (42 loc) · 946 Bytes
/
track_mpeg2video.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
package gortsplib //nolint:dupl
import (
psdp "github.com/pion/sdp/v3"
)
// TrackMPEG2Video is a MPEG-1 or MPEG-2 video track.
type TrackMPEG2Video struct {
trackBase
}
func newTrackMPEG2VideoFromMediaDescription(
control string) (*TrackMPEG2Video, error,
) {
return &TrackMPEG2Video{
trackBase: trackBase{
control: control,
},
}, nil
}
// ClockRate returns the track clock rate.
func (t *TrackMPEG2Video) ClockRate() int {
return 90000
}
func (t *TrackMPEG2Video) clone() Track {
return &TrackMPEG2Video{
trackBase: t.trackBase,
}
}
// MediaDescription returns the track media description in SDP format.
func (t *TrackMPEG2Video) MediaDescription() *psdp.MediaDescription {
return &psdp.MediaDescription{
MediaName: psdp.MediaName{
Media: "video",
Protos: []string{"RTP", "AVP"},
Formats: []string{"32"},
},
Attributes: []psdp.Attribute{
{
Key: "control",
Value: t.control,
},
},
}
}