mirror of
https://github.com/aler9/gortsplib
synced 2025-10-07 08:01:14 +08:00
write MPEG in uppercase
This commit is contained in:
4
track.go
4
track.go
@@ -67,7 +67,7 @@ func newTrackFromMediaDescription(md *psdp.MediaDescription) (Track, error) {
|
||||
return newTrackJPEGFromMediaDescription(control)
|
||||
|
||||
case md.MediaName.Formats[0] == "32":
|
||||
return newTrackMpegVideoFromMediaDescription(control)
|
||||
return newTrackMPEGVideoFromMediaDescription(control)
|
||||
|
||||
case rtpmapPart1 == "H264/90000":
|
||||
return newTrackH264FromMediaDescription(control, payloadType, md)
|
||||
@@ -91,7 +91,7 @@ func newTrackFromMediaDescription(md *psdp.MediaDescription) (Track, error) {
|
||||
return newTrackPCMAFromMediaDescription(control, rtpmapPart1)
|
||||
|
||||
case md.MediaName.Formats[0] == "14":
|
||||
return newTrackMpegAudioFromMediaDescription(control)
|
||||
return newTrackMPEGAudioFromMediaDescription(control)
|
||||
|
||||
case strings.HasPrefix(strings.ToLower(rtpmapPart1), "mpeg4-generic/"):
|
||||
return newTrackMPEG4AudioFromMediaDescription(control, payloadType, md)
|
||||
|
@@ -4,15 +4,15 @@ import (
|
||||
psdp "github.com/pion/sdp/v3"
|
||||
)
|
||||
|
||||
// TrackMpegAudio is a MPEG-1 or MPEG-2 audio track.
|
||||
type TrackMpegAudio struct {
|
||||
// TrackMPEGAudio is a MPEG-1 or MPEG-2 audio track.
|
||||
type TrackMPEGAudio struct {
|
||||
trackBase
|
||||
}
|
||||
|
||||
func newTrackMpegAudioFromMediaDescription(
|
||||
control string) (*TrackMpegAudio, error,
|
||||
func newTrackMPEGAudioFromMediaDescription(
|
||||
control string) (*TrackMPEGAudio, error,
|
||||
) {
|
||||
return &TrackMpegAudio{
|
||||
return &TrackMPEGAudio{
|
||||
trackBase: trackBase{
|
||||
control: control,
|
||||
},
|
||||
@@ -20,18 +20,18 @@ func newTrackMpegAudioFromMediaDescription(
|
||||
}
|
||||
|
||||
// ClockRate returns the track clock rate.
|
||||
func (t *TrackMpegAudio) ClockRate() int {
|
||||
func (t *TrackMPEGAudio) ClockRate() int {
|
||||
return 90000
|
||||
}
|
||||
|
||||
func (t *TrackMpegAudio) clone() Track {
|
||||
return &TrackMpegAudio{
|
||||
func (t *TrackMPEGAudio) clone() Track {
|
||||
return &TrackMPEGAudio{
|
||||
trackBase: t.trackBase,
|
||||
}
|
||||
}
|
||||
|
||||
// MediaDescription returns the track media description in SDP format.
|
||||
func (t *TrackMpegAudio) MediaDescription() *psdp.MediaDescription {
|
||||
func (t *TrackMPEGAudio) MediaDescription() *psdp.MediaDescription {
|
||||
return &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
Media: "audio",
|
||||
|
@@ -7,21 +7,21 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTrackMpegAudioNew(t *testing.T) {
|
||||
track := &TrackMpegAudio{}
|
||||
func TestTrackMPEGAudioNew(t *testing.T) {
|
||||
track := &TrackMPEGAudio{}
|
||||
require.Equal(t, "", track.GetControl())
|
||||
}
|
||||
|
||||
func TestTrackMpegAudioClone(t *testing.T) {
|
||||
track := &TrackMpegAudio{}
|
||||
func TestTrackMPEGAudioClone(t *testing.T) {
|
||||
track := &TrackMPEGAudio{}
|
||||
|
||||
clone := track.clone()
|
||||
require.NotSame(t, track, clone)
|
||||
require.Equal(t, track, clone)
|
||||
}
|
||||
|
||||
func TestTrackMpegAudioMediaDescription(t *testing.T) {
|
||||
track := &TrackMpegAudio{}
|
||||
func TestTrackMPEGAudioMediaDescription(t *testing.T) {
|
||||
track := &TrackMPEGAudio{}
|
||||
|
||||
require.Equal(t, &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
|
@@ -4,15 +4,15 @@ import (
|
||||
psdp "github.com/pion/sdp/v3"
|
||||
)
|
||||
|
||||
// TrackMpegVideo is a MPEG-1 or MPEG-2 video track.
|
||||
type TrackMpegVideo struct {
|
||||
// TrackMPEGVideo is a MPEG-1 or MPEG-2 video track.
|
||||
type TrackMPEGVideo struct {
|
||||
trackBase
|
||||
}
|
||||
|
||||
func newTrackMpegVideoFromMediaDescription(
|
||||
control string) (*TrackMpegVideo, error,
|
||||
func newTrackMPEGVideoFromMediaDescription(
|
||||
control string) (*TrackMPEGVideo, error,
|
||||
) {
|
||||
return &TrackMpegVideo{
|
||||
return &TrackMPEGVideo{
|
||||
trackBase: trackBase{
|
||||
control: control,
|
||||
},
|
||||
@@ -20,18 +20,18 @@ func newTrackMpegVideoFromMediaDescription(
|
||||
}
|
||||
|
||||
// ClockRate returns the track clock rate.
|
||||
func (t *TrackMpegVideo) ClockRate() int {
|
||||
func (t *TrackMPEGVideo) ClockRate() int {
|
||||
return 90000
|
||||
}
|
||||
|
||||
func (t *TrackMpegVideo) clone() Track {
|
||||
return &TrackMpegVideo{
|
||||
func (t *TrackMPEGVideo) clone() Track {
|
||||
return &TrackMPEGVideo{
|
||||
trackBase: t.trackBase,
|
||||
}
|
||||
}
|
||||
|
||||
// MediaDescription returns the track media description in SDP format.
|
||||
func (t *TrackMpegVideo) MediaDescription() *psdp.MediaDescription {
|
||||
func (t *TrackMPEGVideo) MediaDescription() *psdp.MediaDescription {
|
||||
return &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
Media: "video",
|
||||
|
@@ -7,21 +7,21 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTrackMpegVideoNew(t *testing.T) {
|
||||
track := &TrackMpegVideo{}
|
||||
func TestTrackMPEGVideoNew(t *testing.T) {
|
||||
track := &TrackMPEGVideo{}
|
||||
require.Equal(t, "", track.GetControl())
|
||||
}
|
||||
|
||||
func TestTrackMpegVideoClone(t *testing.T) {
|
||||
track := &TrackMpegVideo{}
|
||||
func TestTrackMPEGVideoClone(t *testing.T) {
|
||||
track := &TrackMPEGVideo{}
|
||||
|
||||
clone := track.clone()
|
||||
require.NotSame(t, track, clone)
|
||||
require.Equal(t, track, clone)
|
||||
}
|
||||
|
||||
func TestTrackMpegVideoMediaDescription(t *testing.T) {
|
||||
track := &TrackMpegVideo{}
|
||||
func TestTrackMPEGVideoMediaDescription(t *testing.T) {
|
||||
track := &TrackMPEGVideo{}
|
||||
|
||||
require.Equal(t, &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
|
@@ -47,7 +47,7 @@ func TestTrackNewFromMediaDescription(t *testing.T) {
|
||||
Formats: []string{"14"},
|
||||
},
|
||||
},
|
||||
&TrackMpegAudio{},
|
||||
&TrackMPEGAudio{},
|
||||
},
|
||||
{
|
||||
"aac",
|
||||
@@ -226,7 +226,7 @@ func TestTrackNewFromMediaDescription(t *testing.T) {
|
||||
Formats: []string{"32"},
|
||||
},
|
||||
},
|
||||
&TrackMpegVideo{},
|
||||
&TrackMPEGVideo{},
|
||||
},
|
||||
{
|
||||
"h264",
|
||||
|
Reference in New Issue
Block a user