diff --git a/server_publish_test.go b/server_publish_test.go index 3660bfa5..51df064f 100644 --- a/server_publish_test.go +++ b/server_publish_test.go @@ -28,7 +28,7 @@ func invalidURLAnnounceReq(t *testing.T, control string) base.Request { Body: func() []byte { track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04}, nil) require.NoError(t, err) - track.setControl(control) + track.SetControl(control) sout := &psdp.SessionDescription{ SessionName: psdp.SessionName("Stream"), @@ -260,7 +260,7 @@ func TestServerPublishSetupPath(t *testing.T) { track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04}, nil) require.NoError(t, err) - track.setControl(ca.control) + track.SetControl(ca.control) sout := &psdp.SessionDescription{ SessionName: psdp.SessionName("Stream"), diff --git a/track.go b/track.go index fd4b4108..8fbb6eac 100644 --- a/track.go +++ b/track.go @@ -15,8 +15,10 @@ type Track interface { // ClockRate returns the track clock rate. ClockRate() int clone() Track - getControl() string - setControl(string) + // GetControl returns the track control + GetControl() string + // SetControl returns the track control + SetControl(string) url(*base.URL) (*base.URL, error) // MediaDescription returns structured SDP media information MediaDescription() *psdp.MediaDescription @@ -76,7 +78,7 @@ func trackURL(t Track, contentBase *base.URL) (*base.URL, error) { return nil, fmt.Errorf("no Content-Base header provided") } - control := t.getControl() + control := t.GetControl() // no control attribute, use base URL if control == "" { diff --git a/track_aac.go b/track_aac.go index 1d7258ef..194875df 100644 --- a/track_aac.go +++ b/track_aac.go @@ -138,11 +138,13 @@ func (t *TrackAAC) clone() Track { } } -func (t *TrackAAC) getControl() string { +// GetControl gets the track control. +func (t *TrackAAC) GetControl() string { return t.control } -func (t *TrackAAC) setControl(c string) { +// SetControl sets the track control. +func (t *TrackAAC) SetControl(c string) { t.control = c } diff --git a/track_generic.go b/track_generic.go index 4fc06ba7..cccf7212 100644 --- a/track_generic.go +++ b/track_generic.go @@ -139,11 +139,13 @@ func (t *TrackGeneric) clone() Track { } } -func (t *TrackGeneric) getControl() string { +// GetControl returns the track control. +func (t *TrackGeneric) GetControl() string { return t.control } -func (t *TrackGeneric) setControl(c string) { +// SetControl set the track control. +func (t *TrackGeneric) SetControl(c string) { t.control = c } diff --git a/track_h264.go b/track_h264.go index 5a7180e7..2055cdec 100644 --- a/track_h264.go +++ b/track_h264.go @@ -111,11 +111,13 @@ func (t *TrackH264) clone() Track { } } -func (t *TrackH264) getControl() string { +// GetControl gets the track control. +func (t *TrackH264) GetControl() string { return t.control } -func (t *TrackH264) setControl(c string) { +// SetControl sets the track control. +func (t *TrackH264) SetControl(c string) { t.control = c } diff --git a/track_opus.go b/track_opus.go index ba6fe30b..4b4e4bb9 100644 --- a/track_opus.go +++ b/track_opus.go @@ -69,11 +69,13 @@ func (t *TrackOpus) clone() Track { } } -func (t *TrackOpus) getControl() string { +// GetControl returns the track control. +func (t *TrackOpus) GetControl() string { return t.control } -func (t *TrackOpus) setControl(c string) { +// SetControl sets the track control. +func (t *TrackOpus) SetControl(c string) { t.control = c } diff --git a/tracks.go b/tracks.go index de7a7d97..c57401b5 100644 --- a/tracks.go +++ b/tracks.go @@ -44,7 +44,7 @@ func (ts Tracks) clone() Tracks { func (ts Tracks) setControls() { for i, t := range ts { - t.setControl("trackID=" + strconv.FormatInt(int64(i), 10)) + t.SetControl("trackID=" + strconv.FormatInt(int64(i), 10)) } }